| Conditions | 4 | 
| Paths | 1 | 
| Total Lines | 78 | 
| Code Lines | 49 | 
| 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  | 
            ||
| 57 | public function docBlocksProvider() : iterable  | 
            ||
| 58 |     { | 
            ||
| 59 | yield 'single without parameters' => [  | 
            ||
| 60 | new Annotations(  | 
            ||
| 61 | new Annotation(  | 
            ||
| 62 |                     new Reference('Foo', true), | 
            ||
| 63 | new Parameters()  | 
            ||
| 64 | )  | 
            ||
| 65 | ),  | 
            ||
| 66 |             function (AnnotationMetadataAssembler $assembler) : void { | 
            ||
| 67 |                 $assembler->method('assemble') | 
            ||
| 68 | ->with(  | 
            ||
| 69 |                         $this->callback(static function (Reference $reference) : bool { | 
            ||
| 70 | return $reference->getIdentifier() === 'Foo' && $reference->isFullyQualified() === true;  | 
            ||
| 71 | }),  | 
            ||
| 72 | $this->isInstanceOf(Scope::class)  | 
            ||
| 73 | )  | 
            ||
| 74 | ->willReturn(new AnnotationMetadata(  | 
            ||
| 75 | 'Foo',  | 
            ||
| 76 | new AnnotationTarget(AnnotationTarget::TARGET_ALL),  | 
            ||
| 77 | false,  | 
            ||
| 78 | []  | 
            ||
| 79 | ));  | 
            ||
| 80 | },  | 
            ||
| 81 |             static function (AnnotationMetadata ...$metadatas) : void { | 
            ||
| 82 | self::assertCount(1, $metadatas);  | 
            ||
| 83 |                 self::assertSame('Foo', $metadatas[0]->getName()); | 
            ||
| 84 | },  | 
            ||
| 85 | ];  | 
            ||
| 86 | yield 'nested' => [  | 
            ||
| 87 | new Annotations(  | 
            ||
| 88 | new Annotation(  | 
            ||
| 89 |                     new Reference('Foo', true), | 
            ||
| 90 | new Parameters(  | 
            ||
| 91 | new UnnamedParameter(  | 
            ||
| 92 | new Annotation(  | 
            ||
| 93 |                                 new Reference('Bar', false), | 
            ||
| 94 | new Parameters()  | 
            ||
| 95 | )  | 
            ||
| 96 | )  | 
            ||
| 97 | )  | 
            ||
| 98 | )  | 
            ||
| 99 | ),  | 
            ||
| 100 |             function (AnnotationMetadataAssembler $assembler) : void { | 
            ||
| 101 |                 $assembler->method('assemble') | 
            ||
| 102 | ->withConsecutive(  | 
            ||
| 103 | [  | 
            ||
| 104 |                             $this->callback(static function (Reference $reference) : bool { | 
            ||
| 105 | return $reference->getIdentifier() === 'Bar' && $reference->isFullyQualified() === false;  | 
            ||
| 106 | }),  | 
            ||
| 107 | $this->isInstanceOf(Scope::class),  | 
            ||
| 108 | ],  | 
            ||
| 109 | [  | 
            ||
| 110 |                             $this->callback(static function (Reference $reference) : bool { | 
            ||
| 111 | return $reference->getIdentifier() === 'Foo' && $reference->isFullyQualified() === true;  | 
            ||
| 112 | }),  | 
            ||
| 113 | $this->isInstanceOf(Scope::class),  | 
            ||
| 114 | ]  | 
            ||
| 115 | )  | 
            ||
| 116 | ->willReturnOnConsecutiveCalls(  | 
            ||
| 117 | new AnnotationMetadata(  | 
            ||
| 118 | 'Bar',  | 
            ||
| 119 | new AnnotationTarget(AnnotationTarget::TARGET_ALL),  | 
            ||
| 120 | false,  | 
            ||
| 121 | []  | 
            ||
| 122 | ),  | 
            ||
| 123 | new AnnotationMetadata(  | 
            ||
| 124 | 'Foo',  | 
            ||
| 125 | new AnnotationTarget(AnnotationTarget::TARGET_ALL),  | 
            ||
| 126 | false,  | 
            ||
| 127 | []  | 
            ||
| 128 | )  | 
            ||
| 129 | );  | 
            ||
| 130 | },  | 
            ||
| 131 |             static function (AnnotationMetadata ...$metadatas) : void { | 
            ||
| 132 | self::assertCount(2, $metadatas);  | 
            ||
| 133 |                 self::assertSame('Bar', $metadatas[0]->getName()); | 
            ||
| 134 |                 self::assertSame('Foo', $metadatas[1]->getName()); | 
            ||
| 135 | },  | 
            ||
| 139 | 
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.