phpmetrics / PhpMetrics

Beautiful and understandable static analysis tool for PHP
https://phpmetrics.github.io/website/
MIT License
2.48k stars 259 forks source link

PHP8 Issue on report-violations #494

Closed raymond10 closed 1 month ago

raymond10 commented 1 year ago

Bug report

Hi,

When i run --report-violations with PHP 8.2.7, I get Uncaught TypeError.

Here is the full exception I have :

HTML report generated in "/ExtractColloque/" directoryPHP Fatal error:  Uncaught TypeError: array_map(): 
Argument #2 ($array) must be of type array, Hal\Violation\ViolationsHandler given in 
/vendor/phpmetrics/phpmetrics/src/Hal/Report/Violations/Xml/Reporter.php:64
Stack trace:
#0 /vendor/phpmetrics/phpmetrics/src/Hal/Report/Violations/Xml/Reporter.php(64): array_map()
#1 /vendor/phpmetrics/phpmetrics/src/Hal/Application/ReporterHandler.php(32): Hal\Report\Violations\Xml\Reporter->generate()
#2 [internal function]: Hal\Application\ReporterHandler::Hal\Application\{closure}()
#3 /vendor/phpmetrics/phpmetrics/src/Hal/Application/ReporterHandler.php(31): array_map()
#4 /vendor/phpmetrics/phpmetrics/src/Hal/Application/PhpMetrics.php(33): Hal\Application\ReporterHandler->report()
#5 /vendor/phpmetrics/phpmetrics/bin/phpmetrics(36): Hal\Application\PhpMetrics->run()
#6 {main}
  thrown in /vendor/phpmetrics/phpmetrics/src/Hal/Report/Violations/Xml/Reporter.php on line 64

Thanks for your help

niconoe- commented 1 year ago

Thank you for your report, I'll try to see that ASAP, but I'm affraid it could take some time as I won't be available for the next weeks

niconoe- commented 1 year ago

A fix was provided but no release of the RC, sorry about this.

@raymond10 Could you please give it a try with version v3.0.0rc4 ?

Thanks a lot

niconoe- commented 1 month ago

Fixed on v3 (rc6).