Skip to content

Commit 1bb4174

Browse files
authored
Merge pull request #78 from magento-commerce/imported-svera-magento-coding-standard-290
[Imported] AC-669: Fixed directory name checking too lax
2 parents 25ad720 + e81cea0 commit 1bb4174

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

Diff for: Magento2/Sniffs/Legacy/InstallUpgradeSniff.php

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

67-
if (preg_match('/(sql|data)/', $fileInfo->getPath()) === 1) {
67+
$folders = array_filter(explode('/', $fileInfo->getPath()));
68+
$folderName = array_pop($folders);
69+
70+
if ($folderName === 'data' || $folderName === 'sql') {
6871
$phpcsFile->addError(
6972
$fileInfo->getFilename()." is in an invalid directory ".$fileInfo->getPath().":\n"
7073
. "- 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)