I create a Client class which implement interface. I need takes Guzzle's client as constructor argument, but i can't do that.
<?php
namespace Payum\Core\Bridge\Psr\Http;
use GuzzleHttp\Client;
use Psr\Http\Message\ResponseInterface;
class Client implements ClientInterface
{
$client = new \GuzzleHttp\Client(); // there is error 'Unexpected'
public function __construct($client)
{
}
public function responeInterface()
{
}
}
Your Client class has a client property that needs to be initilised in the constructor, not in its declaration.
Also I do not see where your ClientInterface is coming from? Should you have a use statement that imports the interface???
Let me know if this code helps
Then you need to instantiate your client class by passing an instance of Guzzle to the constructor. i.e.