Skip to content

Commit

Permalink
fix: Remove redundant condition for config-check
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexejLeinweber authored and pl-github committed May 7, 2024
1 parent 181ca68 commit 641e5d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"matthiasnoback/symfony-config-test": "^5.1",
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
"mikey179/vfsstream": "^1.6.11",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan": "^1.10.67",
"phpunit/phpunit": "^10.5",
"predis/predis": "^2.2",
"symfony/clock": "^6.4|^7.0",
Expand Down
7 changes: 2 additions & 5 deletions src/Bundle/DependencyInjection/BrainbitsBlockingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@

use Brainbits\Blocking\Owner\OwnerFactoryInterface;
use Brainbits\Blocking\Storage\StorageInterface;
use InvalidArgumentException;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

use function assert;
use function sprintf;

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

if ($configuration === null) {
// phpcs:ignore Brainbits.Exception.GlobalException.GlobalException
throw new InvalidArgumentException('Configuration not found.');
}
assert($configuration instanceof Configuration);

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

Expand Down

0 comments on commit 641e5d8

Please sign in to comment.