/** * @param HydratorInterface $hydrator * @param HttpClient $client * @param LoggerInterface $logger * @param string $api_key * @param string $api_endpoint */ public function __construct(HydratorInterface $hydrator, HttpClient $client, LoggerInterface $logger, $api_key = null, $api_endpoint) { parent::__construct($logger); $this->hydrator = $hydrator; $this->client = $client; $this->api_key = $api_key; $this->api_endpoint = $api_endpoint; }
/** * @param HydratorInterface $hydrator * @param HttpClient $client * @param LoggerInterface $logger * @param string $api_key * @param string $api_endpoint * @throws \Exception */ public function __construct(HydratorInterface $hydrator, HttpClient $client, LoggerInterface $logger, $api_key = null, $api_endpoint) { parent::__construct($logger); $this->hydrator = $hydrator; $this->client = $client; $api_params = explode(';', $api_key); if (count($api_params) != 2) { throw new \Exception('Bad Api Key, see doc.'); } $this->app_id = $api_params[0]; $this->app_code = $api_params[1]; $api_endpoints = explode(';', $api_endpoint); if (count($api_endpoints) != 2) { throw new \Exception('Bad Api EndPoints, see doc.'); } $this->api_endpoint = $api_endpoint[0]; $this->api_reverse_endpoint = $api_endpoint[1]; }