Skip to content

Commit 9762cac

Browse files
authored
tv remove arrays (#787)
* narrow! * remove docblock
1 parent d1baaf7 commit 9762cac

File tree

3 files changed

+28
-38
lines changed

3 files changed

+28
-38
lines changed

rules-tests/CodeQuality/Rector/ClassMethod/TemplateAnnotationToThisRenderRector/Fixture/with_array_return_type.php.inc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ final class WithArrayReturnType extends AbstractController
1616
{
1717
return [];
1818
}
19+
20+
/**
21+
* @Template("AppBundle:Module:next.html.twig")
22+
*
23+
* @return array{items: mixed[]}
24+
*/
25+
public function list(): array
26+
{
27+
return ['items' => []];
28+
}
1929
}
2030

2131
?>
@@ -36,6 +46,11 @@ final class WithArrayReturnType extends AbstractController
3646
{
3747
return $this->render('AppBundle:Module:index.html.twig');
3848
}
49+
50+
public function list(): \Symfony\Component\HttpFoundation\Response
51+
{
52+
return $this->render('AppBundle:Module:next.html.twig', ['items' => []]);
53+
}
3954
}
4055

4156
?>

rules-tests/CodeQuality/Rector/ClassMethod/TemplateAnnotationToThisRenderRector/Fixture/with_only_vars.php.inc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ class WithOnlyVarsController extends AbstractController
1414
public function index(Post $post)
1515
{
1616
}
17+
18+
/**
19+
* @Template("@SensioBlog/post/show.html.twig", vars={"post"})
20+
*/
21+
public function list(Post $post): array
22+
{
23+
return [];
24+
}
1725
}
1826

1927
?>
@@ -32,6 +40,11 @@ class WithOnlyVarsController extends AbstractController
3240
{
3341
return $this->render('@App/with_only_vars/index.html.twig', ['post' => $post]);
3442
}
43+
44+
public function list(Post $post): \Symfony\Component\HttpFoundation\Response
45+
{
46+
return $this->render('@SensioBlog/post/show.html.twig', ['post' => $post]);
47+
}
3548
}
3649

3750
?>

rules-tests/CodeQuality/Rector/ClassMethod/TemplateAnnotationToThisRenderRector/Fixture/with_vars.php.inc

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)