Passed
Push — main ( f332df...379075 )
by Thierry
02:57
created

Breadcrumbs   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 39
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A items() 0 3 1
A clear() 0 4 1
A item() 0 4 1
1
<?php
2
3
namespace Lagdo\DbAdmin\Db;
4
5
/**
6
 * Breadcrumbs
7
 */
8
class Breadcrumbs
9
{
10
    /**
11
     * @var array
12
     */
13
    private $items = [];
14
15
    /**
16
     * Get the breadcrumbs items
17
     *
18
     * @return array
19
     */
20
    public function items(): array
21
    {
22
        return $this->items;
23
    }
24
25
    /**
26
     * Clear the breadcrumbs
27
     *
28
     * @return self
29
     */
30
    public function clear(): self
31
    {
32
        $this->items = [];
33
        return $this;
34
    }
35
36
    /**
37
     * Add an item to the breadcrumbs
38
     *
39
     * @param string $label
40
     *
41
     * @return self
42
     */
43
    public function item(string $label): self
44
    {
45
        $this->items[] = $label;
46
        return $this;
47
    }
48
}
49