Completed
Push — 2.0 ( d3085d...14a181 )
by Alex
04:58
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
declare(strict_types=1);
3
4
namespace AlexMasterov\EquipTwig\Payload;
5
6
use Equip\Adr\PayloadInterface;
7
8
trait PayloadInterfaceRenderTrait
9
{
10
    /**
11
     * @var PayloadInterface
12
     */
13
    protected $payload;
14
15 1
    protected function render(string $template, array $output = []): PayloadInterface
16
    {
17 1
        return $this->payload
18 1
            ->withStatus(PayloadInterface::STATUS_OK)
19 1
            ->withSetting('template', $template)
20 1
            ->withOutput($output);
21
    }
22
}
23