Passed
Push — coverage ( 650341 )
by Arnaud
04:53
created

Entry::getWeight()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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