This repository was archived by the owner on Nov 5, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +68
-0
lines changed
CodeIgniter4/Tests/Operators Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ if ($ a AND $ b === $ c ) {} // Fail
4
+ if ($ a === $ b AND $ c ) {} // Fail
5
+ if ($ a === $ b AND $ a === $ c ) {} // Fail
6
+ if ($ a === $ b && $ a === $ c ) {} // Fail
7
+ if ($ a === 1 and $ a === 2 AND $ a === 3 ) {} // Fail 2 errors
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ if ($a && $b === $c) {} // Fail
4
+ if ($a === $b && $c) {} // Fail
5
+ if ($a === $b && $a === $c) {} // Fail
6
+ if ($a === $b && $a === $c) {} // Fail
7
+ if ($a === 1 && $a === 2 && $a === 3) {} // Fail 2 errors
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Boolean And Unit Test
4
+ *
5
+ * @package CodeIgniter4-Standard
6
+ * @author Louis Linehan <[email protected] >
7
+ * @copyright 2017 Louis Linehan
8
+ * @license https://github.com/louisl/CodeIgniter4-Standard/blob/master/LICENSE MIT License
9
+ */
10
+
11
+ namespace CodeIgniter4 \Tests \Operators ;
12
+
13
+ use PHP_CodeSniffer \Tests \Standards \AbstractSniffUnitTest ;
14
+
15
+ class BooleanAndUnitTest extends AbstractSniffUnitTest
16
+ {
17
+
18
+
19
+ /**
20
+ * Returns the lines where errors should occur.
21
+ *
22
+ * The key of the array should represent the line number and the value
23
+ * should represent the number of errors that should occur on that line.
24
+ *
25
+ * @return array<int, int>
26
+ */
27
+ public function getErrorList ()
28
+ {
29
+ return array (
30
+ 3 => 1 ,
31
+ 4 => 1 ,
32
+ 5 => 1 ,
33
+ 7 => 2 ,
34
+ );
35
+
36
+ }//end getErrorList()
37
+
38
+
39
+ /**
40
+ * Returns the lines where warnings should occur.
41
+ *
42
+ * The key of the array should represent the line number and the value
43
+ * should represent the number of warnings that should occur on that line.
44
+ *
45
+ * @return array<int, int>
46
+ */
47
+ public function getWarningList ()
48
+ {
49
+ return array ();
50
+
51
+ }//end getWarningList()
52
+
53
+
54
+ }//end class
You can’t perform that action at this time.
0 commit comments