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

PayloadInterfaceRenderTrait::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
crap 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