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 |
||
27 | public function generateGraphQLItems() |
||
28 | { |
||
29 | if (false === ($this->isSkip('queries') or $this->isSkip('graphql_query'))) { |
||
30 | $queryGenerator = new GraphQLQueryGenerator($this->commandData); |
||
31 | $queryGenerator->generate(); |
||
32 | } |
||
33 | |||
34 | if (false === ($this->isSkip('types') or $this->isSkip('graphql_types'))) { |
||
35 | $typeGenerator = new GraphQLTypeGenerator($this->commandData); |
||
36 | $typeGenerator->generate(); |
||
37 | } |
||
38 | |||
39 | if (false === ($this->isSkip('mutations') or $this->isSkip('graphql_mutations'))) { |
||
40 | $mutationGenerator = new GraphQLMutationGenerator($this->commandData); |
||
41 | $mutationGenerator->generate(); |
||
42 | } |
||
43 | |||
44 | if (false === ($this->isSkip('inputs') or $this->isSkip('graphql_inputs'))) { |
||
45 | $mutationGenerator = new GraphQLInputGenerator($this->commandData); |
||
46 | $mutationGenerator->generate(); |
||
47 | } |
||
48 | |||
49 | if ((false === ($this->isSkip('subscription') or $this->isSkip('graphql_subscription'))) and config('pwweb.artomator.options.subscription')) { |
||
50 | $subscriptionGenerator = new GraphQLSubscriptionGenerator($this->commandData); |
||
51 | $subscriptionGenerator->generate(); |
||
52 | } |
||
95 |