Completed
Push — master ( c15104...eb04a4 )
by Dmitry
14:35
created

ExamplesAwareBuilderTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

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\EndpointConfig;
7
use hiapi\endpoints\Exception\EndpointBuildingException;
8
9
/**
10
 * Trait ExamplesAwareBuilderTrait
11
 *
12
 * @author Dmytro Naumenko <[email protected]>
13
 */
14
trait ExamplesAwareBuilderTrait
15
{
16
    /**
17
     * @var array
18
     */
19
    protected $examples;
20
21
    public function withExamples(array $examples)
22
    {
23
        $this->examples = $examples;
24
25
        return $this;
26
    }
27
28
    /**
29
     * @param EndpointConfig $config
30
     * @return $this
31
     * @throws EndpointBuildingException
32
     */
33
    protected function buildExamples(EndpointConfig $config)
34
    {
35
        $config->set('examples', $this->examples);
36
37
        return $this;
38
    }
39
}
40