public function __construct(array $args = []) { $this->args = $args; if (!isset($args['client'])) { $this->args['client'] = static function () { static $handler; if (!$handler) { $handler = Client::getDefaultHandler(); } return new Client(['handler' => $handler]); }; } }