| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 62 | 
| Code Lines | 42 | 
| 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  | 
            ||
| 66 | public function validExamples() : iterable  | 
            ||
| 67 |     { | 
            ||
| 68 | yield 'fixture - ClassWithAnnotationTargetAll' => [  | 
            ||
| 69 | ClassWithAnnotationTargetAll::class,  | 
            ||
| 70 | [  | 
            ||
| 71 | AnnotationTargetAllMetadata::get(),  | 
            ||
| 72 | ],  | 
            ||
| 73 |             function (array $result) : void { | 
            ||
| 74 | $this->assertCount(1, $result);  | 
            ||
| 75 | /** @var AnnotationTargetAll $resultAnnotation */  | 
            ||
| 76 | $resultAnnotation = $result[0];  | 
            ||
| 77 | $this->assertInstanceOf(AnnotationTargetAll::class, $resultAnnotation);  | 
            ||
| 78 | $this->assertSame(123, $resultAnnotation->name);  | 
            ||
| 79 | },  | 
            ||
| 80 | ];  | 
            ||
| 81 | |||
| 82 | yield 'fixture - ClassWithFullValidUsageOfAnnotationWithVarType' => [  | 
            ||
| 83 | ClassWithFullValidUsageOfAnnotationWithVarType::class,  | 
            ||
| 84 | [  | 
            ||
| 85 | AnnotationTargetAllMetadata::get(),  | 
            ||
| 86 | AnnotationWithVarTypeMetadata::get(),  | 
            ||
| 87 | ],  | 
            ||
| 88 |             function (array $result) : void { | 
            ||
| 89 | $this->assertCount(1, $result);  | 
            ||
| 90 | /** @var AnnotationWithVarType $resultAnnotation */  | 
            ||
| 91 | $resultAnnotation = $result[0];  | 
            ||
| 92 | $this->assertInstanceOf(AnnotationWithVarType::class, $resultAnnotation);  | 
            ||
| 93 | |||
| 94 | $this->assertNull($resultAnnotation->mixed);  | 
            ||
| 95 | $this->assertTrue($resultAnnotation->boolean);  | 
            ||
| 96 | $this->assertFalse($resultAnnotation->bool);  | 
            ||
| 97 | $this->assertSame(3.14, $resultAnnotation->float);  | 
            ||
| 98 |                 $this->assertSame('foo', $resultAnnotation->string); | 
            ||
| 99 | $this->assertSame(42, $resultAnnotation->integer);  | 
            ||
| 100 | $this->assertSame(['foo', 42, false], $resultAnnotation->array);  | 
            ||
| 101 | $this->assertSame(['foo' => 'bar'], $resultAnnotation->arrayMap);  | 
            ||
| 102 | $this->assertInstanceOf(AnnotationTargetAll::class, $resultAnnotation->annotation);  | 
            ||
| 103 |                 $this->assertSame('baz', $resultAnnotation->annotation->name); | 
            ||
| 104 | $this->assertSame([1,2,3], $resultAnnotation->arrayOfIntegers);  | 
            ||
| 105 | $this->assertSame(['foo', 'bar', 'baz'], $resultAnnotation->arrayOfStrings);  | 
            ||
| 106 | |||
| 107 |                 $this->assertInternalType('array', $resultAnnotation->arrayOfAnnotations); | 
            ||
| 108 | $this->assertCount(2, $resultAnnotation->arrayOfAnnotations);  | 
            ||
| 109 | $this->assertInstanceOf(AnnotationTargetAll::class, $resultAnnotation->arrayOfAnnotations[0]);  | 
            ||
| 110 | $this->assertNull($resultAnnotation->arrayOfAnnotations[0]->name);  | 
            ||
| 111 | $this->assertInstanceOf(AnnotationTargetAll::class, $resultAnnotation->arrayOfAnnotations[1]);  | 
            ||
| 112 | $this->assertSame(123, $resultAnnotation->arrayOfAnnotations[1]->name);  | 
            ||
| 113 | },  | 
            ||
| 114 | ];  | 
            ||
| 115 | |||
| 116 | yield 'fixture - ClassWithAnnotationWithConstants' => [  | 
            ||
| 117 | ClassWithAnnotationWithConstants::class,  | 
            ||
| 118 | [  | 
            ||
| 119 | AnnotationWithConstantsMetadata::get(),  | 
            ||
| 120 | ],  | 
            ||
| 121 |             function (array $result) : void { | 
            ||
| 122 | $this->assertCount(1, $result);  | 
            ||
| 123 | /** @var AnnotationWithConstants $resultAnnotation */  | 
            ||
| 124 | $resultAnnotation = $result[0];  | 
            ||
| 125 | $this->assertInstanceOf(AnnotationWithConstants::class, $resultAnnotation);  | 
            ||
| 126 | |||
| 127 | $this->assertSame(AnnotationWithConstants::FLOAT, $resultAnnotation->value);  | 
            ||
| 128 | },  | 
            ||
| 194 |