Skip to content
This repository
Browse code

Removing extra if() that are not needed

as __loadController will stop() execution on error.
  • Loading branch information...
commit 7cf7a0440c205e6390025acbcb78b517f18005dc 1 parent bb566c3
Mark Story authored

Showing 1 changed file with 16 additions and 18 deletions. Show diff stats Hide diff stats

  1. 34  cake/console/libs/tasks/view.php
34  cake/console/libs/tasks/view.php
@@ -129,25 +129,23 @@ function execute() {
129 129
 				$this->bake($action, true);
130 130
 			} else {
131 131
 				$vars = $this->__loadController();
132  
-				if ($vars) {
133  
-					$methods =  array_diff(
134  
-						array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
135  
-						array_map('strtolower', get_class_methods('appcontroller'))
136  
-					);
137  
-					if (empty($methods)) {
138  
-						$methods = $this->scaffoldActions;
139  
-					}
140  
-					$adminDelete = null;
  132
+				$methods =  array_diff(
  133
+					array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
  134
+					array_map('strtolower', get_class_methods('appcontroller'))
  135
+				);
  136
+				if (empty($methods)) {
  137
+					$methods = $this->scaffoldActions;
  138
+				}
  139
+				$adminDelete = null;
141 140
 
142  
-					$adminRoute = Configure::read('Routing.admin');
143  
-					if (!empty($adminRoute)) {
144  
-						$adminDelete = $adminRoute . '_delete';
145  
-					}
146  
-					foreach ($methods as $method) {
147  
-						if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) {
148  
-							$content = $this->getContent($method, $vars);
149  
-							$this->bake($method, $content);
150  
-						}
  141
+				$adminRoute = Configure::read('Routing.admin');
  142
+				if (!empty($adminRoute)) {
  143
+					$adminDelete = $adminRoute . '_delete';
  144
+				}
  145
+				foreach ($methods as $method) {
  146
+					if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) {
  147
+						$content = $this->getContent($method, $vars);
  148
+						$this->bake($method, $content);
151 149
 					}
152 150
 				}
153 151
 			}

0 notes on commit 7cf7a04

Please sign in to comment.
Something went wrong with that request. Please try again.