Passed
Push — master ( 9dda0c...c240f3 )
by Victor
02:31
created

ItemListPresenter::present()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 2
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Shoot\Shoot\Tests\Fixtures;
5
6
use Shoot\Shoot\Context;
7
use Shoot\Shoot\PresentationModel;
8
use Shoot\Shoot\PresenterInterface;
9
10
final class ItemListPresenter implements PresenterInterface
11
{
12
    /**
13
     * @param Context           $context
14
     * @param PresentationModel $presentationModel
15
     *
16
     * @return PresentationModel
17
     */
18
    public function present(Context $context, PresentationModel $presentationModel): PresentationModel
19
    {
20
        return $presentationModel->withVariables([
21
            'items' => [
22
                new Item([
23
                    'name' => 'item 1',
24
                    'description' => 'description',
25
                ]),
26
                new Item([
27
                    'name' => 'item 2',
28
                    'description' => 'description',
29
                ]),
30
                new Item([
31
                    'name' => 'item 3',
32
                    'description' => 'description',
33
                ]),
34
            ],
35
        ]);
36
    }
37
}
38