src/BaseValidator.php
protected function validateCommon($value, $validateResult)
    {
        //While current status of validation is true,
        //keep validating against common keywords

        //validate against enum using validateEnum
        if ($validateResult->status === true && $this->enum) {
            $validateResult = $this->validateEnum($value, $validateResult->value);

            if ($validateResult->status !== true) {
                //failed to validate against enum
                return $validateResult;
            }
        }

        //validate against not
        if ($validateResult->status === true && $this->not) {
            $validateResult = $this->validateNot($value, $validateResult->value);

            if ($validateResult->status !== true) {
                //failed to validate against not
                return $validateResult;
            }
        }

        return $this->runValidateCallback($validateResult);
    }
protected function validateCommon($value, $validateResult)
    {
        //While current status of validation is true,
        //keep validating against common keywords

        //validate against enum using validateEnum
        if ($validateResult->status === true && $this->enum) {
            $validateResult = $this->validateEnum($value, $validateResult->value);

            if ($validateResult->status !== true) {
                //failed to validate against enum
                return $validateResult;
            }
        }

        //validate against not
        if ($validateResult->status === true && $this->not) {
            $validateResult = $this->validateNot($value, $validateResult->value);

            if ($validateResult->status !== true) {
                //failed to validate against not
                return $validateResult;
            }
        }

        return $this->runValidateCallback($validateResult);
    }
protected function validateCommon ( $ value , $ validateResult ) { //While current status of validation is true, //keep validating against common keywords //validate against enum using validateEnum if ( $ validateResult -> status === true && $ this -> enum ) { $ validateResult = $ this -> validateEnum ( $ value , $ validateResult -> value ) ; if ( $ validateResult -> status !== true ) { //failed to validate against enum return $ validateResult ; } } //validate against not if ( $ validateResult -> status === true && $ this -> not ) { $ validateResult = $ this -> validateNot ( $ value , $ validateResult -> value ) ; if ( $ validateResult -> status !== true ) { //failed to validate against not return $ validateResult ; } } return $ this -> runValidateCallback ( $ validateResult ) ; }
Common helper method to validate against all common keywords
@uses validateEnum
@param  mixed $value Value to validate
@param  ValidateResult $validateResult Current ValidateResult status
@return ValidateResult
Common helper method to validate against all common keywords