From 43564f5f5ff0d84a9d708a4b79460d2063604f8f Mon Sep 17 00:00:00 2001 From: William Desportes Date: Thu, 28 May 2020 09:33:58 +0200 Subject: [PATCH] Fix twig deprecations for php 8 Ref: https://github.com/twigphp/Twig/issues/3327 Upstream: https://github.com/twigphp/Twig/pull/3331 Signed-off-by: William Desportes --- libraries/classes/Twig/I18n/NodeTrans.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/classes/Twig/I18n/NodeTrans.php b/libraries/classes/Twig/I18n/NodeTrans.php index ed4b271723..8eb486e3f6 100644 --- a/libraries/classes/Twig/I18n/NodeTrans.php +++ b/libraries/classes/Twig/I18n/NodeTrans.php @@ -28,21 +28,21 @@ class NodeTrans extends TransNode * The attributes are automatically made available as array items ($this['name']). * * @param Node $body Body of node trans - * @param Node $plural Node plural + * @param Node|null $plural Node plural * @param AbstractExpression $count Node count - * @param Node $context Node context - * @param Node $notes Node notes + * @param Node|null $context Node context + * @param Node|null $notes Node notes * @param int $lineno The line number * @param string $tag The tag name associated with the Node */ public function __construct( Node $body, - Node $plural = null, - AbstractExpression $count = null, - Node $context = null, - Node $notes = null, - $lineno, - $tag = null + ?Node $plural, + ?AbstractExpression $count, + ?Node $context, + ?Node $notes, + int $lineno, + string $tag ) { $nodes = ['body' => $body]; if (null !== $count) { @@ -160,7 +160,7 @@ class NodeTrans extends TransNode * * @return string */ - protected function getTransFunction($plural, $hasMsgContext = false) + protected function getTransFunction($plural, bool $hasMsgContext = false): string { if ($hasMsgContext) { return $plural ? '_ngettext' : '_pgettext';