Skip to content

Commit dcd31dc

Browse files
committed
fix e2e tests
1 parent 4f90ac0 commit dcd31dc

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ jobs:
296296
../../bin/phpstan analyze test.php --level=0
297297
- script: |
298298
cd e2e/composer-version-config-invalid
299-
OUTPUT=$(../../bin/phpstan 2>&1)
299+
OUTPUT=$(../../bin/phpstan 2>&1 || true)
300300
grep 'Invalid configuration' <<< "$OUTPUT"
301301
grep 'Invalid PHP version range: phpVersion.max should be greater or equal to phpVersion.min.' <<< "$OUTPUT"
302302
steps:

src/DependencyInjection/ContainerFactory.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Nette\DI\Definitions\Statement;
88
use Nette\DI\Extensions\ExtensionsExtension;
99
use Nette\DI\Helpers;
10-
use Nette\DI\InvalidConfigurationException;
1110
use Nette\Schema\Context as SchemaContext;
1211
use Nette\Schema\Elements\AnyOf;
1312
use Nette\Schema\Elements\Structure;
@@ -37,6 +36,7 @@
3736
use PHPStan\Type\ObjectType;
3837
use Symfony\Component\Finder\Finder;
3938
use function array_diff_key;
39+
use function array_key_exists;
4040
use function array_map;
4141
use function array_merge;
4242
use function array_unique;
@@ -355,14 +355,15 @@ private function validateParameters(array $parameters, array $parametersSchema):
355355
$processor->process($schema, $parameters);
356356

357357
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+
}
362362

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.');
366367
}
367368
}
368369

0 commit comments

Comments
 (0)