mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-21 03:05:26 +00:00
Deprecate not passing a BodyNode instance as the body of a ModuleNode constructor
This commit is contained in:
@@ -30,8 +30,15 @@ use Twig\Source;
|
||||
#[YieldReady]
|
||||
final class ModuleNode extends Node
|
||||
{
|
||||
/**
|
||||
* @param BodyNode $body
|
||||
*/
|
||||
public function __construct(Node $body, ?AbstractExpression $parent, Node $blocks, Node $macros, Node $traits, $embeddedTemplates, Source $source)
|
||||
{
|
||||
if (!$body instanceof BodyNode) {
|
||||
trigger_deprecation('twig/twig', '3.12', sprintf('Not passing a "%s" instance as the "body" argument of the "%s" constructor is deprecated.', BodyNode::class, __CLASS__));
|
||||
}
|
||||
|
||||
$nodes = [
|
||||
'body' => $body,
|
||||
'blocks' => $blocks,
|
||||
|
||||
Reference in New Issue
Block a user