Skip to content

Commit

Permalink
Fixing bug related to issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
eduluz1976 committed Feb 16, 2019
1 parent 39243b0 commit b118da7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ActionClassMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace eduluz1976\action;

use eduluz1976\action\exception\FunctionNotFoundException;

class ActionClassMethod extends Action
{
use DBAccessible;
Expand Down Expand Up @@ -130,6 +132,10 @@ public function exec(array $additionalRequestAttributes = [])
$this->preparePlugins($obj);

$runner = [$obj, $this->getMethodName()];
if (!is_callable($runner)) {
$methodName = $this->getMethodName();
throw new FunctionNotFoundException("Error: this method/class does not exists ($className::$methodName)",1);
}
$return = call_user_func_array($runner, $this->getRequest()->getList());
$this->getResponse()->add(0, $return);
return $return;
Expand Down

0 comments on commit b118da7

Please sign in to comment.