File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
rules/AnnotationsToAttributes/Rector/Class_ Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -44,4 +44,10 @@ parameters:
4444 - ' #Doing instanceof PHPStan\\Type\\.+ is error\-prone and deprecated #'
4545
4646 - identifier : instanceof.alwaysTrue
47- # - identifier: assign.propertyType
47+
48+ # false positive
49+ -
50+ identifier : assign.propertyType
51+ message : ' #Property PhpParser\\Node\\Identifier\:\:\$name \(non\-empty\-string\) does not accept string#'
52+ path : rules/CodeQuality/Rector/ClassMethod/ReplaceTestFunctionPrefixWithAttributeRector.php
53+
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ public function refactor(Node $node): ?Node
121121 }
122122
123123 /**
124- * @return array<string, AttributeGroup|null >
124+ * @return array<string, AttributeGroup>
125125 */
126126 private function handleRequires (PhpDocInfo $ phpDocInfo ): array
127127 {
@@ -133,7 +133,13 @@ private function handleRequires(PhpDocInfo $phpDocInfo): array
133133 }
134134
135135 $ requires = $ desiredTagValueNode ->value ->value ;
136- $ attributeGroups [$ requires ] = $ this ->requiresAttributeFactory ->create ($ requires );
136+
137+ $ requiresAttributeGroup = $ this ->requiresAttributeFactory ->create ($ requires );
138+ if (! $ requiresAttributeGroup instanceof AttributeGroup) {
139+ continue ;
140+ }
141+
142+ $ attributeGroups [$ requires ] = $ requiresAttributeGroup ;
137143
138144 $ this ->phpDocTagRemover ->removeTagValueFromNode ($ phpDocInfo , $ desiredTagValueNode );
139145 }
You can’t perform that action at this time.
0 commit comments