2026-05-08 17:06 UTC
Hey @pmjones@phpc.social, I like the overall direction, but I’m not convinced the interfaces are quite right yet.
Input belongs to the execution method, not object construction.
FWIW, I think `FrontController` Interface would make more sense as:
public function run(RequestInterface $request): ResponseInterface;
In particular, having ConsoleFrontController accept $argv in the constructor feels off to me.
Replies (1)
-
@ghostwriter@phpc.social 2026-05-08 17:07
@pmjones@phpc.social That design effectively ties one controller instance to one command invocation, which means users would need to instantiate a new object every time they want to execute another command. If the console request were instead passed into run(), the same controller instance could be reused: $controller->run(new ArgvRequest($argv)); That feels more consistent with the HTTP side as well, where the request is execution input rather than construction-time configuration.