It is generally recommended to explicitly declare the visibility for methods.
Adding explicit visibility (private, protected, or public) is generally
recommend to communicate to other developers how, and from where this method
is intended to be used.
Loading history...
13
{
14
$this->id = $id;
15
$this->name = $name;
16
$this->tag = $tag;
17
}
18
19
public function setId($id) { $this->id = $id; return $this; }
20
public function getId() { return $this->id; }
21
22
public function setName($name) { $this->name = $name; return $this; }
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.