Access Level to certain class must be public error in PHP
As others have mentioned, you can't make a sub class method more restrictive than the parent; this is because sub classes are supposed to be a valid replacement for their parent class.
In your particular case, I would change the visibility of all methods and properties that start with an underscore to protected
.
You've specify the protected
access to the protected function _addErrors(array $errors)
method of Form_Element_Validators
class. So change it to public.
Edit:
Have you noticed? The sub class method (overridden method) is defined with Type Hinting. Please keep the same parameter type for both; super-class and sub-class method.
abstract class Validator{ public $_errors = array(); abstract public function isValid($input); public function _addErrors(array $message){ $this->_errors = $message; } ....