Completed
Push — master ( da1c4e...70745c )
by Jaap
06:01
created

CustomServiceClass::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace phpDocumentor\Reflection\Assets;
6
7
use phpDocumentor\Reflection\DocBlock\Tag;
8
use phpDocumentor\Reflection\DocBlock\Tags\Formatter;
9
use phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter;
10
use phpDocumentor\Reflection\FqsenResolver;
11
use phpDocumentor\Reflection\DocBlock\Tags\Factory\StaticMethod;
12
13
final class CustomServiceClass implements Tag, StaticMethod
14
{
15
    public $formatter;
16
17
    public function getName() : string
18
    {
19
        return 'spy';
20
    }
21
22
    public static function create($body, PassthroughFormatter $formatter = null)
23
    {
24
        $tag = new self();
25
        $tag->formatter = $formatter;
26
27
        return $tag;
28
    }
29
30
    public function render(?Formatter $formatter = null) : string
31
    {
32
        return $this->getName();
33
    }
34
35
    public function __toString() : string
36
    {
37
        return $this->getName();
38
    }
39
}
40