Skip to content

Commit 641e5d8

Browse files
AlexejLeinweberpl-github
authored andcommitted
fix: Remove redundant condition for config-check
1 parent 181ca68 commit 641e5d8

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"matthiasnoback/symfony-config-test": "^5.1",
2121
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
2222
"mikey179/vfsstream": "^1.6.11",
23-
"phpstan/phpstan": "^1.10",
23+
"phpstan/phpstan": "^1.10.67",
2424
"phpunit/phpunit": "^10.5",
2525
"predis/predis": "^2.2",
2626
"symfony/clock": "^6.4|^7.0",

src/Bundle/DependencyInjection/BrainbitsBlockingExtension.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
use Brainbits\Blocking\Owner\OwnerFactoryInterface;
1717
use Brainbits\Blocking\Storage\StorageInterface;
18-
use InvalidArgumentException;
1918
use Symfony\Component\Config\FileLocator;
2019
use Symfony\Component\DependencyInjection\ContainerBuilder;
2120
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
2221
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
2322

23+
use function assert;
2424
use function sprintf;
2525

2626
class BrainbitsBlockingExtension extends Extension
@@ -32,10 +32,7 @@ public function load(array $configs, ContainerBuilder $container): void
3232
$yamlLoader->load('services.yaml');
3333
$configuration = $this->getConfiguration($configs, $container);
3434

35-
if ($configuration === null) {
36-
// phpcs:ignore Brainbits.Exception.GlobalException.GlobalException
37-
throw new InvalidArgumentException('Configuration not found.');
38-
}
35+
assert($configuration instanceof Configuration);
3936

4037
$config = $this->processConfiguration($configuration, $configs);
4138

0 commit comments

Comments
 (0)