From 64e8987c542b5b4a6e7660dec0abf563bb252054 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 23 Sep 2019 15:30:46 +1000 Subject: [PATCH] Pass "services" through from coreRoutes.json to ObjectFactory Allows service injection into REST handlers. Change-Id: I83d1780903febe0499c6a575a0e6725dc01e5b0c --- includes/Rest/Router.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 ); -- 2.20.1