Refactor WebAppAdapter::start() and ConsoleAppAdapter::start() into structured runtime pipelines
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza con src/App/Adapters/WebAppAdapter.php y src/App/Adapters/ConsoleAppAdapter.php, y luego sigue los traits relacionados y src/App/BootPipeline.php. Compara los flujos actuales de start() con RouteDispatcher.php y MiddlewareManager.php para trazar el estado de ejecución y las responsabilidades. Se considera terminado cuando ambos adapters usan pipelines de ejecución y objetos de contexto dedicados, preservando el comportamiento web y de consola indicado; actualiza las pruebas según sea necesario.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Refactor WebAppAdapter::start() and ConsoleAppAdapter::start() so runtime execution is no longer handled as flat sequences of loosely connected method calls.
Introduce structured runtime pipelines for web and console flows, similar in spirit to boot stages, so execution becomes explicit, extensible, and ready for future lifecycle hooks.
Why
The constructor already has a clear staged boot flow through BootPipeline, but runtime execution is still handled ad hoc.
In WebAppAdapter::start(), current responsibilities are mixed together in one method:
- preflight handling
- route resolution
- not found handling
- language loading
- debug info logging
- view cache setup
- cached response lookup
- route dispatch
- middleware execution
- response sending
- request cleanup
In ConsoleAppAdapter::start(), runtime execution is also flat:
- core command registration
- app command registration
- command validation
- command execution
This makes both runtime flows harder to reason about and leaves no clean structural boundaries for future lifecycle hooks.
Goal
Create proper runtime execution structures for both web and console adapters before introducing broader lifecycle hooks.
Runtime flow should become stage-based rather than remaining collections of ad hoc method calls.
Proposed Direction
Introduce dedicated runtime pipelines instead of reusing BootPipeline directly.
Suggested runtime structures:
RequestPipelineRequestContextConsolePipelineConsoleContext
These should carry evolving runtime state rather than relying on loose locals and inline control flow.
Suggested Web Runtime Stages
A reasonable first breakdown of the current web flow is:
HandlePreflightStageResolveRouteStageHandleRouteNotFoundStagePrepareRequestStageDispatchRequestStageSendResponseStageCleanupRequestStage
Notes:
PrepareRequestStageshould cover:- language loading
- debug info logging
- view cache setup
DispatchRequestStageshould cover:- cached response lookup
- route dispatch
- middleware execution
Suggested Console Runtime Stages
A reasonable first breakdown of the current console flow is:
RegisterCoreCommandsStageRegisterAppCommandsStageValidateCommandStageRunCommandStage
If needed, command registration can later be collapsed into a single preparation stage, but the first refactor should prioritize clarity.
Scope
This ticket is about refactoring runtime structure for both adapters.
It should not yet define the full lifecycle hook contract. That should come after runtime flow has proper structural boundaries.
Acceptance Criteria
WebAppAdapter::start()is refactored into a structured runtime pipelineConsoleAppAdapter::start()is refactored into a structured runtime pipeline- runtime state is carried through dedicated runtime context objects rather than loose local variables
- web runtime responsibilities such as language loading and view cache handling are preserved in the new structure
- console runtime responsibilities such as command registration, validation, and execution are preserved in the new structure
- the new runtime structures are suitable for later lifecycle hook integration
- tests are updated as needed
Notes
Relevant code:
src/App/Adapters/WebAppAdapter.phpsrc/App/Adapters/ConsoleAppAdapter.phpsrc/App/Traits/WebAppTrait.phpsrc/App/Traits/ConsoleAppTrait.phpsrc/Router/RouteDispatcher.phpsrc/Middleware/MiddlewareManager.phpsrc/App/BootPipeline.php
This ticket should be completed before introducing broader runtime lifecycle hooks.
- Lenguaje dominante
- PHP
- Estrellas
- 36
- Forks
- 22
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la 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 quantum-php/framework
-
routing testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
quantum-php/framework#547 ·
-
view
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
quantum-php/framework#542 ·
-
enhancement http
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
quantum-php/framework#565 · 1 comentario ·
-
components view
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
quantum-php/framework#551 ·
-
Add explicit @version special route token support for API major versioning within a single moduleAbiertorouting
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
quantum-php/framework#550 ·
Todos los issues de quantum-php/framework
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
filamentphp/filament#20630 ·
Los mantenedores suelen responder en 1 día
-
Issue: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
OpenAPITools/openapi-generator#25107 ·
Los mantenedores suelen responder en 1 día
-
needs-maintainer-review review:approve
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Ultimate-Multisite/ultimate-ai-connector-compatible-endpoints#163 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día