Skip to content

Commit cbe4ffa

Browse files
committed
AC-669: Fixed directory name checking too lax
1 parent e59094a commit cbe4ffa

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Magento2/Sniffs/Legacy/InstallUpgradeSniff.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ public function process(File $phpcsFile, $stackPtr)
6464
}
6565
}
6666

67-
if (preg_match('/(sql|data)/', $fileInfo->getPath()) === 1) {
67+
$folderName = basename($fileInfo->getPath());
68+
69+
if ($folderName === 'data' || $folderName === 'sql') {
6870
$phpcsFile->addError(
6971
$fileInfo->getFilename()." is in an invalid directory ".$fileInfo->getPath().":\n"
7072
. "- Create a data patch within module's Setup/Patch/Data folder for data upgrades.\n"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php

0 commit comments

Comments
 (0)