Skip to content

Commit 9f38b7a

Browse files
authored
Merge pull request #11 from magento-commerce/imported-magento-magento-coding-standard-205
[Imported] Fix TypeError for phpcs->addWarning()
2 parents fa8830c + bcf50f4 commit 9f38b7a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Magento2/Sniffs/Exceptions/DirectThrowSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function process(File $phpcsFile, $stackPtr)
4848
$this->warningMessage,
4949
$stackPtr,
5050
$this->warningCode,
51-
$posOfException
51+
[$posOfException]
5252
);
5353
}
5454
}

Magento2/Sniffs/Legacy/MageEntitySniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,22 @@ public function process(File $phpcsFile, $stackPtr)
7777
return;
7878
}
7979
$entityName = $tokens[$stackPtr]['content'];
80-
$error = [$entityName . $tokens[$oldPosition]['content']];
80+
$error = $entityName . $tokens[$oldPosition]['content'];
8181
} else {
8282
$oldPosition = $stackPtr;
8383
$stackPtr = $phpcsFile->findNext(T_STRING, $oldPosition + 1, null, false, null, true);
8484
if ($stackPtr === false) {
8585
return;
8686
}
8787
$entityName = $tokens[$stackPtr]['content'];
88-
$error = [$tokens[$oldPosition]['content'] . ' ' . $entityName];
88+
$error = $tokens[$oldPosition]['content'] . ' ' . $entityName;
8989
}
9090
if ($entityName === $this->legacyEntity || $this->isPrefixLegacy($entityName)) {
9191
$phpcsFile->addError(
9292
$this->errorMessage,
9393
$stackPtr,
9494
$this->errorCode,
95-
$error
95+
[$error]
9696
);
9797
}
9898
}

0 commit comments

Comments
 (0)