I am trying to call a property declared in a constructor in a static method but I don't think I am doing it the right way as I am getting no result. This is my code:
class myClass
{
private static $client;
public function __construct(Client $client)
{
self::$client = $client;
}
public static function getBuses(){
$call = self::$client->get('localhost/api-call');
}
}
What might be wrong here? I get this error - Call to a member function get() on null