Seldaek / monolog

Sends your logs to files, sockets, inboxes, databases and various web services
https://seldaek.github.io/monolog/
MIT License
20.95k stars 1.9k forks source link

Php 8.3 compatibility issue #1897

Closed pratik8787 closed 2 months ago

pratik8787 commented 2 months ago

Monolog 3.6.0

While checking the php compatibility via codesniffer for PHP 8.3, it is giving these errors for Monolog library

116 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1. 121 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1. 126 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1. 138 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1. 157 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1. 176 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.

Seldaek commented 2 months ago

In which file?!

Seldaek commented 2 months ago

Ah that looks to be in Monolog\Level.. I guess this is a bug in php-codesniffer because it's an enum and not a class? Anyway nothing wrong here IMO

Seldaek commented 2 months ago

See https://github.com/squizlabs/PHP_CodeSniffer/issues/3827 - make sure you update your tooling if you are using the latest PHP version.

golliholzland commented 2 months ago

@Seldaek I'm having trouble understanding the situation. Has the issue been resolved, or is there still a problem? Are you implying that there might be an issue with the configuration? Please provide a clear solution or a well-constructed response before closing tickets.

Seldaek commented 2 months ago

There is no problem at all. Please read the linked issue before complaining. This was never a problem with Monolog.

I'll paste it here though:

I happen to know this has already been fixed in the PHPCompatibility develop branch.

This bug was fixed over a year ago in the PHPCompatibility project. So you need to update that.