From f1fc4f4a14770df781060e4c7460bab8140b1a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Sun, 5 Jan 2025 22:36:22 +0100 Subject: [PATCH] NodeTestCase Add "@return" annotations --- src/Test/NodeTestCase.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Test/NodeTestCase.php b/src/Test/NodeTestCase.php index bac0ea6d036..19d0f67173f 100644 --- a/src/Test/NodeTestCase.php +++ b/src/Test/NodeTestCase.php @@ -26,6 +26,9 @@ abstract class NodeTestCase extends TestCase */ private $currentEnv; + /** + * @return iterable + */ public function getTests() { return []; @@ -44,6 +47,8 @@ public static function provideTests(): iterable /** * @dataProvider getTests * @dataProvider provideTests + * + * @return void */ #[DataProvider('getTests'), DataProvider('provideTests')] public function testCompile($node, $source, $environment = null, $isPattern = false) @@ -51,6 +56,9 @@ public function testCompile($node, $source, $environment = null, $isPattern = fa $this->assertNodeCompilation($source, $node, $environment, $isPattern); } + /** + * @return void + */ public function assertNodeCompilation($source, Node $node, ?Environment $environment = null, $isPattern = false) { $compiler = $this->getCompiler($environment); @@ -63,12 +71,17 @@ public function assertNodeCompilation($source, Node $node, ?Environment $environ } } + /** + * @return Compiler + */ protected function getCompiler(?Environment $environment = null) { return new Compiler($environment ?? $this->getEnvironment()); } /** + * @return Environment + * * @final since Twig 3.13 */ protected function getEnvironment() @@ -82,6 +95,8 @@ protected static function createEnvironment(): Environment } /** + * @return string + * * @deprecated since Twig 3.13, use createVariableGetter() instead. */ protected function getVariableGetter($name, $line = false) @@ -99,6 +114,8 @@ final protected static function createVariableGetter(string $name, bool $line = } /** + * @return string + * * @deprecated since Twig 3.13, use createAttributeGetter() instead. */ protected function getAttributeGetter()