Skip to content

Commit

Permalink
%parameters% is no longer supported (BC break)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 14, 2023
1 parent 281dc03 commit f04584d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
11 changes: 0 additions & 11 deletions src/DI/Config/Adapters/NeonAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down Expand Up @@ -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);
}
}
}
6 changes: 0 additions & 6 deletions src/DI/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f04584d

Please sign in to comment.