|
7 | 7 | use Nette\DI\Definitions\Statement; |
8 | 8 | use Nette\DI\Extensions\ExtensionsExtension; |
9 | 9 | use Nette\DI\Helpers; |
10 | | -use Nette\DI\InvalidConfigurationException; |
11 | 10 | use Nette\Schema\Context as SchemaContext; |
12 | 11 | use Nette\Schema\Elements\AnyOf; |
13 | 12 | use Nette\Schema\Elements\Structure; |
|
37 | 36 | use PHPStan\Type\ObjectType; |
38 | 37 | use Symfony\Component\Finder\Finder; |
39 | 38 | use function array_diff_key; |
| 39 | +use function array_key_exists; |
40 | 40 | use function array_map; |
41 | 41 | use function array_merge; |
42 | 42 | use function array_unique; |
@@ -355,14 +355,15 @@ private function validateParameters(array $parameters, array $parametersSchema): |
355 | 355 | $processor->process($schema, $parameters); |
356 | 356 |
|
357 | 357 | if ( |
358 | | - array_key_exists('phpVersion', $parameters) |
359 | | - && is_array($parameters['phpVersion'])) |
360 | | - { |
361 | | - $phpVersion = $parameters['phpVersion']; |
| 358 | + !array_key_exists('phpVersion', $parameters) |
| 359 | + || !is_array($parameters['phpVersion'])) { |
| 360 | + return; |
| 361 | + } |
362 | 362 |
|
363 | | - if ($phpVersion['max'] < $phpVersion['min']) { |
364 | | - throw new InvalidPhpVersionException('Invalid PHP version range: phpVersion.max should be greater or equal to phpVersion.min.'); |
365 | | - } |
| 363 | + $phpVersion = $parameters['phpVersion']; |
| 364 | + |
| 365 | + if ($phpVersion['max'] < $phpVersion['min']) { |
| 366 | + throw new InvalidPhpVersionException('Invalid PHP version range: phpVersion.max should be greater or equal to phpVersion.min.'); |
366 | 367 | } |
367 | 368 | } |
368 | 369 |
|
|
0 commit comments