From: Tim Starling Date: Mon, 23 Sep 2019 05:30:46 +0000 (+1000) Subject: Pass "services" through from coreRoutes.json to ObjectFactory X-Git-Tag: 1.34.0-rc.0~94^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=64e8987c542b5b4a6e7660dec0abf563bb252054 Pass "services" through from coreRoutes.json to ObjectFactory Allows service injection into REST handlers. Change-Id: I83d1780903febe0499c6a575a0e6725dc01e5b0c --- diff --git a/includes/Rest/Router.php b/includes/Rest/Router.php index 6821d89c27..6dfcf3c2d7 100644 --- a/includes/Rest/Router.php +++ b/includes/Rest/Router.php @@ -276,8 +276,7 @@ class Router { $request->setPathParams( array_map( 'rawurldecode', $match['params'] ) ); $spec = $match['userData']; $objectFactorySpec = array_intersect_key( $spec, - // @todo ObjectFactory supports more keys than this. - [ 'factory' => true, 'class' => true, 'args' => true ] ); + [ 'factory' => true, 'class' => true, 'args' => true, 'services' => true ] ); /** @var $handler Handler (annotation for PHPStorm) */ $handler = $this->objectFactory->createObject( $objectFactorySpec ); $handler->init( $this, $request, $spec, $this->responseFactory );