NamedEndpointBuilderTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 6 1
A definedBy() 0 6 1
A buildName() 0 5 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