protected function validateItem($key, $value): bool
    {
        // run validators chain
        $result = $this->validators[$key]->validate($value);

        if (!$result) {
            $this->exception->setError($key, $this->validators[$key]->getError());
        }

        return $result;
    }
protected function validateItem($key, $value): bool
    {
        // run validators chain
        $result = $this->validators[$key]->validate($value);

        if (!$result) {
            $this->exception->setError($key, $this->validators[$key]->getError());
        }

        return $result;
    }
protected function validateItem ( $ key , $ value ) : bool { // run validators chain $ result = $ this -> validators [ $ key ] -> validate ( $ value ) ; if ( ! $ result ) { $ this -> exception -> setError ( $ key , $ this -> validators [ $ key ] -> getError ( ) ) ; } return $ result ; }
Validate chain of rules for single item

@param  string $key
@param  mixed  $value

@return bool
Validate chain of rules for single item