@@ -43,14 +43,14 @@ public function register()
4343 */
4444 public function process (File $ phpcsFile , $ stackPtr )
4545 {
46- $ filename = $ phpcsFile ->getFilename ();
47- if ($ filename === 'STDIN ' ) {
46+ $ fullPath = $ phpcsFile ->getFilename ();
47+ if ($ fullPath === 'STDIN ' ) {
4848 return $ phpcsFile ->numTokens ;
4949 }
5050
51- $ fullPath = basename ($ filename );
52- $ fileName = substr ($ fullPath , 0 , strrpos ($ fullPath , '. ' ));
53- $ extension = substr ($ fullPath , (strrpos ($ fullPath , '. ' ) + 1 ));
51+ $ fileName = basename ($ fullPath );
52+ $ fileNoExt = substr ($ fileName , 0 , strrpos ($ fileName , '. ' ));
53+ $ extension = substr ($ fileName , (strrpos ($ fileName , '. ' ) + 1 ));
5454
5555 $ tokens = $ phpcsFile ->getTokens ();
5656 $ ooName = $ phpcsFile ->getDeclarationName ($ stackPtr );
@@ -59,7 +59,7 @@ public function process(File $phpcsFile, $stackPtr)
5959 return ;
6060 }
6161
62- if ($ ooName !== $ fileName ) {
62+ if ($ ooName !== $ fileNoExt ) {
6363 $ error = 'Filename doesn \'t match %s name; expected file name "%s" ' ;
6464 $ data = [
6565 $ tokens [$ stackPtr ]['content ' ],
0 commit comments