Conditions | 1 |
Paths | 1 |
Total Lines | 59 |
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 |
||
32 | public function visibilityProvider() : array |
||
33 | { |
||
34 | return [ |
||
35 | [ |
||
36 | 'settings' => ['public'], |
||
37 | 'expected' => [ |
||
38 | ApiSpecification::VISIBILITY_PUBLIC => true, |
||
39 | ApiSpecification::VISIBILITY_PROTECTED => false, |
||
40 | ApiSpecification::VISIBILITY_PRIVATE => false, |
||
41 | ApiSpecification::VISIBILITY_INTERNAL => false, |
||
42 | ], |
||
43 | ], |
||
44 | [ |
||
45 | 'settings' => ['protected'], |
||
46 | 'expected' => [ |
||
47 | ApiSpecification::VISIBILITY_PUBLIC => false, |
||
48 | ApiSpecification::VISIBILITY_PROTECTED => true, |
||
49 | ApiSpecification::VISIBILITY_PRIVATE => false, |
||
50 | ApiSpecification::VISIBILITY_INTERNAL => false, |
||
51 | ], |
||
52 | ], |
||
53 | [ |
||
54 | 'settings' => ['private'], |
||
55 | 'expected' => [ |
||
56 | ApiSpecification::VISIBILITY_PUBLIC => false, |
||
57 | ApiSpecification::VISIBILITY_PROTECTED => false, |
||
58 | ApiSpecification::VISIBILITY_PRIVATE => true, |
||
59 | ApiSpecification::VISIBILITY_INTERNAL => false, |
||
60 | ], |
||
61 | ], |
||
62 | [ |
||
63 | 'settings' => ['public', 'private'], |
||
64 | 'expected' => [ |
||
65 | ApiSpecification::VISIBILITY_PUBLIC => true, |
||
66 | ApiSpecification::VISIBILITY_PROTECTED => false, |
||
67 | ApiSpecification::VISIBILITY_PRIVATE => true, |
||
68 | ApiSpecification::VISIBILITY_INTERNAL => false, |
||
69 | ], |
||
70 | ], |
||
71 | [ |
||
72 | 'settings' => ['public', 'internal'], |
||
73 | 'expected' => [ |
||
74 | ApiSpecification::VISIBILITY_PUBLIC => true, |
||
75 | ApiSpecification::VISIBILITY_PROTECTED => false, |
||
76 | ApiSpecification::VISIBILITY_PRIVATE => false, |
||
77 | ApiSpecification::VISIBILITY_INTERNAL => true, |
||
78 | ], |
||
79 | ], |
||
80 | [ |
||
81 | 'settings' => ['internal'], |
||
82 | 'expected' => [ |
||
83 | ApiSpecification::VISIBILITY_PUBLIC => true, |
||
84 | ApiSpecification::VISIBILITY_PROTECTED => true, |
||
85 | ApiSpecification::VISIBILITY_PRIVATE => true, |
||
86 | ApiSpecification::VISIBILITY_INTERNAL => true, |
||
87 | ], |
||
88 | ], |
||
89 | ]; |
||
90 | } |
||
91 | } |
||
92 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.