Skip to content
This repository was archived by the owner on Nov 5, 2022. It is now read-only.

Commit 12379ce

Browse files
committed
Exclude filename sniff on migrations
1 parent bf455b9 commit 12379ce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CodeIgniter4/Sniffs/Files/FilenameMatchesClassSniff.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ public function process(File $phpcsFile, $stackPtr)
6969
return;
7070
}
7171

72-
$className = trim($phpcsFile->getDeclarationName($stackPtr));
72+
$className = trim($phpcsFile->getDeclarationName($stackPtr));
73+
74+
if (strpos($className, 'Migration') === 0 && strpos($fileName, '_') !== false) {
75+
return;
76+
}
77+
7378
$nextContentPtr = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
7479
$type = $tokens[$stackPtr]['content'];
7580

0 commit comments

Comments
 (0)