Completed
Push — 2.0 ( d3085d...14a181 )
by Alex
04:58
created

PayloadInterfaceRenderTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
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 15
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
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