Sql\Platform: decorator contract is incomplete and Platform's per-platform registry is unused
I maintainer di solito rispondono entro 1 giorno
@simon-mundy ci sta già lavorando.
Dal 24/8/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Summary
PlatformDecoratorInterface declares only setSubject(), but every caller of
AbstractPlatform::getTypeDecorator() immediately calls getSqlString() or
prepareStatement() on the result. Those methods are not on the contract, so the
calls are unprovable and the analyzer reports them as calls to non-existent methods.
Separately, Platform stores its decorators in a per-platform map
([platformName][class => decorator]) while AbstractPlatform — which every driver
package extends — stores a flat [class => decorator] map. The two shapes share one
property name, so the property cannot be typed.
Together these account for 26 of the 28 analyzer findings in src/Sql/Platform.
Proposed change
PlatformDecoratorInterface extends SqlInterface, PreparableSqlInterface. Every
decorator in the ecosystem already satisfies this — they all extendSelect,
Insert,Update,Delete,CreateTableorAlterTable.setSubject()no longer acceptsnull, matching the non-nullable$subject
property it assigns to. Passingnullis currently aTypeError.- Remove the per-platform decorator registry from
Platform. It has no callers: the
three-argumentsetTypeDecorator()and two-argumentgetTypeDecorator()are never
invoked anywhere in this repository or in any driver package, and no test registers
decorators for more than one platform.Platformthen inherits the flat map, like
every driver. - Mark
Platformfinal. - Remove the two now-unreachable guards in
Sql::buildSqlString()and
Sql::prepareStatementForSqlObject(), and the two tests covering them.
Compatibility
AbstractPlatform is unchanged in shape and signature, so phpdb-mysql and
phpdb-sqlite, which extend it and call the two-argument setTypeDecorator(), are
unaffected. phpdb-sqlite's reflection test on decorators still passes.
phpdb-pgsql instantiates Sql\Platform\Platform directly in
AdapterPlatform::getSqlPlatformDecorator(). It registers no decorators and calls none
of the removed methods. Verified by installing phpdb-pgsql against this branch and
against 0.6.x: both produce SELECT "users".* FROM "users" from the same probe.
phpdb-{ibmdb2,oci8,sql92,sqlsrv} will carry their own copy of
PhpDb\Sql\Platform\* and will have no runtime dependency on php-db/phpdb.
Breaking changes
Removed from Platform: the three-argument setTypeDecorator(), the two-argument
getTypeDecorator(), the getDecorators() override and the protected
resolvePlatformName(). Platform becomes final. No known caller uses any of them.
Notes
This addresses the @todo sat-migration block in Platform::__construct(). That approach has been
superseded by each driver shipping its own platform class.
- Lingua principale
- PHP
- Stelle
- 18
- Fork
- 8
- Merge medio
- 6g 11h
- PR unite (30g)
- 14
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di php-db/phpdb
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
RFC
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
RFC
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
I maintainer di solito rispondono entro 1 giorno
-
RFC
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
RFC
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di php-db/phpdb
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Awaiting Triage bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
freshrss: Unable to update feedsForse già presa @Stunkymonkey l’ha presa oggi. Aperta0.kind: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
NixOS/nixpkgs#571043 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
product / databases
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
VilnaCRM-Org/user-service#525 ·
I maintainer di solito rispondono entro 21 giorni