Review main Abandoned

58570[WIP][TASK] Use PSR-15 RequestHandlerInterface's in backend routes

Benjamin Franzke CR 0 V 0 Hard +692 −134 updated 10/30/18, 20:45

Commit message

The backend dispatcher uses the a single-pass signature since TYPO3 v9:
  fn(ServerRequestInterface $req): ResponseInterface

That's the same signature which PSR-15 specifies for the
RequestHandlerInterface. They are defined as:
  https://www.php-fig.org/psr/psr-15/#11-request-handlers
  A request handler is an individual component that processes a
  request and produces a response, as defined by PSR-7.
We already have Invokables as single-class request handlers and now
RequestHandlerInterface classes are supported as first-class
route-targets and are directly dispatchable when given
as class name (or in theory also as object).

This change migrates all mainAction/handleRequest backend controllers to
this interface as it's very descriptive to call these request handlers
and as a drive-by will be a performance optimization as it allows to
dispatch them without having to use class reflection to detect
two-pass `($req, $res): $res` vs single-pass `($reg): $res` function
argument signature.

TODO:
 * Drop previous mainAction() and handleRequest() in classes
   that are marked @internal?

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 63

Show 43 more files

Review log 23

  1. Benjamin Franzke uploaded patch set 1 10/03/18, 16:06

  2. TYPO3com voted on patch set 1 V +1 10/03/18, 16:18 Completed build in 12m 01s on Wed, 3 Oct, 06:18 PM Test Summary: 37798 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29308

  3. Benjamin Franzke abandoned the change 10/30/18, 20:45

    Possibly the wrong point in time to effectively switch to Action–domain–responder concept (in bugfixing phase).