Passed
Pull Request — master (#1855)
by Arnaud
08:23 queued 03:10
created

Entry   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
c 0
b 0
f 0
dl 0
loc 54
ccs 15
cts 15
cp 1
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 5 1
A setWeight() 0 5 1
A getWeight() 0 3 1
A setUrl() 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 1
    public function setName(string $value): self
27
    {
28 1
        $this->offsetSet('name', $value);
29
30 1
        return $this;
31
    }
32
33
    /**
34
     * Get menu entry name.
35
     */
36 1
    public function getName(): ?string
37
    {
38 1
        return $this->offsetGet('name');
39
    }
40
41
    /**
42
     * Set the menu entry URL.
43
     */
44 1
    public function setUrl(string $value = null): self
45
    {
46 1
        $this->offsetSet('url', $value);
47
48 1
        return $this;
49
    }
50
51
    /**
52
     * Get menu entry URL.
53
     */
54 1
    public function getUrl(): ?string
55
    {
56 1
        return $this->offsetGet('url');
57
    }
58
59
    /**
60
     * Set menu entry weight.
61
     */
62 1
    public function setWeight(int $value): self
63
    {
64 1
        $this->offsetSet('weight', $value);
65
66 1
        return $this;
67
    }
68
69
    /**
70
     * Get menu entry weight.
71
     */
72 1
    public function getWeight(): ?int
73
    {
74 1
        return $this->offsetGet('weight');
75
    }
76
}
77