|
1 | 1 | <?php |
2 | 2 |
|
3 | | -/** |
4 | | - * MIT License. This file is part of the Propel package. |
5 | | - * For the full copyright and license information, please view the LICENSE |
6 | | - * file that was distributed with this source code. |
7 | | - */ |
| 3 | +declare(strict_types = 1); |
8 | 4 |
|
9 | 5 | namespace Propel\Common\Config; |
10 | 6 |
|
|
15 | 11 | use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException as SymfonyInvalidConfigurationException; |
16 | 12 | use Symfony\Component\Config\Definition\Processor; |
17 | 13 | use Symfony\Component\Finder\Finder; |
| 14 | +use function array_any; |
| 15 | +use function array_filter; |
| 16 | +use function array_key_exists; |
| 17 | +use function array_key_first; |
| 18 | +use function array_keys; |
| 19 | +use function array_merge_recursive; |
| 20 | +use function array_pop; |
| 21 | +use function array_reduce; |
| 22 | +use function array_replace_recursive; |
| 23 | +use function array_reverse; |
| 24 | +use function explode; |
| 25 | +use function file_exists; |
| 26 | +use function getcwd; |
| 27 | +use function implode; |
| 28 | +use function in_array; |
| 29 | +use function is_dir; |
| 30 | +use function is_string; |
| 31 | +use function ksort; |
| 32 | +use function str_ends_with; |
| 33 | +use function var_export; |
| 34 | +use const PHP_EOL; |
18 | 35 |
|
19 | 36 | /** |
20 | 37 | * Class ConfigurationManager |
21 | 38 | * |
22 | 39 | * Class to load and process configuration files. Supported formats are: php, ini (or .properties), yaml, xml, json. |
23 | | - * |
24 | | - * @author Cristiano Cinotti |
25 | 40 | */ |
26 | 41 | class ConfigurationManager |
27 | 42 | { |
@@ -303,7 +318,7 @@ private function getConfigFileNamesFromDirectory(string $path): array |
303 | 318 | $orderedConfigFileNames = []; |
304 | 319 | foreach ($finder as $file) { |
305 | 320 | $realPath = $file->getRealPath(); |
306 | | - $isExecutable = array_any(['propel', 'perpl'], fn ($cmd) => str_ends_with($realPath, "/bin/{$cmd}.php")); |
| 321 | + $isExecutable = $realPath && array_any(['propel', 'perpl'], fn ($cmd) => str_ends_with($realPath, "/bin/{$cmd}.php")); |
307 | 322 | if ($isExecutable) { |
308 | 323 | continue; |
309 | 324 | } |
|
0 commit comments