neeckeloo / monolog-module

Monolog integration into Laminas
MIT License
8 stars 3 forks source link

LoggerFactory PHP8 incompatibility #18

Open exptom opened 3 years ago

exptom commented 3 years ago

On line 121 of LoggerFactory: return call_user_func_array(array($reflection, 'newInstance'), array_values($options));

Results in an error Uncaught Error: Unknown named parameter $path in /var/www/html/vendor/neeckeloo/monolog-module/src/Factory/LoggerFactory.php on line 121.

This is because in PHP8 call_user_func_array passes the $options array as named parameters if it has named keys. Using array_values() to return a numerically keyed array would fix the issue as the options would then be passed positionaly just as they are in PHP7 and this would maintain both PHP7 and PHP8 compatibility.

return call_user_func_array(array($reflection, 'newInstance'), array_values($options));

Saltibarsciai commented 2 years ago

@neeckeloo ping

dkmuir commented 1 year ago

Use 'stream' instead of 'path' and it works.