Completed
Push — master ( af02a4...b1bd72 )
by Alex
02:31
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 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 5
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Asmaster\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