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).
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).