The trait Idable provides a method equalsId that in turn relies on the
method getId(). If this method does not exist on a class mixing in this
trait, the method will fail.
Adding the getId() as an abstract method to the trait will make sure it
is available.
The trait Idable provides a method equalsId that in turn relies on the
method getId(). If this method does not exist on a class mixing in this
trait, the method will fail.
Adding the getId() as an abstract method to the trait will make sure it
is available.
Loading history...
42
43
}
44
45
}
46
47
48
49
// Check if the string needed exists
50
if (isset($this->local[$this->language][$index])) {
51
52
// If yes, return it
53
return $this->local[$this->language][$index];
54
55
}
56
57
// Throw an error
58
throw BotException("$index is not set for {$this->language}");
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: