I need to use static methods with
public static function init()
$settings = [
'username' => 'user1',
self::$client = new Client($settings);
public static function foo( )
As an approach this method is fine, but to be more SOLID here I would pass
init() function like
init(Client $client) rather than instantiating it right in class. So do and
$settings, better pass as an argument or preserve in some
private variable rather than hardcoding in initializer.
No performance issues, but only an architectural approach. But as to me I don't see any preconditions here for avoiding constructor and use
$api = new API($client, $settings); rather than static invocation.
And constructor (or initializer) signature would look like
public function __construct(Client $client, array $settings);