ExamplesAwareBuilderTrait::buildExamples()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 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