From f04584d3c0d751fa645a818d51a393c1a93cf471 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sun, 5 Nov 2023 23:23:09 +0100 Subject: [PATCH] %parameters% is no longer supported (BC break) --- src/DI/Config/Adapters/NeonAdapter.php | 11 ----------- src/DI/Helpers.php | 6 ------ 2 files changed, 17 deletions(-) diff --git a/src/DI/Config/Adapters/NeonAdapter.php b/src/DI/Config/Adapters/NeonAdapter.php index 32adb5614..57135111f 100644 --- a/src/DI/Config/Adapters/NeonAdapter.php +++ b/src/DI/Config/Adapters/NeonAdapter.php @@ -42,7 +42,6 @@ public function load(string $file): array $node = $traverser->traverse($node, $this->firstClassCallableVisitor(...)); $node = $traverser->traverse($node, $this->removeUnderscoreVisitor(...)); $node = $traverser->traverse($node, $this->convertAtSignVisitor(...)); - $node = $traverser->traverse($node, $this->deprecatedParametersVisitor(...)); return $this->process((array) $node->toValue()); } @@ -199,14 +198,4 @@ private function convertAtSignVisitor(Neon\Node $node) trigger_error("There is no need to escape @ anymore, replace @@ with @ and put string in quotes: '$node->value' (used in $this->file)", E_USER_DEPRECATED); } } - - - private function deprecatedParametersVisitor(Neon\Node $node) - { - if (($node instanceof Neon\Node\StringNode || $node instanceof Neon\Node\LiteralNode) - && str_contains((string) $node->value, '%parameters%') - ) { - trigger_error('%parameters% is deprecated, use @container::getParameters() (in ' . $this->file . ')', E_USER_DEPRECATED); - } - } } diff --git a/src/DI/Helpers.php b/src/DI/Helpers.php index 099669147..4a82ffca1 100644 --- a/src/DI/Helpers.php +++ b/src/DI/Helpers.php @@ -43,12 +43,6 @@ public static function expand(mixed $var, array $params, bool|array $recursive = self::expand($var->arguments, $params, $recursive), ); - } elseif ($var === '%parameters%' && !array_key_exists('parameters', $params)) { - trigger_error('%parameters% is deprecated, use @container::getParameters()', E_USER_DEPRECATED); - return $recursive - ? self::expand($params, $params, $recursive) - : $params; - } elseif (is_string($var)) { $recursive = is_array($recursive) ? $recursive : ($recursive ? [] : null); return self::expandString($var, $params, $recursive);