public function parseValue($value)
    {
        $nullable = ($this->flags & self::NULLABLE);

        if ($this->flags & self::BOOLEAN) {
            return StringUtil::parseBoolean($value, $nullable);
        }

        if ($this->flags & self::INTEGER) {
            return StringUtil::parseInteger($value, $nullable);
        }

        if ($this->flags & self::FLOAT) {
            return StringUtil::parseFloat($value, $nullable);
        }

        return StringUtil::parseString($value, $nullable);
    }
public function parseValue($value)
    {
        $nullable = ($this->flags & self::NULLABLE);

        if ($this->flags & self::BOOLEAN) {
            return StringUtil::parseBoolean($value, $nullable);
        }

        if ($this->flags & self::INTEGER) {
            return StringUtil::parseInteger($value, $nullable);
        }

        if ($this->flags & self::FLOAT) {
            return StringUtil::parseFloat($value, $nullable);
        }

        return StringUtil::parseString($value, $nullable);
    }
public function parseValue ( $ value ) { $ nullable = ( $ this -> flags & self :: NULLABLE ) ; if ( $ this -> flags & self :: BOOLEAN ) { return StringUtil :: parseBoolean ( $ value , $ nullable ) ; } if ( $ this -> flags & self :: INTEGER ) { return StringUtil :: parseInteger ( $ value , $ nullable ) ; } if ( $ this -> flags & self :: FLOAT ) { return StringUtil :: parseFloat ( $ value , $ nullable ) ; } return StringUtil :: parseString ( $ value , $ nullable ) ; }
Parses an option value.

Pass one of the flags {@link STRING}, {@link BOOLEAN}, {@link INTEGER}
and {@link FLOAT} to the constructor to configure the result of this
method. You can optionally combine the flags with {@link NULLABLE} to
support the conversion of "null" to `null`.

@param mixed $value The value to parse.

@return mixed The parsed value.

@throws InvalidValueException
Parses an option value .