Conditions | 2 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
34 | public function boot() |
||
35 | { |
||
36 | $dotEnv = \Dotenv\Dotenv::create(__DIR__ . '../..'); |
||
37 | $dotEnv->safeLoad(); |
||
38 | $dotEnv->required(['GITLAB_TOKEN'])->notEmpty(); |
||
39 | |||
40 | /** @var Container $container */ |
||
41 | $container = $this->getContainer(); |
||
42 | |||
43 | $container->add('SLACK_WEBHOOK_URL', getenv('SLACK_WEBHOOK_URL')); |
||
44 | $container->add('SLACK_CHANNEL', getenv('SLACK_CHANNEL')); |
||
45 | $container->add('GITLAB_TOKEN', getenv('GITLAB_TOKEN')); |
||
46 | $container->add('GITLAB_URL', (getenv('GITLAB_URL') ? getenv('GITLAB_URL') : 'https://gitlab.com')); |
||
47 | } |
||
49 |
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.