Skip to content

Commit 3a2f105

Browse files
committed
Do benevolent union for SimpleXMLElement::children()
1 parent 743850d commit 3a2f105

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

resources/functionMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10227,7 +10227,7 @@
1022710227
'SimpleXMLElement::addChild' => ['static', 'name'=>'string', 'value='=>'string|null', 'ns='=>'string|null'],
1022810228
'SimpleXMLElement::asXML' => ['string|bool', 'filename='=>'string'],
1022910229
'SimpleXMLElement::attributes' => ['static|null', 'ns='=>'string', 'is_prefix='=>'bool'],
10230-
'SimpleXMLElement::children' => ['static|null', 'namespaceOrPrefix='=>'string|null', 'is_prefix='=>'bool'],
10230+
'SimpleXMLElement::children' => ['__benevolent<static|null>', 'namespaceOrPrefix='=>'string|null', 'is_prefix='=>'bool'],
1023110231
'SimpleXMLElement::count' => ['0|positive-int'],
1023210232
'SimpleXMLElement::getDocNamespaces' => ['string[]|false', 'recursive='=>'bool', 'from_root='=>'bool'],
1023310233
'SimpleXMLElement::getName' => ['string'],

tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,6 @@ public function testCallMethods(): void
395395
'Parameter #1 $callable of method Test\\MethodExists::doBar() expects callable(): mixed, array{object, \'bar\'} given.',
396396
921,
397397
],
398-
[
399-
'Cannot call method count() on SimpleXMLElement|null.',
400-
941,
401-
],
402398
[
403399
'Parameter #1 $namespaceOrPrefix of method SimpleXMLElement::children() expects string|null, int given.',
404400
942,

0 commit comments

Comments
 (0)