| Conditions | 4 |
| Paths | 1 |
| Total Lines | 32 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function register(Container $container) |
||
| 27 | { |
||
| 28 | $container->share(Factory::class, function($c) { |
||
|
|
|||
| 29 | $factory = new Factory(); |
||
| 30 | |||
| 31 | if ($token = Settings::get('providers.github.token', false)) { |
||
| 32 | $client = new Client([ |
||
| 33 | 'headers' => [ |
||
| 34 | "Authorization" => "token {$token}", |
||
| 35 | ] |
||
| 36 | ]); |
||
| 37 | $factory->addProvider(new Github($client, $token)); |
||
| 38 | } |
||
| 39 | |||
| 40 | if ($token = Settings::get('providers.gitlab.token', false)) { |
||
| 41 | $client = new Client([ |
||
| 42 | 'headers' => [ |
||
| 43 | "Private-Token" => $token, |
||
| 44 | ] |
||
| 45 | ]); |
||
| 46 | $factory->addProvider(new Gitlab($client, $token)); |
||
| 47 | } |
||
| 48 | |||
| 49 | if ($token = Settings::get('providers.bitbucket.token', false)) { |
||
| 50 | $username = Settings::get('providers.bitbucket.username', false); |
||
| 51 | $client = new Client([ |
||
| 52 | 'auth' => [$username, $token], |
||
| 53 | ]); |
||
| 54 | $factory->addProvider(new Bitbucket($client, $token)); |
||
| 55 | } |
||
| 56 | |||
| 57 | return $factory; |
||
| 58 | }); |
||
| 61 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.