1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Fix #1701 - allow count to be called on SimpleXMLElement

This commit is contained in:
Matthew Brown 2019-05-29 07:56:06 -04:00
parent 4f48c6388d
commit e31cdf3be5
2 changed files with 6 additions and 1 deletions

View File

@ -1533,7 +1533,7 @@ return [
'Couchbase\WildcardSearchQuery::jsonSerialize' => ['array'],
'Couchbase\zlibCompress' => ['string', 'data'=>'string'],
'Couchbase\zlibDecompress' => ['string', 'data'=>'string'],
'count' => ['int', 'var'=>'Countable|array', 'mode='=>'int'],
'count' => ['int', 'var'=>'Countable|array|SimpleXMLElement|ResourceBundle', 'mode='=>'int'],
'count_chars' => ['mixed', 'input'=>'string', 'mode='=>'int'],
'Countable::count' => ['int'],
'crack_check' => ['bool', 'dictionary'=>'', 'password'=>'string'],

View File

@ -1675,6 +1675,11 @@ class FunctionCallTest extends TestCase
takesString($s);
}',
],
'countableSimpleXmlElement' => [
'<?php
$xml = new SimpleXMLElement("<?xml version=\"1.0\"?><a><b></b><b></b></a>");
echo count($xml);'
],
];
}