@@ -70,8 +70,8 @@ public function testFullConstructor(): void
7070 $ this ->assertEquals ($ context , $ node ->getNode ('context ' ));
7171 }
7272
73- /** @return mixed[] */
74- public function getTests (): array
73+ /** @return iterable<array{0: \Twig\Node\Node, 1: string, 2?: Environment|null, 3?: bool}> */
74+ public static function provideTests (): iterable
7575 {
7676 $ tests = [];
7777
@@ -82,7 +82,7 @@ public function getTests(): array
8282 $ node = new TransNode ($ body , null , null , null , null , $ domain , 0 );
8383 $ tests [] = [
8484 $ node ,
85- sprintf ('yield _dgettext("coredomain", %s); ' , $ this -> getVariableGetter ('foo ' )),
85+ sprintf ('yield _dgettext("coredomain", %s); ' , self :: createVariableGetter ('foo ' )),
8686 ];
8787
8888 $ body = new ContextVariable ('foo ' , 0 );
@@ -97,7 +97,7 @@ public function getTests(): array
9797 $ node ,
9898 sprintf (
9999 'yield _dpgettext("coredomain", "The context", %s); ' ,
100- $ this -> getVariableGetter ('foo ' ),
100+ self :: createVariableGetter ('foo ' ),
101101 ),
102102 ];
103103
@@ -111,7 +111,7 @@ public function getTests(): array
111111 $ node ,
112112 sprintf (
113113 'yield strtr(_gettext("J \'ai %%foo%% pommes"), array("%%foo%%" => %s, )); ' ,
114- $ this -> getVariableGetter ('foo ' ),
114+ self :: createVariableGetter ('foo ' ),
115115 ),
116116 ];
117117
@@ -135,8 +135,8 @@ public function getTests(): array
135135 'yield strtr(_ngettext("Hey %%name%%, I have one apple", "Hey %%name%%, '
136136 . ' I have %%count%% apples", abs(12)), array("%%name%%" => %s, '
137137 . ' "%%name%%" => %s, "%%count%%" => abs(12), )); ' ,
138- $ this -> getVariableGetter ('name ' ),
139- $ this -> getVariableGetter ('name ' ),
138+ self :: createVariableGetter ('name ' ),
139+ self :: createVariableGetter ('name ' ),
140140 ),
141141 ];
142142
@@ -153,7 +153,7 @@ public function getTests(): array
153153 $ node ,
154154 sprintf (
155155 'yield strtr(_pgettext("The context", "J \'ai %%foo%% pommes"), array("%%foo%%" => %s, )); ' ,
156- $ this -> getVariableGetter ('foo ' ),
156+ self :: createVariableGetter ('foo ' ),
157157 ),
158158 ];
159159
@@ -180,8 +180,8 @@ public function getTests(): array
180180 'yield strtr(_npgettext("The context", "Hey %%name%%, I have one apple", "Hey %%name%%, '
181181 . ' I have %%count%% apples", abs(12)), array("%%name%%" => %s, '
182182 . ' "%%name%%" => %s, "%%count%%" => abs(12), )); ' ,
183- $ this -> getVariableGetter ('name ' ),
184- $ this -> getVariableGetter ('name ' ),
183+ self :: createVariableGetter ('name ' ),
184+ self :: createVariableGetter ('name ' ),
185185 ),
186186 ];
187187
@@ -201,7 +201,7 @@ public function getTests(): array
201201 $ node ,
202202 sprintf (
203203 'yield strtr(_dpgettext("mydomain", "The context", "J \'ai %%foo%% pommes"), array("%%foo%%" => %s, )); ' ,
204- $ this -> getVariableGetter ('foo ' ),
204+ self :: createVariableGetter ('foo ' ),
205205 ),
206206 ];
207207
@@ -231,8 +231,8 @@ public function getTests(): array
231231 'yield strtr(_dnpgettext("mydomain", "The context", "Hey %%name%%, I have one apple", '
232232 . ' "Hey %%name%%, I have %%count%% apples", abs(12)), array("%%name%%" => %s, '
233233 . ' "%%name%%" => %s, "%%count%%" => abs(12), )); ' ,
234- $ this -> getVariableGetter ('name ' ),
235- $ this -> getVariableGetter ('name ' ),
234+ self :: createVariableGetter ('name ' ),
235+ self :: createVariableGetter ('name ' ),
236236 ),
237237 ];
238238
0 commit comments