47 if ( !is_string( $version ) ) {
48 throw new InvalidArgumentException(
'$version must be a string' );
51 $dashPosition = strpos( $version,
'-' );
53 if ( $dashPosition !==
false ) {
54 $suffix = substr( $version, $dashPosition );
55 $version = substr( $version, 0, $dashPosition );
58 $version = implode(
'.', array_pad( explode(
'.', $version ), 4,
'0' ) );
60 if ( $dashPosition !==
false ) {