Remove duplicate Levels class #111
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When introducing the support for Monolog v3 (alongside v2), we added a
Levelsclass, which was a duplicate of a Monolog v2 class removed in Monolog v3.Adding that class made it easy to refer to the same class regardless of having Monolog v2 or v3 as a dependency.
However, the
Levelsclass was a 100% duplication of the code we already have in theLogLevelclass, which has existed since Wonollog v1. This is why this PR removes that duplicate class and always uses theLogLevelclass.This has teh additional side-effect of being able to remove asll the PHPStan "ingnore deprecated" comments that we needed to have because the constant is deprecated in Monolog v3.
Note: In Monolog v3, the
Levelsclass is removed and its functionality is replaced by aLevelenum. OurLogLevelclass (abstract with final methods, and not instantiable) can't be replaced with an enum because it has some logic that requires supporting static state, but enums don't support properties.