| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 4 | public function check(array $config): bool |
|
| 27 | { |
||
| 28 | 4 | if (interface_exists(\Dotenv\Environment\FactoryInterface::class)) { |
|
| 29 | 2 | $env = Dotenv::create(base_path(), '.env'); |
|
| 30 | } else { |
||
| 31 | 2 | $env = new Dotenv(base_path(), '.env'); |
|
| 32 | } |
||
| 33 | |||
| 34 | 4 | $env->safeLoad(); |
|
| 35 | |||
| 36 | 4 | return in_array('CACHE_PREFIX', $env->getEnvironmentVariableNames()); |
|
| 37 | } |
||
| 38 | |||
| 50 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: