Passed
Push — 1.x ( a9995e...5c2b79 )
by Aleksei
12:31
created

Method::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cycle\Schema\Renderer\MermaidRenderer;
6
7
class Method implements Stringable
8
{
9
    private string $name;
10
    private string $target;
11
    private string $abbreviation;
12
13
    public function __construct(string $name, string $target, string $abbreviation)
14
    {
15
        $this->name = $name;
16
        $this->target = $target;
17
        $this->abbreviation = $abbreviation;
18
    }
19
20
    public function __toString(): string
21
    {
22
        return \sprintf(
23
            '%s(%s: %s)',
24
            $this->name,
25
            $this->abbreviation,
26
            $this->target
27
        );
28
    }
29
}
30