Passed
Push — master ( 8f0f73...d2306b )
by Peter
02:30
created

Ordered   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 27
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getIdentifier() 0 3 1
A build() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Website\Template\Builder\ContentList;
6
7
use AbterPhp\Framework\Template\Data;
8
use AbterPhp\Framework\Template\IBuilder;
9
use AbterPhp\Framework\Template\IData;
10
use AbterPhp\Website\Domain\Entities\ContentList as Entity;
11
12
class Ordered implements IBuilder
13
{
14
    use ItemTrait;
15
16
    const IDENTIFIER = 'ordered';
17
18
    /**
19
     * @return string
20
     */
21
    public function getIdentifier(): string
22
    {
23
        return static::IDENTIFIER;
24
    }
25
26
    /**
27
     * @param Entity $list
28
     *
29
     * @return Data
30
     */
31
    public function build($list): IData
32
    {
33
        $html = $this->buildItems($list, 'ol', 'li');
34
35
        return new Data(
36
            $list->getIdentifier(),
37
            [],
38
            ['body' => $html]
39
        );
40
    }
41
}
42