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 |
||
55 | public function generateScaffoldItems() |
||
56 | { |
||
57 | if (false === $this->isSkip('requests') and false === $this->isSkip('scaffold_requests')) { |
||
58 | $requestGenerator = new RequestGenerator($this->commandData); |
||
59 | $requestGenerator->generate(); |
||
60 | } |
||
61 | |||
62 | if (false === $this->isSkip('controllers') and false === $this->isSkip('scaffold_controller')) { |
||
63 | $controllerGenerator = new ControllerGenerator($this->commandData); |
||
64 | $controllerGenerator->generate(); |
||
65 | } |
||
66 | |||
67 | if (false === $this->isSkip('views')) { |
||
68 | $viewGenerator = new ViewGenerator($this->commandData); |
||
69 | $viewGenerator->generate(); |
||
70 | } |
||
71 | |||
72 | if (false === $this->isSkip('routes') and false === $this->isSkip('scaffold_routes')) { |
||
73 | $routeGenerator = new RoutesGenerator($this->commandData); |
||
74 | $routeGenerator->generate(); |
||
75 | } |
||
76 | |||
77 | if (false === $this->isSkip('menu') and $this->commandData->config->getAddOn('menu.enabled')) { |
||
78 | $menuGenerator = new MenuGenerator($this->commandData); |
||
79 | $menuGenerator->generate(); |
||
80 | } |
||
95 |