Repository navigation
Sql docblock typing - #204
Merged
Merged
Conversation
AbstractSql declares Specification, SqlParameters and ColumnReference aliases and Join declares JoinSpecification, which subclasses import so $specifications keeps one invariant type. Select, Insert, Update, Delete, Combine, the DDL classes, Expression, PredicateSet and Sql type their tables, columns, predicates, options and process* output. Docblocks only; no code changes. 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! |
This was referenced Oct 4, 2026
tyrsson
approved these changes
Oct 6, 2026
simon-mundy
marked this pull request as ready for review
October 6, 2026 01:25
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 #203. Until it merges, this diff also shows #203's two commits; the change here is the last commit, "Describe Sql shapes in docblocks".
Adds docblock types across
src/Sql, reducing Mago analyzer findings there from 636 to 423 (counted without the baseline). Docblocks only: with comments and whitespace stripped, every changed file has the same PHP token stream as before.Changes
AbstractSqldeclaresSpecification,SqlParametersandColumnReferencetype aliases.JoindeclaresJoinNameandJoinSpecification, and implementsIterator<int, JoinSpecification>.Specification, so$specificationskeeps one invariant type acrossSelect,Insert,InsertIgnore,Update,Delete,Combine,CreateTable,AlterTableandDropTable.Select,Insert,Update,DeleteandSqltype their table references, column lists, predicates and combine state. Eachprocess*method describes the array it returns.@psalm-returntags onAlterTable'sprocess*methods are replaced.Expressiondeclares anExpressionParameteralias.ExpressionInterface::getExpressionData()returnsvaluesas a list.PredicateSettypes its predicate list, andInandArgument::values()type their value sets.src/Sqlentries, it gains entries forTableGateway, which passes untyped values into the newly typed parameters.Breaking changes
None.
mago format,mago lint,mago analyzeand the unit tests pass.