diff --git a/composer.json b/composer.json index a949dde65daeb1f5696dacf0a64f715901da14bd..160557794fc7efd6d51f6f158a490bb2ccaeb6f2 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "php": ">=7.3", "ext-json": "*", "api-platform/core": "^2.6", - "dbp/relay-core-bundle": "dev-main as 0.1.32", + "dbp/relay-core-bundle": "dev-main as 0.1.34", "symfony/config": "^5.4", "symfony/framework-bundle": "^5.4", "symfony/security-bundle": "^5.4", diff --git a/composer.lock b/composer.lock index 989ddeb5e91a548971e580cde491ed3036ba6398..1da10001e0ca20716567d32ab866f9a90afa42d5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d21fecd0dcd474297b30d7107433ac01", + "content-hash": "4900ef0af037a9733d0007e42ceb50b0", "packages": [ { "name": "api-platform/core", @@ -7473,16 +7473,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.5.6", + "version": "1.5.7", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "799dd8c2d2c9c704bb55d2078078cb970cf0f6d1" + "reference": "7fb7e2e1e9f3d59a26a413b2d3d5e47f0edb75ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/799dd8c2d2c9c704bb55d2078078cb970cf0f6d1", - "reference": "799dd8c2d2c9c704bb55d2078078cb970cf0f6d1", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7fb7e2e1e9f3d59a26a413b2d3d5e47f0edb75ac", + "reference": "7fb7e2e1e9f3d59a26a413b2d3d5e47f0edb75ac", "shasum": "" }, "require": { @@ -7508,7 +7508,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.5.6" + "source": "https://github.com/phpstan/phpstan/tree/1.5.7" }, "funding": [ { @@ -7528,20 +7528,20 @@ "type": "tidelift" } ], - "time": "2022-04-15T11:13:37+00:00" + "time": "2022-04-20T12:20:27+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "09133ce914f1388a8bb8c7f8573aaa3723cff52a" + "reference": "4a3c437c09075736285d1cabb5c75bf27ed0bc84" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/09133ce914f1388a8bb8c7f8573aaa3723cff52a", - "reference": "09133ce914f1388a8bb8c7f8573aaa3723cff52a", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/4a3c437c09075736285d1cabb5c75bf27ed0bc84", + "reference": "4a3c437c09075736285d1cabb5c75bf27ed0bc84", "shasum": "" }, "require": { @@ -7578,9 +7578,9 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.1.0" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.1.1" }, - "time": "2022-03-28T09:20:49+00:00" + "time": "2022-04-20T15:24:25+00:00" }, { "name": "phpunit/php-code-coverage", @@ -10031,8 +10031,8 @@ { "package": "dbp/relay-core-bundle", "version": "dev-main", - "alias": "0.1.32", - "alias_normalized": "0.1.32.0" + "alias": "0.1.34", + "alias_normalized": "0.1.34.0" } ], "minimum-stability": "stable", diff --git a/src/DependencyInjection/DbpRelayBaseCourseExtension.php b/src/DependencyInjection/DbpRelayBaseCourseExtension.php index 38c2e02e3fe5e2a963b495ed5971f20d5222bb6a..34a57f0f20af84370d9d124e2605c850ed3b3964 100644 --- a/src/DependencyInjection/DbpRelayBaseCourseExtension.php +++ b/src/DependencyInjection/DbpRelayBaseCourseExtension.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Dbp\Relay\BaseCourseBundle\DependencyInjection; +use Dbp\Relay\CoreBundle\Extension\ExtensionTrait; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; @@ -11,16 +12,14 @@ use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension; class DbpRelayBaseCourseExtension extends ConfigurableExtension { + use ExtensionTrait; + public function loadInternal(array $mergedConfig, ContainerBuilder $container) { - $this->extendArrayParameter( - $container, 'api_platform.resource_class_directories', [__DIR__.'/../Entity']); + $this->addResourceClassDirectory($container, __DIR__.'/../Entity'); - $this->extendArrayParameter( - $container, 'dbp_api.paths_to_hide', [ - '/course_attendees', - '/course_attendees/{identifier}', - ]); + $this->addPathToHide($container, '/course_attendees'); + $this->addPathToHide($container, '/course_attendees/{identifier}'); $loader = new YamlFileLoader( $container, @@ -28,14 +27,4 @@ class DbpRelayBaseCourseExtension extends ConfigurableExtension ); $loader->load('services.yaml'); } - - private function extendArrayParameter(ContainerBuilder $container, string $parameter, array $values) - { - if (!$container->hasParameter($parameter)) { - $container->setParameter($parameter, []); - } - $oldValues = $container->getParameter($parameter); - assert(is_array($oldValues)); - $container->setParameter($parameter, array_merge($oldValues, $values)); - } }