src/Model/Version.php
private function toValue($value = null, $count = null)
    {
        if (is_null($value)) {
            $value = $this->value;
        }

        $parts = explode('.', $value);
        if (!is_null($count)) {
            $parts = array_slice($parts, 0, $count);
        }

        $result = $parts[0];

        if (count($parts) > 1) {
            $result .= '.';

            $count = count($parts);
            for ($p = 1; $p < $count; $p++) {
                $result .= substr('0000' . $parts[$p], -4);
            }
        }

        return floatval($result);
    }
private function toValue($value = null, $count = null)
    {
        if (is_null($value)) {
            $value = $this->value;
        }

        $parts = explode('.', $value);
        if (!is_null($count)) {
            $parts = array_slice($parts, 0, $count);
        }

        $result = $parts[0];

        if (count($parts) > 1) {
            $result .= '.';

            $count = count($parts);
            for ($p = 1; $p < $count; $p++) {
                $result .= substr('0000' . $parts[$p], -4);
            }
        }

        return floatval($result);
    }
private function toValue ( $ value = null , $ count = null ) { if ( is_null ( $ value ) ) { $ value = $ this -> value ; } $ parts = explode ( '.' , $ value ) ; if ( ! is_null ( $ count ) ) { $ parts = array_slice ( $ parts , 0 , $ count ) ; } $ result = $ parts [ 0 ] ; if ( count ( $ parts ) > 1 ) { $ result .= '.' ; $ count = count ( $ parts ) ; for ( $ p = 1 ; $ p < $ count ; $ p ++ ) { $ result .= substr ( '0000' . $ parts [ $ p ] , - 4 ) ; } } return floatval ( $ result ) ; }
Convert a version string seperated by dots into a float that can be compared

@internal

@param  string   Version string, with elements seperated by a dot
@param  int      The maximum precision

@return float
Convert a version string seperated by dots into a float that can be compared