File tree 1 file changed +6
-3
lines changed
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
13
13
{
14
14
private const WARNING_CODE = 'FoundObsoleteAttribute ' ;
15
15
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 = [
17
20
'<param ' => 'The <param> node is obsolete. Instead, use the <argument name="..." xsi:type="..."> ' ,
18
21
'<instance ' => 'The <instance> node is obsolete. Instead, use the <argument name="..." xsi:type="object"> ' ,
19
22
'<array ' => 'The <array> node is obsolete. Instead, use the <argument name="..." xsi:type="array"> ' ,
@@ -38,8 +41,8 @@ public function process(File $phpcsFile, $stackPtr)
38
41
{
39
42
$ lineContent = $ phpcsFile ->getTokensAsString ($ stackPtr , 1 );
40
43
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 ) {
43
46
$ phpcsFile ->addWarning (
44
47
$ message ,
45
48
$ stackPtr ,
You can’t perform that action at this time.
0 commit comments