Passed
Push — master ( 20ba69...1ea7e6 )
by Victor
47s queued 11s
created

LayoutPresenter::present()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Shoot\Shoot\Tests\Integration\Embedding\Presenters;
5
6
use Psr\Http\Message\ServerRequestInterface;
7
use Shoot\Shoot\PresentationModel;
8
use Shoot\Shoot\PresenterInterface;
9
10
final class LayoutPresenter implements PresenterInterface
11
{
12
    /**
13
     * Receives the current HTTP request context and the presentation model assigned to the view. If necessary,
14
     * populates the presentation model with data and returns it.
15
     *
16
     * @param ServerRequestInterface $request
17
     * @param PresentationModel      $presentationModel
18
     *
19
     * @return PresentationModel
20
     */
21
    public function present(ServerRequestInterface $request, PresentationModel $presentationModel): PresentationModel
22
    {
23
        return $presentationModel->withVariables([
24
            'links' => [
25
                'Home' => '/',
26
            ],
27
        ]);
28
    }
29
}
30