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.
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
protected function emptyGuard($method)
15
{
16
if ($this->isEmpty()) {
17
throw new EmptyException(
18
"{$method} cannot be called when the structure is empty"
19
);
20
}
21
}
22
23
5
protected function validateKeyBounds($k)
24
{
25
5
if (!$this->isBoundedKey($k)) {
26
2
throw new \OutOfBoundsException("Integer key $k is out of bounds");
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.