Completed
Push — master ( 340112...af02a4 )
by Alex
14:15 queued 11:56
created

PayloadInterfaceRenderTrait::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 0
cts 7
cp 0
rs 9.4285
cc 1
eloc 5
nc 1
nop 2
crap 2
1
<?php
2
3
namespace Asmaster\EquipTwig\Traits;
4
5
trait PayloadInterfaceRenderTrait
6
{
7
    /**
8
     * @var \Equip\Adr\PayloadInterface
9
     */
10
    protected $payload;
11
12
    /**
13
     * @param string $template The template name
14
     * @param array  $output   The output produced by the domain layer
15
     *
16
     * @return PayloadInterface
17
     */
18
    protected function render($template, array $output = [])
19
    {
20
        return $this->payload
21
            ->withStatus(PayloadInterface::STATUS_OK)
22
            ->withSetting('template', $template)
23
            ->withOutput($output);
24
    }
25
}
26