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

Breadcrumbs::items()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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