PagePresenter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A present() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Shoot\Shoot\Tests\Integration\Composition\Presenters;
5
6
use Psr\Http\Message\ServerRequestInterface;
7
use Shoot\Shoot\PresentationModel;
8
use Shoot\Shoot\PresenterInterface;
9
use Shoot\Shoot\Tests\Integration\Composition\Models\Item;
10
11
final class PagePresenter implements PresenterInterface
12
{
13
    /**
14
     * Receives the current HTTP request context and the presentation model assigned to the view. If necessary,
15
     * populates the presentation model with data and returns it.
16
     *
17
     * @param ServerRequestInterface $request
18
     * @param PresentationModel      $presentationModel
19
     *
20
     * @return PresentationModel
21
     */
22
    public function present(ServerRequestInterface $request, PresentationModel $presentationModel): PresentationModel
23
    {
24
        return $presentationModel->withVariables([
25
            'item' => new Item(),
26
        ]);
27
    }
28
}
29