Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removing extra if() that are not needed

as __loadController will stop() execution on error.
  • Loading branch information...
commit 7cf7a0440c205e6390025acbcb78b517f18005dc 1 parent bb566c3
Mark Story markstory authored
Showing with 16 additions and 18 deletions.
  1. +16 −18 cake/console/libs/tasks/view.php
34 cake/console/libs/tasks/view.php
View
@@ -129,25 +129,23 @@ function execute() {
$this->bake($action, true);
} else {
$vars = $this->__loadController();
- if ($vars) {
- $methods = array_diff(
- array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
- array_map('strtolower', get_class_methods('appcontroller'))
- );
- if (empty($methods)) {
- $methods = $this->scaffoldActions;
- }
- $adminDelete = null;
+ $methods = array_diff(
+ array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
+ array_map('strtolower', get_class_methods('appcontroller'))
+ );
+ if (empty($methods)) {
+ $methods = $this->scaffoldActions;
+ }
+ $adminDelete = null;
- $adminRoute = Configure::read('Routing.admin');
- if (!empty($adminRoute)) {
- $adminDelete = $adminRoute . '_delete';
- }
- foreach ($methods as $method) {
- if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) {
- $content = $this->getContent($method, $vars);
- $this->bake($method, $content);
- }
+ $adminRoute = Configure::read('Routing.admin');
+ if (!empty($adminRoute)) {
+ $adminDelete = $adminRoute . '_delete';
+ }
+ foreach ($methods as $method) {
+ if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) {
+ $content = $this->getContent($method, $vars);
+ $this->bake($method, $content);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.