alekitto / class-finder

Utility classes to help discover other classes/namespaces
https://alekitto.github.io/class-finder/
MIT License
27 stars 5 forks source link

`ErrorHandler::handleError()` should accept `?bool` return value #5

Closed mpyw closed 2 years ago

mpyw commented 2 years ago

PHP Manual says that the handler signature must be like this:

handler(
    int $errno,
    string $errstr,
    string $errfile = ?,
    int $errline = ?,
    array $errcontext = ?
): bool

However, there are many libraries that return void or null. My Laravel project with Larastan crashes on phpstan analyze.

In XXX.php line xxx:

  During inheritance of IteratorAggregate: Uncaught TypeError: Kcs\ClassFinder\Util\ErrorHandler::handleError(): Return value must be o  
  f type bool, null returned in /project/vendor/kcs/class-finder/lib/Util/ErrorHandler.php:52  
alekitto commented 2 years ago

Hi @mpyw, this should be fixed in master can you try it and confirm its resolved?

Thanks