src/ValidationField.php
public function addTypeError($value, $type = '') {
        $type = $type ?: $this->getType();

        $this->validation->addError(
            $this->getName(),
            'type',
            [
                'type' => $type,
                'value' => is_scalar($value) ? $value : null,
                'messageCode' => is_scalar($value) ? "{value} is not a valid $type." : "The value is not a valid $type."
            ]
        );

        return $this;
    }
public function addTypeError($value, $type = '') {
        $type = $type ?: $this->getType();

        $this->validation->addError(
            $this->getName(),
            'type',
            [
                'type' => $type,
                'value' => is_scalar($value) ? $value : null,
                'messageCode' => is_scalar($value) ? "{value} is not a valid $type." : "The value is not a valid $type."
            ]
        );

        return $this;
    }
public function addTypeError ( $ value , $ type = '' ) { $ type = $ type ? : $ this -> getType ( ) ; $ this -> validation -> addError ( $ this -> getName ( ) , 'type' , [ 'type' => $ type , 'value' => is_scalar ( $ value ) ? $ value : null , 'messageCode' => is_scalar ( $ value ) ? "{value} is not a valid $type." : "The value is not a valid $type." ] ) ; return $ this ; }
Add an invalid type error.

@param mixed $value The erroneous value.
@param string $type The type that was checked.
@return $this
Add an invalid type error .