File tree Expand file tree Collapse file tree
rules-tests/TypeDeclarationDocblocks/Rector/Class_/ClassMethodArrayDocblockParamFromLocalCallsRector Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \TypeDeclarationDocblocks \Rector \Class_ \ClassMethodArrayDocblockParamFromLocalCallsRector \Fixture ;
4+
5+ use Rector \Tests \TypeDeclarationDocblocks \Rector \Class_ \ClassMethodArrayDocblockParamFromLocalCallsRector \Source \SomeReturnedObject ;
6+
7+ final class ObjectsOverruleEmptyArray
8+ {
9+ public function go ()
10+ {
11+ $ this ->run ($ this ->getItemsWithArray ());
12+ $ this ->run ($ this ->getItems ());
13+ }
14+
15+ public function run (array $ result )
16+ {
17+ }
18+
19+ /**
20+ * @return SomeReturnedObject[]|array
21+ */
22+ private function getItems ()
23+ {
24+ return [];
25+ }
26+
27+ /**
28+ * @return SomeReturnedObject[]
29+ */
30+ private function getItemsWithArray ()
31+ {
32+ return [];
33+ }
34+ }
35+
36+ ?>
37+ -----
38+ <?php
39+
40+ namespace Rector \Tests \TypeDeclarationDocblocks \Rector \Class_ \ClassMethodArrayDocblockParamFromLocalCallsRector \Fixture ;
41+
42+ use Rector \Tests \TypeDeclarationDocblocks \Rector \Class_ \ClassMethodArrayDocblockParamFromLocalCallsRector \Source \SomeReturnedObject ;
43+
44+ final class ObjectsOverruleEmptyArray
45+ {
46+ public function go ()
47+ {
48+ $ this ->run ($ this ->getItemsWithArray ());
49+ $ this ->run ($ this ->getItems ());
50+ $ this ->run ([]);
51+ }
52+
53+ /**
54+ * @param SomeReturnedObject[] $result
55+ */
56+ public function run (array $ result )
57+ {
58+ }
59+
60+ /**
61+ * @return SomeReturnedObject[]|array
62+ */
63+ private function getItems ()
64+ {
65+ return [];
66+ }
67+
68+ /**
69+ * @return SomeReturnedObject[]
70+ */
71+ private function getItemsWithArray ()
72+ {
73+ return [];
74+ }
75+ }
76+
77+ ?>
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \TypeDeclarationDocblocks \Rector \Class_ \ClassMethodArrayDocblockParamFromLocalCallsRector \Source ;
4+
5+ final class SomeReturnedObject
6+ {
7+ }
You can’t perform that action at this time.
0 commit comments