File tree 2 files changed +26
-0
lines changed
rules/CodeQuality/Rector/Equal
rules-tests/CodeQuality/Rector/Equal/UseIdenticalOverEqualWithSameTypeRector/Fixture 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Rector \Tests \CodeQuality \Rector \Equal \UseIdenticalOverEqualWithSameTypeRector \Fixture ;
4
+
5
+ final class SkipPhpdocArrayshape
6
+ {
7
+ /**
8
+ * @return array{'sql': string, 'files': array<string>}
9
+ */
10
+ public function getContent (): array
11
+ {
12
+ }
13
+
14
+ public function import ()
15
+ {
16
+ $ content = $ this ->getContent ();
17
+
18
+ if (! isset ($ content ['sql ' ]) || $ content ['sql ' ] == '' ) {
19
+ }
20
+ }
21
+ }
Original file line number Diff line number Diff line change 5
5
namespace Rector \CodeQuality \Rector \Equal ;
6
6
7
7
use PhpParser \Node ;
8
+ use PhpParser \Node \Expr \ArrayDimFetch ;
8
9
use PhpParser \Node \Expr \BinaryOp \Equal ;
9
10
use PhpParser \Node \Expr \BinaryOp \Identical ;
10
11
use PhpParser \Node \Expr \BinaryOp \NotEqual ;
@@ -64,6 +65,10 @@ public function getNodeTypes(): array
64
65
*/
65
66
public function refactor (Node $ node ): ?Node
66
67
{
68
+ if ($ node ->left instanceof ArrayDimFetch || $ node ->right instanceof ArrayDimFetch) {
69
+ return null ;
70
+ }
71
+
67
72
$ leftStaticType = $ this ->nodeTypeResolver ->getNativeType ($ node ->left );
68
73
$ rightStaticType = $ this ->nodeTypeResolver ->getNativeType ($ node ->right );
69
74
You can’t perform that action at this time.
0 commit comments