dkrnl / SimpleXMLReader

Wrapped XMLReader class, for simple SAX-reading of huge xml.
112 stars 43 forks source link

php 8.2, unit tests, phpstan #18

Closed pounard closed 1 year ago

pounard commented 1 year ago

Upgrading a project to PHP 8.2, I encountered many PHP deprecation warnings, and other warning, so I decided to work toward fixing them.

Along the way, to reproduce it, I added a foo unit test, that simply execute something similar to the example under the examples folder.

Since I don't speak the original XML language, I switched the tested XML in english (with a very approximate translation, sorry for this).

I also made all methods stricter in typings, and removed redundant PHPdoc since typings are already self-documenting.

I also added phpstan as a dev dependencies, and run it at level 3, fixing pretty much all issues it warned about, except for unknown properties access (properties of the XMLReader class).

dkrnl commented 1 year ago

Hi! Sorry, 8.2 too high version

pounard commented 1 year ago

I could have downgraded and stick to 8.0 or 8.1 thought. Anyway, because it you lots of time to answer, I ended up forking it. Thanks anyway.