Skip to content

Commit

Permalink
Fix some Symfony deprecation messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mcg-web committed Apr 30, 2021
1 parent 8f77a03 commit 937f293
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\HttpKernel\Kernel;
use function array_keys;
use function is_array;
use function is_int;
Expand Down Expand Up @@ -207,6 +208,16 @@ private function definitionsSchemaSection(): ArrayNodeDefinition
/** @var ArrayNodeDefinition $node */
$node = $builder->getRootNode();

if (Kernel::VERSION_ID >= 50100) {
$deprecatedArgs = [
'overblog/graphql-bundle',
'1.0',
'The "%path%.%node%" configuration is deprecated and will be removed in 1.0. Add the "overblog_graphql.resolver_map" tag to the services instead.',
];
} else {
$deprecatedArgs = ['The "%path%.%node%" configuration is deprecated since version 0.13 and will be removed in 1.0. Add the "overblog_graphql.resolver_map" tag to the services instead.'];
}

// @phpstan-ignore-next-line
$node
->beforeNormalization()
Expand All @@ -223,7 +234,7 @@ private function definitionsSchemaSection(): ArrayNodeDefinition
->arrayNode('resolver_maps')
->defaultValue([])
->prototype('scalar')->end()
->setDeprecated('The "%path%.%node%" configuration is deprecated since version 0.13 and will be removed in 1.0. Add the "overblog_graphql.resolver_map" tag to the services instead.')
->setDeprecated(...$deprecatedArgs)
->end()
->arrayNode('types')
->defaultValue([])
Expand Down
1 change: 1 addition & 0 deletions tests/Functional/App/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ framework:
secret: test
router:
resource: "%kernel.project_dir%/config/routing.yml"
utf8: true
profiler:
enabled: false

Expand Down

0 comments on commit 937f293

Please sign in to comment.