These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | /* |
||
6 | * This file is part of the Sonata Project package. |
||
7 | * |
||
8 | * (c) Thomas Rabaix <[email protected]> |
||
9 | * |
||
10 | * For the full copyright and license information, please view the LICENSE |
||
11 | * file that was distributed with this source code. |
||
12 | */ |
||
13 | |||
14 | /* |
||
15 | * fix encoding issue while running text on different host with different locale configuration |
||
16 | */ |
||
17 | setlocale(LC_ALL, 'en_US.UTF-8'); |
||
18 | |||
19 | if (file_exists($file = __DIR__.'/autoload.php')) { |
||
20 | require_once $file; |
||
21 | } elseif (file_exists($file = __DIR__.'/autoload.php.dist')) { |
||
22 | require_once $file; |
||
23 | } |
||
24 | |||
25 | /* |
||
26 | * try to get Symfony's PHPUnit Bridge |
||
27 | */ |
||
28 | $files = array_filter([ |
||
29 | __DIR__.'/../vendor/symfony/symfony/src/Symfony/Bridge/PhpUnit/bootstrap.php', |
||
30 | __DIR__.'/../vendor/symfony/phpunit-bridge/bootstrap.php', |
||
31 | __DIR__.'/../../../../vendor/symfony/symfony/src/Symfony/Bridge/PhpUnit/bootstrap.php', |
||
32 | __DIR__.'/../../../../vendor/symfony/phpunit-bridge/bootstrap.php', |
||
33 | ], 'file_exists'); |
||
34 | |||
35 | if ($files) { |
||
0 ignored issues
–
show
|
|||
36 | require_once current($files); |
||
37 | } |
||
38 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.