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

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V 0

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 63

Show 43 more files