| 1 | <?php |
||
| 8 | trait GuardTrait |
||
| 9 | { |
||
| 10 | abstract function isEmpty(); |
||
| 11 | |||
| 12 | abstract function count(); |
||
| 13 | |||
| 14 | protected function emptyGuard($method) |
||
| 22 | |||
| 23 | 5 | protected function validateKeyBounds($k) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @param int $element |
||
| 32 | * @return mixed |
||
| 33 | */ |
||
| 34 | 5 | protected function isBoundedKey($element) |
|
| 38 | |||
| 39 | 22 | protected function validateKeyType($element) |
|
| 45 | } |
||
| 46 |
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.