jkphl / micrometa

A meta parser for extracting micro information out of web documents, currently supporting Microformats 1+2, HTML Microdata, RDFa Lite 1.1, JSON-LD and Link Types, written in PHP
http://micrometa.jkphl.is
MIT License
115 stars 39 forks source link

Do not assume `ItemInterface` is a collection by extending traversable `ItemListInterface` #50

Closed rvanlaak closed 3 years ago

rvanlaak commented 4 years ago

The latest version of PHPStan does check for generics. In other words, for traversables it also does static code detection of their items.

The ItemInterface does extend ItemListInterface and thereby is a traversable. This is incorrect because it also can be a single item.

What is needed / what would conflict when removing the item interface from extending the list interface?