Completed
Push — master ( f63aaf...b18312 )
by Alex
05:51
created

PayloadInterfaceRenderTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 0
dl 0
loc 21
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 7 1
1
<?php
2
3
namespace AlexMasterov\EquipTwig\Traits;
4
5
use Equip\Adr\PayloadInterface;
6
7
trait PayloadInterfaceRenderTrait
8
{
9
    /**
10
     * @var \Equip\Adr\PayloadInterface
11
     */
12
    protected $payload;
13
14
    /**
15
     * @param string $template The template name
16
     * @param array  $output   The output produced by the domain layer
17
     *
18
     * @return PayloadInterface
19
     */
20 1
    protected function render($template, array $output = [])
21
    {
22 1
        return $this->payload
23 1
            ->withStatus(PayloadInterface::STATUS_OK)
24 1
            ->withSetting('template', $template)
25 1
            ->withOutput($output);
26
    }
27
}
28