@@ -34,14 +34,14 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
3434 $ tokens = $ phpcsFile ->getTokens ();
3535 $ line = $ tokens [$ stackPtr ]['line ' ];
3636
37- while ($ tokens [$ stackPtr ]['line ' ] == $ line ) {
37+ while ($ tokens [$ stackPtr ]['line ' ] === $ line ) {
3838 /*
3939 * Suffix interfaces with Interface;
4040 */
41- if ('T_INTERFACE ' == $ tokens [$ stackPtr ]['type ' ]) {
41+ if ('T_INTERFACE ' === $ tokens [$ stackPtr ]['type ' ]) {
4242 $ name = $ phpcsFile ->findNext (T_STRING , $ stackPtr );
4343
44- if ($ name && substr ($ tokens [$ name ]['content ' ], -9 ) != 'Interface ' ) {
44+ if ($ name && substr ($ tokens [$ name ]['content ' ], -9 ) !== 'Interface ' ) {
4545 $ phpcsFile ->addError (
4646 'Interface name is not suffixed with "Interface" ' ,
4747 $ stackPtr ,
@@ -54,10 +54,10 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
5454 /*
5555 * Suffix traits with Trait;
5656 */
57- if ('T_TRAIT ' == $ tokens [$ stackPtr ]['type ' ]) {
57+ if ('T_TRAIT ' === $ tokens [$ stackPtr ]['type ' ]) {
5858 $ name = $ phpcsFile ->findNext (T_STRING , $ stackPtr );
5959
60- if ($ name && substr ($ tokens [$ name ]['content ' ], -5 ) != 'Trait ' ) {
60+ if ($ name && substr ($ tokens [$ name ]['content ' ], -5 ) !== 'Trait ' ) {
6161 $ phpcsFile ->addError (
6262 'Trait name is not suffixed with "Trait" ' ,
6363 $ stackPtr ,
@@ -70,17 +70,17 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
7070 /*
7171 * Suffix exceptions with Exception;
7272 */
73- if ('T_EXTENDS ' == $ tokens [$ stackPtr ]['type ' ]) {
73+ if ('T_EXTENDS ' === $ tokens [$ stackPtr ]['type ' ]) {
7474 $ extend = $ phpcsFile ->findNext (T_STRING , $ stackPtr );
7575
7676 if ($ extend
77- && substr ($ tokens [$ extend ]['content ' ], -9 ) == 'Exception '
77+ && substr ($ tokens [$ extend ]['content ' ], -9 ) === 'Exception '
7878 ) {
7979 $ class = $ phpcsFile ->findPrevious (T_CLASS , $ stackPtr );
8080 $ name = $ phpcsFile ->findNext (T_STRING , $ class );
8181
8282 if ($ name
83- && substr ($ tokens [$ name ]['content ' ], -9 ) != 'Exception '
83+ && substr ($ tokens [$ name ]['content ' ], -9 ) !== 'Exception '
8484 ) {
8585 $ phpcsFile ->addError (
8686 'Exception name is not suffixed with "Exception" ' ,
@@ -95,13 +95,13 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
9595 /*
9696 * Prefix abstract classes with Abstract.
9797 */
98- if ('T_ABSTRACT ' == $ tokens [$ stackPtr ]['type ' ]) {
98+ if ('T_ABSTRACT ' === $ tokens [$ stackPtr ]['type ' ]) {
9999 $ name = $ phpcsFile ->findNext (T_STRING , $ stackPtr );
100100 $ function = $ phpcsFile ->findNext (T_FUNCTION , $ stackPtr );
101101
102102 // Making sure we're not dealing with an abstract function
103103 if ($ name && (false === $ function || $ name < $ function )
104- && substr ($ tokens [$ name ]['content ' ], 0 , 8 ) != 'Abstract '
104+ && substr ($ tokens [$ name ]['content ' ], 0 , 8 ) !== 'Abstract '
105105 ) {
106106 $ phpcsFile ->addError (
107107 'Abstract class name is not prefixed with "Abstract" ' ,
0 commit comments