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 Nov 13, 2023
1 parent 3498613 commit 6933526
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 @@ -43,7 +43,6 @@ public function load(string $file): array
$traverser = new Neon\Traverser;
$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 @@ -192,14 +191,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 6933526

Please sign in to comment.