Conditions | 1 |
Paths | 1 |
Total Lines | 55 |
Code Lines | 41 |
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 |
||
24 | public static function get(): AnnotationMetadata |
||
25 | { |
||
26 | return new AnnotationMetadata( |
||
27 | AnnotationWithVarType::class, |
||
28 | new AnnotationTarget(AnnotationTarget::TARGET_ALL), |
||
29 | false, |
||
30 | [ |
||
31 | new PropertyMetadata( |
||
32 | 'mixed', |
||
33 | new MixedType(), |
||
34 | true |
||
35 | ), |
||
36 | new PropertyMetadata( |
||
37 | 'boolean', |
||
38 | new BooleanType() |
||
39 | ), |
||
40 | new PropertyMetadata( |
||
41 | 'bool', |
||
42 | new BooleanType() |
||
43 | ), |
||
44 | new PropertyMetadata( |
||
45 | 'float', |
||
46 | new FloatType() |
||
47 | ), |
||
48 | new PropertyMetadata( |
||
49 | 'string', |
||
50 | new StringType() |
||
51 | ), |
||
52 | new PropertyMetadata( |
||
53 | 'integer', |
||
54 | new IntegerType() |
||
55 | ), |
||
56 | new PropertyMetadata( |
||
57 | 'array', |
||
58 | new MapType(new UnionType(new IntegerType(), new StringType()), new MixedType()) |
||
59 | ), |
||
60 | new PropertyMetadata( |
||
61 | 'arrayMap', |
||
62 | new MapType(new StringType(), new MixedType()) |
||
63 | ), |
||
64 | new PropertyMetadata( |
||
65 | 'annotation', |
||
66 | new ObjectType(AnnotationTargetAll::class) |
||
67 | ), |
||
68 | new PropertyMetadata( |
||
69 | 'arrayOfIntegers', |
||
70 | new ListType(new IntegerType()) |
||
71 | ), |
||
72 | new PropertyMetadata( |
||
73 | 'arrayOfStrings', |
||
74 | new ListType(new StringType()) |
||
75 | ), |
||
76 | new PropertyMetadata( |
||
77 | 'arrayOfAnnotations', |
||
78 | new ListType(new ObjectType(AnnotationTargetAll::class)) |
||
79 | ), |
||
84 |