Completed
Push — 3.x ( 96fa4f...8d695c )
by
unknown
01:33
created

tests/bootstrap.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
/*
13
 * fix encoding issue while running text on different host with different locale configuration
14
 */
15
setlocale(LC_ALL, 'en_US.UTF-8');
16
17
if (file_exists($file = __DIR__.'/autoload.php')) {
18
    require_once $file;
19
} elseif (file_exists($file = __DIR__.'/autoload.php.dist')) {
20
    require_once $file;
21
}
22
23
/*
24
 * try to get Symfony's PHPUnit Bridge
25
 */
26
$files = array_filter([
27
    __DIR__.'/../vendor/symfony/symfony/src/Symfony/Bridge/PhpUnit/bootstrap.php',
28
    __DIR__.'/../vendor/symfony/phpunit-bridge/bootstrap.php',
29
    __DIR__.'/../../../../vendor/symfony/symfony/src/Symfony/Bridge/PhpUnit/bootstrap.php',
30
    __DIR__.'/../../../../vendor/symfony/phpunit-bridge/bootstrap.php',
31
], 'file_exists');
32
33
if ($files) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $files of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

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.

Loading history...
34
    require_once current($files);
35
}
36