File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,10 @@ class DiConfigSniff implements Sniff
1313{
1414 private const WARNING_CODE = 'FoundObsoleteAttribute ' ;
1515
16- private $ xpathObsoleteElems = [
16+ /**
17+ * @var string[] Associative array containing the obsolete nodes and the message to display when they are found.
18+ */
19+ private $ obsoleteDiNodes = [
1720 '<param ' => 'The <param> node is obsolete. Instead, use the <argument name="..." xsi:type="..."> ' ,
1821 '<instance ' => 'The <instance> node is obsolete. Instead, use the <argument name="..." xsi:type="object"> ' ,
1922 '<array ' => 'The <array> node is obsolete. Instead, use the <argument name="..." xsi:type="array"> ' ,
@@ -38,8 +41,8 @@ public function process(File $phpcsFile, $stackPtr)
3841 {
3942 $ lineContent = $ phpcsFile ->getTokensAsString ($ stackPtr , 1 );
4043
41- foreach ($ this ->xpathObsoleteElems as $ elem => $ message ) {
42- if (strpos ($ lineContent , $ elem ) !== false ) {
44+ foreach ($ this ->obsoleteDiNodes as $ element => $ message ) {
45+ if (strpos ($ lineContent , $ element ) !== false ) {
4346 $ phpcsFile ->addWarning (
4447 $ message ,
4548 $ stackPtr ,
You can’t perform that action at this time.
0 commit comments