wimski / laravel-psr-http

PSR HTTP setup for Laravel
MIT License
1 stars 1 forks source link

Cannot instantiate interface Psr\Http\Client\ClientInterface #1

Closed Vahagn-99 closed 2 years ago

Vahagn-99 commented 2 years ago

if (app()->environment('local')) { $this->cdek = new \CdekSDK2\Client(new ClientInterface, env('cdek_TEST_ACCOUNT'), env('cdek_TEST_SECURE_PASSWORD')); $this->cdek->setTest(true); } else { $this->cdek = new \CdekSDK2\Client(new ClientInterface, env('cdek_ACCOUNT'), env('cdek_TEST_SECURE_PASSWORD')); } return $this->cdek;

when i 'm trying to pass interface as parameter i get the above error

wimski commented 2 years ago

That is correct. Interfaces are by nature not instantiable.