Passed
Push — master ( 4e36c0...26f6ea )
by David
01:34
created

PlaceType::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace GGGGino\WarehousePath\Entity;
4
5
abstract class PlaceType
6
{
7
    /**
8
     * An identifier to recognize the node
9
     *
10
     * @var string
11
     */
12
    protected $name;
13
14
    /**
15
     * Original Weight given on instantiation
16
     *
17
     * @var int
18
     */
19
    protected $originalWeight = 0;
20
21
    /**
22
     * Place constructor.
23
     * @param string $name
24
     */
25
    public function __construct($name = "")
26
    {
27
        $this->name = $name;
28
    }
29
30
    public function __toString()
31
    {
32
        return $this->getOriginalWeight();
33
    }
34
35
    /**
36
     * Describe if the place will be walkable or not
37
     *
38
     * @return boolean
39
     */
40
    abstract public function isWalkable();
41
42
    /**
43
     * @return string
44
     */
45
    public function getName()
46
    {
47
        return $this->name;
48
    }
49
50
    /**
51
     * @param string $name
52
     * @return PlaceType
53
     */
54
    public function setName($name)
55
    {
56
        $this->name = $name;
57
        return $this;
58
    }
59
60
    /**
61
     * @return int
62
     */
63
    public function getOriginalWeight()
64
    {
65
        return $this->originalWeight;
66
    }
67
}