Re-order code in Shell::helper() to return slightly earlier

This commit is contained in:
Gareth Ellis 2015-12-14 09:48:36 +00:00
parent 75cabfe78b
commit e640420dd9

View file

@ -793,11 +793,11 @@ class Shell extends Object {
* @throws RuntimeException If invalid class name is provided * @throws RuntimeException If invalid class name is provided
*/ */
public function helper($name) { public function helper($name) {
list($plugin, $helperClassName) = pluginSplit($name, true);
$helperClassName = Inflector::camelize($name) . "ShellHelper";
if (isset($this->_helpers[$name])) { if (isset($this->_helpers[$name])) {
return $this->_helpers[$name]; return $this->_helpers[$name];
} }
list($plugin, $helperClassName) = pluginSplit($name, true);
$helperClassName = Inflector::camelize($name) . "ShellHelper";
App::uses($helperClassName, $plugin . "Console/Helper"); App::uses($helperClassName, $plugin . "Console/Helper");
if (!class_exists($helperClassName)) { if (!class_exists($helperClassName)) {
throw new RuntimeException("Class " . $helperClassName . " not found"); throw new RuntimeException("Class " . $helperClassName . " not found");