bug #4459 Fix the exception message to match the expected one for not ready nodes (stof)

This PR was merged into the 3.x branch.

Discussion
----------

Fix the exception message to match the expected one for not ready nodes

This fixes the tests that got broken in https://github.com/twigphp/Twig/pull/4446 because that PR updated the expected message to include the FQCN of the attribute for both the deprecation and the exception, but forgot to use the FQCN in the actual exception.

Commits
-------

b15ba0f963 Fix the exception message to match the expected one for not ready nodes
This commit is contained in:
Fabien Potencier
2024-11-20 17:22:27 +01:00
+1 -1
View File
@@ -38,7 +38,7 @@ final class YieldNotReadyNodeVisitor implements NodeVisitorInterface
if (!$this->yieldReadyNodes[$class] = (bool) (new \ReflectionClass($class))->getAttributes(YieldReady::class)) {
if ($this->useYield) {
throw new \LogicException(\sprintf('You cannot enable the "use_yield" option of Twig as node "%s" is not marked as ready for it; please make it ready and then flag it with the #[YieldReady] attribute.', $class));
throw new \LogicException(\sprintf('You cannot enable the "use_yield" option of Twig as node "%s" is not marked as ready for it; please make it ready and then flag it with the #[\Twig\Attribute\YieldReady] attribute.', $class));
}
trigger_deprecation('twig/twig', '3.9', 'Twig node "%s" is not marked as ready for using "yield" instead of "echo"; please make it ready and then flag it with the #[\Twig\Attribute\YieldReady] attribute.', $class);