From 2b4642c3ec67d68f1bf1caec1848417cad98e9da Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Mon, 9 Jan 2017 17:16:00 +0100 Subject: [PATCH] Typehint the function, filter and test names as string --- lib/Twig/Filter.php | 2 +- lib/Twig/Function.php | 2 +- lib/Twig/Test.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Twig/Filter.php b/lib/Twig/Filter.php index ffa37c2e3..e78e4c475 100644 --- a/lib/Twig/Filter.php +++ b/lib/Twig/Filter.php @@ -32,7 +32,7 @@ class Twig_Filter * @param callable|null $callable A callable implementing the filter. If null, you need to overwrite the "node_class" option to customize compilation. * @param array $options Options array */ - public function __construct($name, $callable = null, array $options = array()) + public function __construct(string $name, $callable = null, array $options = array()) { $this->name = $name; $this->callable = $callable; diff --git a/lib/Twig/Function.php b/lib/Twig/Function.php index 380c4ceac..6dc9d3626 100644 --- a/lib/Twig/Function.php +++ b/lib/Twig/Function.php @@ -32,7 +32,7 @@ class Twig_Function * @param callable|null $callable A callable implementing the function. If null, you need to overwrite the "node_class" option to customize compilation. * @param array $options Options array */ - public function __construct($name, $callable = null, array $options = array()) + public function __construct(string $name, $callable = null, array $options = array()) { $this->name = $name; $this->callable = $callable; diff --git a/lib/Twig/Test.php b/lib/Twig/Test.php index 109ad1ae4..227e534c0 100644 --- a/lib/Twig/Test.php +++ b/lib/Twig/Test.php @@ -31,7 +31,7 @@ class Twig_Test * @param callable|null $callable A callable implementing the test. If null, you need to overwrite the "node_class" option to customize compilation. * @param array $options Options array */ - public function __construct($name, $callable = null, array $options = array()) + public function __construct(string $name, $callable = null, array $options = array()) { $this->name = $name; $this->callable = $callable;