[RFC]: Require a PlatformInterface in the DDL process* methods
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Comienza en src/Sql/Ddl con los métodos process* de CreateTable, AlterTable y DropTable, y lee AbstractSql::buildSqlString() y getSqlString() para confirmar que la plataforma siempre es non-null. Cambia cada firma de ?PlatformInterface $adapterPlatform = null a PlatformInterface $adapterPlatform, manteniendo el parámetro en processCombinedby() y processStatementEnd() por compatibilidad posicional, y luego verifica con mago analyze --ignore-baseline src/Sql que los 21 hallazgos disminuyen según lo previsto y que el conjunto de pruebas sigue pasando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Proposed Version
Next minor
Basic Information
The process* methods on CreateTable, AlterTable and DropTable take ?PlatformInterface $adapterPlatform = null, but use it unconditionally: they call quoteIdentifier(), quoteTrustedValue(), processExpression() and resolveTable(), none of which accept null. Their only caller, AbstractSql::buildSqlString(), always passes a non-null platform.
This accounts for 21 analyzer findings in src/Sql/Ddl:
possibly-null-argument(8) andpossible-method-access-on-null(6).less-specific-nested-return-statement(4) andinvalid-return-statement(1): calling a method on a possibly-null platform yieldsmixed, so the arrays these methods return lose their element types.unused-parameter(2):CreateTable::processCombinedby()andprocessStatementEnd()receive the platform but don't use it.
Background
AbstractSql::getSqlString() supplies a default platform before calling buildSqlString(), so no path reaches these methods with null.
Considerations
- These are
protectedmethods. Making the parameter required narrows it for callers, but subclasses that override with?PlatformInterface $adapterPlatform = nullremain compatible, since a child may widen a parameter. - A subclass that calls
parent::processX()without arguments, or withnull, would get anArgumentCountErrororTypeError. None of the driver packages do this.
Proposal(s)
Change the signature of each DDL process* method to PlatformInterface $adapterPlatform. Keep the parameter on processCombinedby() and processStatementEnd(), since buildSqlString() passes it positionally to every process* method.
Appendix/Additional Info
Finding counts are from mago analyze --ignore-baseline src/Sql once the docblock typing in #204 is applied.
- Lenguaje dominante
- PHP
- Estrellas
- 18
- Forks
- 8
- Merge medio
- 6 d 11 h
- PR fusionados (30 d)
- 14
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de php-db/phpdb
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
RFC
Dificultad 3/5 1-2 días Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
RFC
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
Los mantenedores suelen responder en 1 día
-
RFC
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
Sql's foreign-table guard raises TypeError when its table is a TableIdentifier or aliased arrayPosiblemente ocupada @simon-mundy la tomó hace 2 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 50/100
Los mantenedores suelen responder en 1 día
Todos los issues de php-db/phpdb
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Awaiting Triage bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
product / databases
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
VilnaCRM-Org/user-service#525 ·
Los mantenedores suelen responder en 21 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
shukiv/jabali-panel#2029 ·
Los mantenedores suelen responder en 1 día