[RFC]: Decide which PhpDb\Sql classes become final
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by reviewing the listed classes under src/Sql and checking the driver packages for subclasses, especially the decorators described in #175 and phpdb-mysql's src/Sql/Ddl classes. Compare those findings with the proposed exclusions in mago.toml. Done means deciding which classes can become final, documenting exclusions for those that cannot, and resolving Platform\Platform alongside #175.
由索引模型根据 Issue 内容生成。
描述
Proposed Version
Next major
Basic Information
Mago reports 44 class-must-be-final findings in src/Sql, all baselined. Resolving them means deciding which classes are extension points, which a mechanical fix can't do.
Classes reported:
- Statements:
Select,Delete,Update,InsertIgnore,Combine,Sql,Join,Where,Having,Platform\Platform - DDL:
Ddl\CreateTable,Ddl\AlterTable,Ddl\DropTable,Ddl\Index\Index, the 17 concreteDdl\Column\*classes, andDdl\Constraint\{Check, ForeignKey, PrimaryKey, UniqueKey} - Predicates:
Predicate\{Operator, Expression, Literal, IsNotNull, NotBetween, NotIn, NotLike} - Exceptions:
Predicate\Exception\{InvalidArgumentException, RuntimeException}
Background
The driver packages extend several of these classes:
- Every platform decorator extends
Select,Insert,Update,Delete,CreateTableorAlterTable(see #175). phpdb-mysqlships its own DDL decorators undersrc/Sql/Ddl.- The test suite subclasses
Delete,UpdateandInsert(DeleteIgnore,UpdateIgnore,Replace).
Metadata went through the same decision: its object classes were made final.
Considerations
- Making a class
finalbreaks every subclass of it. The statement and DDL classes that decorators extend cannot become final without replacing inheritance with composition. - Leaf predicates, concrete column types and the exception classes have no known subclasses.
Proposal(s)
- Make
finalthe classes with no known subclasses: the leaf predicates, thePredicate\Exceptionclasses,Join,WhereandHaving. Check the driver packages first. - Keep the statement and DDL classes non-final, and add a per-path
class-must-be-finalexclusion inmago.tomldocumenting why, as already done forprefer-self-return-type. - Settle
Platform\Platformas part of #175, which already proposes making it final.
Appendix/Additional Info
Finding counts are from mago analyze --ignore-baseline src/Sql once the docblock typing in #204 is applied.
- 主要语言
- PHP
- 星标
- 18
- 派生
- 8
- 平均合并
- 6 天 11 小时
- 30 天内合并 PR
- 14
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
php-db/phpdb 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
RFC
难度 3/5 1-2 天 新手友好度 66/100
维护者通常 1 天内回复
-
RFC
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 1 天内回复
-
RFC
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
-
Sql's foreign-table guard raises TypeError when its table is a TableIdentifier or aliased array可能已有人在做 @simon-mundy 于 3 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 50/100
维护者通常 1 天内回复
相似的 Issue
-
Bug Enhancement Performance
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Feature Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复
-
frontend low-priority
难度 2/5 1-3 小时 新手友好度 77/100
mplodowski/dynamicpdf-plugin#336 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
AdvancedCustomFields/acf#1044 ·
-
Add Zammad可能已有人在做 @Arslan-TR 今天认领。 未关闭request
难度 2/5 1-3 小时 新手友好度 66/100
endoflife-date/endoflife.date#11298 · 1 条评论 ·
维护者通常 1 天内回复