Repository navigation
Bring Metadata, Exception and Feature to full Mago compliance - #197
Merged
simon-mundy merged 2 commits intoOct 5, 2026
Merged
Conversation
Declares the constant types Mago asks for on the ConstraintKeyObject foreign key actions and on AbstractSource::DEFAULT_SCHEMA. Typed constants need PHP 8.3, which is the floor, and EventFeatureEventsInterface already uses them. The three root exception classes import their parent under a Base alias rather than naming it fully qualified. A plain import is not available: each class shadows the name of the class it extends. ExceptionInterface is marked @api, matching the fourteen files that already carry the tag. The two Metadata exception classes are marked final. Nothing subclasses them. The remaining exception classes are left alone, so the convention is mixed until each component is visited. Feature was already clean. All three components now leave both baselines entirely: lint falls to 345 and the analyzer to 1206.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Sep 29, 2026
tyrsson
approved these changes
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Clears every remaining Mago finding in
src/Metadata,src/Exceptionandsrc/Feature. All three now leave both baselines entirely, taking the count of fully compliant components from one to three.Both baselines are regenerated, so the twelve findings are removed rather than suppressed.
mago lint,mago analyzeandmago format --checkare clean.src/Exception (4 → 0)
Three
no-fully-qualified-global-class-like: the root exception classes named their parent fully qualified, asextends \InvalidArgumentException. A plain import is not available, since each class shadows the name of the class it extends, so each imports the parent under aBasealias. That follows the existing convention inTableGateway\Feature\FeatureInterfaceandSql\Predicate\Expression.One
missing-api-or-internal:ExceptionInterfaceis marked@api, matching the fourteen files already carrying the tag.src/Metadata (8 → 0)
Six
missing-constant-type: explicitstringtypes on the fiveFK_*constants inConstraintKeyObjectand onAbstractSource::DEFAULT_SCHEMA. Typed constants require PHP 8.3, which is the floor (~8.3.0 || ~8.4.0 || ~8.5.0), andTableGateway\Feature\EventFeatureEventsInterfacealready uses the syntax.Two
class-must-be-final:Metadata\Exception\InvalidArgumentExceptionandRuntimeExceptionare marked final. Nothing insrcortestsubclasses either.Note on the final exception classes
The remaining twenty exception classes in
srcstay non-final, so the convention is mixed until each component is visited on its own. Sealing all of them at once is a BC break for anyone subclassing, and is better decided deliberately than as a side effect of this branch.Worth flagging for whoever picks up the next component:
class-must-be-finalis not simply flagging empty{}exception classes.Metadata\Exception\RuntimeExceptionhas six constants and six named constructors and was still flagged, while theSqlandSql\Predicateexception classes are not flagged despite also being non-final. The reason is not yet understood, so do not assume those are exempt by design.