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.
This commit is contained in:
Franz Liedke 2015-03-25 13:00:23 +01:00
parent 35c9ab9f23
commit 1619f84bc8

View File

@ -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) {