ExamplesAwareBuilderTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A withExamples() 0 6 1
A buildExamples() 0 6 1
1
<?php
2
3
4
namespace hiapi\endpoints\Module\InOutControl;
5
6
use hiapi\endpoints\EndpointConfiguration;
7
use hiapi\endpoints\EndpointConfigurationInterface;
8
use hiapi\endpoints\Exception\EndpointBuildingException;
9
10
/**
11
 * Trait ExamplesAwareBuilderTrait
12
 *
13
 * @author Dmytro Naumenko <[email protected]>
14
 */
15
trait ExamplesAwareBuilderTrait
16
{
17
    /**
18
     * @var array
19
     */
20
    protected $examples;
21
22
    public function withExamples(array $examples)
23
    {
24
        $this->examples = $examples;
25
26
        return $this;
27
    }
28
29
    /**
30
     * @param EndpointConfigurationInterface $config
31
     * @return $this
32
     * @throws EndpointBuildingException
33
     */
34
    protected function buildExamples(EndpointConfigurationInterface $config)
35
    {
36
        $config->set('examples', $this->examples);
37
38
        return $this;
39
    }
40
}
41