Repository navigation
Type the Sql class constants as string - #221
Merged
simon-mundy merged 5 commits intoOct 9, 2026
Merged
Conversation
Test assets that redeclare SPECIFICATION_* constants now carry the type too, as PHP rejects an untyped override of a typed constant. Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
simon-mundy
marked this pull request as ready for review
October 6, 2026 02:22
tyrsson
previously approved these changes
Oct 8, 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.
Depends on #220. Until the earlier PRs in this series merge, this diff also shows their commits; the change here is the last commit, "Type the Sql class constants as string".
Clears the 85
missing-constant-typeMago analyzer findings insrc/Sql.Changes
src/Sqlis declaredconst string. All of them hold strings, including those that alias other constants (Select::JOIN_*,PredicateSet::COMBINED_BY_*).DeleteIgnore,UpdateIgnoreandReplacetest assets, which redeclareSPECIFICATION_*constants, declare themconst stringtoo.src/Sqlentries change.Breaking changes
const string. PHP rejects an untyped override of a typed constant:Type of X::SPECIFICATION_DELETE must be compatible with PhpDb\Sql\Delete::SPECIFICATION_DELETE of type string.mago format,mago lint,mago analyzeand the unit tests pass.