Passed
Push — menu ( d2268d )
by Arnaud
04:15
created

Entry   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 81.82%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 54
ccs 9
cts 11
cp 0.8182
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setWeight() 0 5 1
A getWeight() 0 3 1
A setUrl() 0 5 1
A setName() 0 5 1
A getUrl() 0 3 1
A getName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Cecil.
7
 *
8
 * Copyright (c) Arnaud Ligny <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Cecil\Collection\Menu;
15
16
use Cecil\Collection\Item;
17
18
/**
19
 * Class Entry.
20
 */
21
class Entry extends Item
22
{
23
    /**
24
     * Set the menu entry name.
25
     */
26
    public function setName(string $value): self
27 1
    {
28
        $this->offsetSet('name', $value);
29 1
30
        return $this;
31 1
    }
32
33
    /**
34
     * Get menu entry name.
35
     */
36
    public function getName(): ?string
37
    {
38
        return $this->offsetGet('name');
39
    }
40
41 1
    /**
42
     * Set the menu entry URL.
43 1
     */
44
    public function setUrl(string $value = null): self
45 1
    {
46
        $this->offsetSet('url', $value);
47
48
        return $this;
49
    }
50
51
    /**
52
     * Get menu entry URL.
53
     */
54
    public function getUrl(): ?string
55 1
    {
56
        return $this->offsetGet('url');
57 1
    }
58
59 1
    /**
60
     * Set menu entry weight.
61
     */
62
    public function setWeight(int $value): self
63
    {
64
        $this->offsetSet('weight', $value);
65
66
        return $this;
67
    }
68
69
    /**
70
     * Get menu entry weight.
71
     */
72
    public function getWeight(): ?int
73
    {
74
        return $this->offsetGet('weight');
75
    }
76
}
77