Passed
Pull Request — 1.x (#13)
by
unknown
43:32 queued 28:34
created

Method   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 12
c 1
b 0
f 0
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 7 1
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