This repository was archived by the owner on Dec 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ # Typed arrays get simply converted to array
3+ /**
4+ * @param int[] $ints
5+ * @param string[] $strings
6+ * @param Foo[] $someClasses
7+ * @return float[]
8+ */
9+ function array_no_types ($ ints , $ strings , $ someClasses ) {
10+ }
Original file line number Diff line number Diff line change @@ -237,4 +237,24 @@ function param_no_type($noType)
237237 , $ converter ->convert ($ project , $ file ));
238238}
239239
240+ $ projectFactory = ProjectFactory::createInstance ();
241+ $ project = $ projectFactory ->create ('paramNoType ' , [__DIR__ .'/Fixtures/array_no_types.php ' ]);
242+
243+ foreach ($ project ->getFiles () as $ path => $ file ) {
244+ $ expected = <<<'PHP'
245+ <?php
246+ # Typed arrays get simply converted to array
247+ /**
248+ * @param int[] $ints
249+ * @param string[] $strings
250+ * @param Foo[] $someClasses
251+ * @return float[]
252+ */
253+ function array_no_types(array $ints, array $strings, array $someClasses) : array{
254+ }
255+
256+ PHP;
257+ same ($ expected , $ converter ->convert ($ project , $ file ));
258+ }
259+
240260echo 'Good job! Everything is fine. ' .PHP_EOL ;
You can’t perform that action at this time.
0 commit comments