NamedEndpointBuilderTrait::buildName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
4
namespace hiapi\endpoints\Module\NamedEndpoint;
5
6
use hiapi\endpoints\EndpointConfigurationInterface;
7
8
trait NamedEndpointBuilderTrait
9
{
10
    /**
11
     * @var string
12
     */
13
    protected $name;
14
    /**
15
     * @var string
16
     */
17
    protected $definitionClassName;
18
19
    public function name(string $name)
20
    {
21
        $this->name = $name;
22
23
        return $this;
24
    }
25
26
    public function definedBy(string $className)
27
    {
28
        $this->definitionClassName = $className;
29
30
        return $this;
31
    }
32
33
    protected function buildName(EndpointConfigurationInterface $configuration)
34
    {
35
        $configuration->set('name', $this->name);
36
        $configuration->set('definitionClassName', $this->definitionClassName);
37
    }
38
}
39