Passed
Push — master ( 884112...5d70f7 )
by Arnaud
05:32
created

Entry::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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