nikic / PHP-Parser

A PHP parser written in PHP
BSD 3-Clause "New" or "Revised" License
17.04k stars 1.1k forks source link

Fix deprecated Optional parameter before required parameter on PrintableNewAnonClassNode #987

Closed samsonasik closed 7 months ago

samsonasik commented 7 months ago

Fixes https://github.com/nikic/PHP-Parser/issues/986

samsonasik commented 7 months ago

Ready to merge 👍

staabm commented 7 months ago

Would this error be detected by a php lint CI job?

If so, would be great to add such github actions

samsonasik commented 7 months ago

On rector-src, we use list of classes as preload, and error detected early.

I compared to php-parser v5, it seems null default value is not exists, so I think this is solution with remove default null.

staabm commented 7 months ago

I don't question your fix. was only thinking about some CI tooling for this PR here to make sure we can detect such errors in the future earlier

nikic commented 7 months ago

I don't see the deprecation warning printed on the PHP 8.2 and PHP 8.3 CI jobs at all -- I wonder why that is. I do see it when running with these versions locally.