Conditions | 2 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | 4 | public function getServiceConfig() |
|
16 | { |
||
17 | return [ |
||
18 | 4 | 'factories' => [ |
|
19 | 4 | Client::class => function (ContainerInterface $container) { |
|
20 | 2 | $config = $container->get('config'); |
|
21 | |||
22 | 2 | if (isset($config['stream']['url'])) { |
|
23 | 1 | return Client::herokuConnect($config['stream']['url']); |
|
24 | } |
||
25 | |||
26 | 1 | return new Client( |
|
27 | 1 | $config['stream']['app_key'], |
|
28 | 1 | $config['stream']['app_secret'] |
|
29 | ); |
||
30 | 4 | }, |
|
31 | ], |
||
32 | 'shared' => [ |
||
33 | Client::class => true, |
||
34 | ], |
||
35 | ]; |
||
36 | } |
||
37 | } |
||
38 |