You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[RFC]: Decide which PhpDb\Sql classes become final #213
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.
phpdb-mysql ships its own DDL decorators under src/Sql/Ddl.
The test suite subclasses Delete, Update and Insert (DeleteIgnore, UpdateIgnore, Replace).
Metadata went through the same decision: its object classes were made final.
Considerations
Making a class final breaks 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 final the classes with no known subclasses: the leaf predicates, the Predicate\Exception classes, Join, Where and Having. Check the driver packages first.
Keep the statement and DDL classes non-final, and add a per-path class-must-be-final exclusion in mago.toml documenting why, as already done for prefer-self-return-type.
Activity