mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-23 22:45:20 +00:00
187de4b769
The standard type for these returns is NodeList and HTMLCollection, which are almost *but not quite* the same as an array. In two places we got a little complacent and assumed our non-standard DOMCompat workarounds would always return arrays. Tweaked the types of DOMCompat to report that they return an `iterable`, which is a PHP7.1 "pseudo-type" that unifies arrays and \Traversable types like HTMLCollection/NodeList. This allows phan to catch places where we slip up and assume an array type return. It does introduce a new wrinkle, though, since there is no simple way to turn an iterable into an array. We're using a simple `iterable_to_array` helper function for this. Change-Id: I35bdeb3afa30ef5182e71733a0a606aadcafb435 |
||
---|---|---|
src/Parsoid |