Browse Source

Clean up code that supported using non-Shell objects.

I think we can remove support for running non-Shell shell commands now.
mark_story 12 years ago
parent
commit
f6cf866bf5
1 changed files with 2 additions and 22 deletions
  1. 2 22
      src/Console/ShellDispatcher.php

+ 2 - 22
src/Console/ShellDispatcher.php

@@ -164,28 +164,8 @@ class ShellDispatcher {
 			$command = $this->args[0];
 		}
 
-		if ($Shell instanceof Shell) {
-			$Shell->initialize();
-			return $Shell->runCommand($command, $this->args);
-		}
-
-		$methods = array_diff(get_class_methods($Shell), get_class_methods('Cake\Console\Shell'));
-		$added = in_array($command, $methods);
-		$private = $command[0] === '_' && method_exists($Shell, $command);
-
-		if (!$private) {
-			if ($added) {
-				$this->shiftArgs();
-				$Shell->startup();
-				return $Shell->{$command}();
-			}
-			if (method_exists($Shell, 'main')) {
-				$Shell->startup();
-				return $Shell->main();
-			}
-		}
-
-		throw new Error\MissingShellMethodException(['shell' => $shell, 'method' => $command]);
+		$Shell->initialize();
+		return $Shell->runCommand($command, $this->args);
 	}
 
 /**