Conditions | 10 |
Paths | 32 |
Total Lines | 25 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
41 | public function generateScaffoldItems() |
||
42 | { |
||
43 | if (false === $this->isSkip('requests') and false === $this->isSkip('scaffold_requests')) { |
||
44 | $requestGenerator = new RequestGenerator($this->commandData); |
||
45 | $requestGenerator->generate(); |
||
46 | } |
||
47 | |||
48 | if (false === $this->isSkip('controllers') and false === $this->isSkip('scaffold_controller')) { |
||
49 | $controllerGenerator = new ControllerGenerator($this->commandData); |
||
50 | $controllerGenerator->generate(); |
||
51 | } |
||
52 | |||
53 | if (false === $this->isSkip('views')) { |
||
54 | $viewGenerator = new ViewGenerator($this->commandData); |
||
55 | $viewGenerator->generate(); |
||
56 | } |
||
57 | |||
58 | if (false === $this->isSkip('routes') and false === $this->isSkip('scaffold_routes')) { |
||
59 | $routeGenerator = new RoutesGenerator($this->commandData); |
||
60 | $routeGenerator->generate(); |
||
61 | } |
||
62 | |||
63 | if (false === $this->isSkip('menu') and $this->commandData->config->getAddOn('menu.enabled')) { |
||
64 | $menuGenerator = new MenuGenerator($this->commandData); |
||
65 | $menuGenerator->generate(); |
||
66 | } |
||
69 |