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 <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2020-05-28 09:33:58 +02:00
parent ee9630b4cb
commit 43564f5f5f
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -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';