From 1619f84bc86c4ed0ed8ce3caffec14070699033c Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 25 Mar 2015 13:00:23 +0100 Subject: [PATCH] Provide empty run() method. This allows me to override the handle() method in subclasses (where I need access to the request object) without having to overwrite run(), too. The class is still abstract. --- framework/core/src/Api/Actions/BaseAction.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/framework/core/src/Api/Actions/BaseAction.php b/framework/core/src/Api/Actions/BaseAction.php index d9aa5077c..764acdf9d 100644 --- a/framework/core/src/Api/Actions/BaseAction.php +++ b/framework/core/src/Api/Actions/BaseAction.php @@ -13,8 +13,6 @@ use Response; abstract class BaseAction extends Action { - abstract protected function run(ApiParams $params); - public function __construct(Actor $actor, Dispatcher $bus) { $this->actor = $actor; @@ -40,6 +38,15 @@ abstract class BaseAction extends Action return $this->run($params); } + /** + * @param ApiParams $params + * @return mixed + */ + protected function run(ApiParams $params) + { + // Should be implemented by subclasses + } + public function hydrate($object, $params) { foreach ($params as $k => $v) {