Utils::normalizeUrl($options['authUrl']), // 'handler' => HandlerStack::create(), //]); $httpClient = new Client([ 'base_uri' => Utils::normalizeUrl($options['authUrl']), 'handler' => $stack, ]); $options['identityService'] = Service::factory($httpClient); //AuthHadler? // $options['authHandler'] = function () use ($options) { return $options['identityService']->generateToken($options); }; //StockClient? // creer $options['httpClient'] instance de ClientInterface // token, baseUrl = identity->authenticate // stack = getStack authhandler token // addDebug?? // $options['httpClient'] = httpCLient baseurl stack $baseUrl = $options['authUrl']; //$stack = HandlerStack::create(); $stack->push(Middleware::authHandler($options['authHandler'], $token)); $this->addDebugMiddleware($options, $stack); $options['httpClient'] = $httpClient; $this->optionsGlobal = $options; } /** * @codeCoverageIgnore */ private function addDebugMiddleware(array $options, HandlerStack &$stack) { if (!empty($options['debugLog']) && !empty($options['logger']) && !empty($options['messageFormatter']) ) { $stack->push(GuzzleMiddleware::log($options['logger'], $options['messageFormatter'])); } } public function getOptions(){ return $this->optionsGlobal; } }