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 |
||
42 | public function generateScaffoldItems() |
||
43 | { |
||
44 | if (false === $this->isSkip('requests') and false === $this->isSkip('scaffold_requests')) { |
||
45 | $requestGenerator = new RequestGenerator($this->commandData); |
||
46 | $requestGenerator->generate(); |
||
47 | } |
||
48 | |||
49 | if (false === $this->isSkip('controllers') and false === $this->isSkip('scaffold_controller')) { |
||
50 | $controllerGenerator = new ControllerGenerator($this->commandData); |
||
51 | $controllerGenerator->generate(); |
||
52 | } |
||
53 | |||
54 | if (false === $this->isSkip('views')) { |
||
55 | $viewGenerator = new ViewGenerator($this->commandData); |
||
56 | $viewGenerator->generate(); |
||
57 | } |
||
58 | |||
59 | if (false === $this->isSkip('routes') and false === $this->isSkip('scaffold_routes')) { |
||
60 | $routeGenerator = new RoutesGenerator($this->commandData); |
||
61 | $routeGenerator->generate(); |
||
62 | } |
||
63 | |||
64 | if (false === $this->isSkip('menu') and $this->commandData->config->getAddOn('menu.enabled')) { |
||
65 | $menuGenerator = new MenuGenerator($this->commandData); |
||
66 | $menuGenerator->generate(); |
||
67 | } |
||
82 |