@@ -34,14 +34,14 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
34
34
$ tokens = $ phpcsFile ->getTokens ();
35
35
$ line = $ tokens [$ stackPtr ]['line ' ];
36
36
37
- while ($ tokens [$ stackPtr ]['line ' ] == $ line ) {
37
+ while ($ tokens [$ stackPtr ]['line ' ] === $ line ) {
38
38
/*
39
39
* Suffix interfaces with Interface;
40
40
*/
41
- if ('T_INTERFACE ' == $ tokens [$ stackPtr ]['type ' ]) {
41
+ if ('T_INTERFACE ' === $ tokens [$ stackPtr ]['type ' ]) {
42
42
$ name = $ phpcsFile ->findNext (T_STRING , $ stackPtr );
43
43
44
- if ($ name && substr ($ tokens [$ name ]['content ' ], -9 ) != 'Interface ' ) {
44
+ if ($ name && substr ($ tokens [$ name ]['content ' ], -9 ) !== 'Interface ' ) {
45
45
$ phpcsFile ->addError (
46
46
'Interface name is not suffixed with "Interface" ' ,
47
47
$ stackPtr ,
@@ -54,10 +54,10 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
54
54
/*
55
55
* Suffix traits with Trait;
56
56
*/
57
- if ('T_TRAIT ' == $ tokens [$ stackPtr ]['type ' ]) {
57
+ if ('T_TRAIT ' === $ tokens [$ stackPtr ]['type ' ]) {
58
58
$ name = $ phpcsFile ->findNext (T_STRING , $ stackPtr );
59
59
60
- if ($ name && substr ($ tokens [$ name ]['content ' ], -5 ) != 'Trait ' ) {
60
+ if ($ name && substr ($ tokens [$ name ]['content ' ], -5 ) !== 'Trait ' ) {
61
61
$ phpcsFile ->addError (
62
62
'Trait name is not suffixed with "Trait" ' ,
63
63
$ stackPtr ,
@@ -70,17 +70,17 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
70
70
/*
71
71
* Suffix exceptions with Exception;
72
72
*/
73
- if ('T_EXTENDS ' == $ tokens [$ stackPtr ]['type ' ]) {
73
+ if ('T_EXTENDS ' === $ tokens [$ stackPtr ]['type ' ]) {
74
74
$ extend = $ phpcsFile ->findNext (T_STRING , $ stackPtr );
75
75
76
76
if ($ extend
77
- && substr ($ tokens [$ extend ]['content ' ], -9 ) == 'Exception '
77
+ && substr ($ tokens [$ extend ]['content ' ], -9 ) === 'Exception '
78
78
) {
79
79
$ class = $ phpcsFile ->findPrevious (T_CLASS , $ stackPtr );
80
80
$ name = $ phpcsFile ->findNext (T_STRING , $ class );
81
81
82
82
if ($ name
83
- && substr ($ tokens [$ name ]['content ' ], -9 ) != 'Exception '
83
+ && substr ($ tokens [$ name ]['content ' ], -9 ) !== 'Exception '
84
84
) {
85
85
$ phpcsFile ->addError (
86
86
'Exception name is not suffixed with "Exception" ' ,
@@ -95,13 +95,13 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
95
95
/*
96
96
* Prefix abstract classes with Abstract.
97
97
*/
98
- if ('T_ABSTRACT ' == $ tokens [$ stackPtr ]['type ' ]) {
98
+ if ('T_ABSTRACT ' === $ tokens [$ stackPtr ]['type ' ]) {
99
99
$ name = $ phpcsFile ->findNext (T_STRING , $ stackPtr );
100
100
$ function = $ phpcsFile ->findNext (T_FUNCTION , $ stackPtr );
101
101
102
102
// Making sure we're not dealing with an abstract function
103
103
if ($ name && (false === $ function || $ name < $ function )
104
- && substr ($ tokens [$ name ]['content ' ], 0 , 8 ) != 'Abstract '
104
+ && substr ($ tokens [$ name ]['content ' ], 0 , 8 ) !== 'Abstract '
105
105
) {
106
106
$ phpcsFile ->addError (
107
107
'Abstract class name is not prefixed with "Abstract" ' ,
0 commit comments