Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoggerFactory PHP8 incompatibility #18

Open
exptom opened this issue Aug 13, 2021 · 2 comments
Open

LoggerFactory PHP8 incompatibility #18

exptom opened this issue Aug 13, 2021 · 2 comments

Comments

@exptom
Copy link

exptom commented Aug 13, 2021

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
Copy link

@neeckeloo ping

@dkmuir
Copy link

dkmuir commented Jan 18, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants