Skip to content

Commit

Permalink
WID-513 - Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
brampauwelyn committed Feb 28, 2024
1 parent 5b29280 commit 151db1d
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions app/UitpasAPI/UitpasAPIServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,31 @@
class UitpasAPIServiceProvider extends APIServiceProviderBase
{

public function register(Container $pimple)
{
$pimple['uitpas_api'] = function (Container $pimple) {
return new UitpasClient(new Client($this->getConfig($pimple)));
};
public function register(Container $pimple)
{
$pimple['uitpas_api'] = function (Container $pimple) {
return new UitpasClient(new Client($this->getConfig($pimple)));
};

$pimple['uitpas_api_test'] = function (Container $pimple) {
$config = $this->getConfig($pimple);
$config['base_uri'] = $pimple['uitpas_api_test.base_url'];
$config['headers']['x-client-id'] = $pimple['uitpas_api_test.x_client_id'];
$pimple['uitpas_api_test'] = function (Container $pimple) {
$config = $this->getConfig($pimple);
$config['base_uri'] = $pimple['uitpas_api_test.base_url'];
$config['headers']['x-client-id'] = $pimple['uitpas_api_test.x_client_id'];

return new UitpasClient(new Client($config));
};
}
return new UitpasClient(new Client($config));
};
}

private function getConfig(Container $pimple)
{
return [
'base_uri' => $pimple['uitpas_api.base_url'],
'headers' => [
'Content-type' => 'application/json; charset=utf-8',
'Accept' => 'application/ld+json',
'x-client-id' => $pimple['uitpas_api.x_client_id'],
],
'handler' => $this->getHandlerStack('uitpas_api', $pimple),
];
}


private function getConfig(Container $pimple)
{
return [
'base_uri' => $pimple['uitpas_api.base_url'],
'headers' => [
'Content-type' => 'application/json; charset=utf-8',
'Accept' => 'application/ld+json',
'x-client-id' => $pimple['uitpas_api.x_client_id'],
],
'handler' => $this->getHandlerStack('uitpas_api', $pimple),
];
}
}

0 comments on commit 151db1d

Please sign in to comment.