Conditions | 12 |
Paths | 32 |
Total Lines | 25 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 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 |
||
20 | public function generateGraphQLItems() |
||
21 | { |
||
22 | if (false === ($this->isSkip('queries') or $this->isSkip('graphql_query'))) { |
||
23 | $queryGenerator = new GraphQLQueryGenerator($this->commandData); |
||
24 | $queryGenerator->generate(); |
||
25 | } |
||
26 | |||
27 | if (false === ($this->isSkip('types') or $this->isSkip('graphql_types'))) { |
||
28 | $typeGenerator = new GraphQLTypeGenerator($this->commandData); |
||
29 | $typeGenerator->generate(); |
||
30 | } |
||
31 | |||
32 | if (false === ($this->isSkip('mutations') or $this->isSkip('graphql_mutations'))) { |
||
33 | $mutationGenerator = new GraphQLMutationGenerator($this->commandData); |
||
34 | $mutationGenerator->generate(); |
||
35 | } |
||
36 | |||
37 | if (false === ($this->isSkip('inputs') or $this->isSkip('graphql_inputs'))) { |
||
38 | $mutationGenerator = new GraphQLInputGenerator($this->commandData); |
||
39 | $mutationGenerator->generate(); |
||
40 | } |
||
41 | |||
42 | if ((false === ($this->isSkip('subscription') or $this->isSkip('graphql_subscription'))) and config('pwweb.artomator.options.subscription')) { |
||
43 | $subscriptionGenerator = new GraphQLSubscriptionGenerator($this->commandData); |
||
44 | $subscriptionGenerator->generate(); |
||
45 | } |
||
88 |