public function normalize($value)
    {
        if (is_null($value) || $value === '') {
            return;
        }
        if (is_bool($value)) {
            return $value;
        }

        if ($value === $this->valueTrue) {
            return true;
        }

        if ($value === $this->valueFalse) {
            return false;
        }

        if (is_numeric($value)) {
            return (bool) $value;
        }

        throw new ValidationException([$this->name => 'Must be a boolean value']);
    }
public function normalize($value)
    {
        if (is_null($value) || $value === '') {
            return;
        }
        if (is_bool($value)) {
            return $value;
        }

        if ($value === $this->valueTrue) {
            return true;
        }

        if ($value === $this->valueFalse) {
            return false;
        }

        if (is_numeric($value)) {
            return (bool) $value;
        }

        throw new ValidationException([$this->name => 'Must be a boolean value']);
    }
public function normalize ( $ value ) { if ( is_null ( $ value ) || $ value === '' ) { return ; } if ( is_bool ( $ value ) ) { return $ value ; } if ( $ value === $ this -> valueTrue ) { return true ; } if ( $ value === $ this -> valueFalse ) { return false ; } if ( is_numeric ( $ value ) ) { return ( bool ) $ value ; } throw new ValidationException ( [ $ this -> name => 'Must be a boolean value' ] ) ; }
Normalize value to boolean value.

@param mixed $value

@throws ValidationException

@return bool
Normalize value to boolean value .