1 | <?php |
||
20 | class Point extends AbstractPoint |
||
21 | { |
||
22 | use MagicGet; |
||
23 | |||
24 | /** |
||
25 | * @var integer|null $id Point identification number. |
||
26 | * @var string $label Point label, defaults empty string. |
||
27 | * @var Relation[] $relations Relations array, default is empty. |
||
28 | */ |
||
29 | public $id; |
||
30 | private $label = ''; |
||
31 | private $relations = array(); |
||
32 | |||
33 | /** |
||
34 | * Point constructor. |
||
35 | * |
||
36 | * @param string|null $label Point's label. Defaults null. |
||
37 | */ |
||
38 | public function __construct($label = null) |
||
44 | |||
45 | /** |
||
46 | * Magic method isset. |
||
47 | * |
||
48 | * @param string $name Name of parameter. |
||
49 | * @return boolean Method returns true if parameter exists or false otherwise. |
||
50 | */ |
||
51 | public function __isset($name) |
||
55 | |||
56 | /** |
||
57 | * @param Relation|Point Relation or Point object. |
||
58 | * @param null|integer Distance to point, when first argument is a Point object. |
||
59 | * @return Point $this Reference to the same object. |
||
60 | * @throws PointException Throws exception when arguments aren't match. |
||
61 | */ |
||
62 | public function addDoubleRelation() |
||
87 | |||
88 | /** |
||
89 | * @param Relation|Point Relation or Point object. |
||
90 | * @param null|integer Distance to point, when first argument is a Point object. |
||
91 | * @return Point $this Reference to the same object. |
||
92 | * @throws PointException Throws exception when arguments aren't match. |
||
93 | */ |
||
94 | public function addRelation() |
||
109 | |||
110 | /** |
||
111 | * @param Relation $relation |
||
112 | * @throws PointException |
||
113 | */ |
||
114 | private function addRelationObject(Relation $relation) |
||
122 | |||
123 | /** |
||
124 | * @param Point $point Another Point object to create a bidirectional relationship. |
||
125 | * @param integer $distance Integer value of distance between points. Must be greater than 0. |
||
126 | * @throws PointException |
||
127 | */ |
||
128 | private function addRelationPointDistance(Point $point, $distance) |
||
132 | |||
133 | /** |
||
134 | * @param string $label New Point's label. |
||
135 | * @throws PointException Throws exception when $label is not a string. |
||
136 | */ |
||
137 | public function setLabel($label) |
||
145 | } |
||
146 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.