Skip to content

Commit 67c051b

Browse files
committed
Re-add delegate
1 parent ee30dea commit 67c051b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Console.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,26 @@ protected function doExecute()
149149
// Please override this method.
150150
}
151151

152+
/**
153+
* delegate
154+
*
155+
* @param string $method
156+
*
157+
* @return mixed
158+
*/
159+
protected function delegate($method)
160+
{
161+
$args = func_get_args();
162+
array_shift($args);
163+
164+
if (!is_callable(array($this, $method)))
165+
{
166+
throw new \LogicException(sprintf('Method: %s not found', $method));
167+
}
168+
169+
return call_user_func_array(array($this, $method), $args);
170+
}
171+
152172
/**
153173
* getHelp
154174
*

0 commit comments

Comments
 (0)