src/BaseValidator.php
protected function validateNot($value, $parsedValue)
    {
        $return = new ValidateResult($parsedValue, true);

        //Check if $this->not is set and it's not null since its optional
        if ($this->not && $this->not !== null) {
            if (!is_subclass_of(
                $this->not,
                BaseValidator::class,
                true
            )) {
                throw new \Exception(sprintf(
                    'Property "not" MUST extend "%s"',
                    BaseValidator::class
                ));
            }

            $validateNot = $this->not->validate($value);

            if ($validateNot->status === true) {
                //Error
                $return->status = false;

                $return->errorObject = new IncorrectParametersException([[
                    'type' => static::getType(),
                    'failure' => 'not'
                ]]);

                return $return;
            }
        }

        return $return;
    }
protected function validateNot($value, $parsedValue)
    {
        $return = new ValidateResult($parsedValue, true);

        //Check if $this->not is set and it's not null since its optional
        if ($this->not && $this->not !== null) {
            if (!is_subclass_of(
                $this->not,
                BaseValidator::class,
                true
            )) {
                throw new \Exception(sprintf(
                    'Property "not" MUST extend "%s"',
                    BaseValidator::class
                ));
            }

            $validateNot = $this->not->validate($value);

            if ($validateNot->status === true) {
                //Error
                $return->status = false;

                $return->errorObject = new IncorrectParametersException([[
                    'type' => static::getType(),
                    'failure' => 'not'
                ]]);

                return $return;
            }
        }

        return $return;
    }
protected function validateNot ( $ value , $ parsedValue ) { $ return = new ValidateResult ( $ parsedValue , true ) ; //Check if $this->not is set and it's not null since its optional if ( $ this -> not && $ this -> not !== null ) { if ( ! is_subclass_of ( $ this -> not , BaseValidator :: class , true ) ) { throw new \ Exception ( sprintf ( 'Property "not" MUST extend "%s"' , BaseValidator :: class ) ) ; } $ validateNot = $ this -> not -> validate ( $ value ) ; if ( $ validateNot -> status === true ) { //Error $ return -> status = false ; $ return -> errorObject = new IncorrectParametersException ( [ [ 'type' => static :: getType ( ) , 'failure' => 'not' ] ] ) ; return $ return ; } } return $ return ; }
Common helper method to validate against "not" keyword
@param  mixed $value Value to validate
@param  mixed $value Parsed value from previous validators
@return ValidateResult
@throws \Exception
Common helper method to validate against not keyword