public static function fromMM($stringData)
    {
        if (!is_string($stringData)) {
            throw new InvalidArgumentException('Given data is not a string');
        }

        if (!preg_match('#^([0-9]+)mm$#', $stringData, $matches)) {
            throw new RuntimeException('Given focal length is not in a valid format. Need: "<number>mm"');
        }

        $numerator = $matches[1];

        return new self(
            "{$numerator}/1"
        );
    }
public static function fromMM($stringData)
    {
        if (!is_string($stringData)) {
            throw new InvalidArgumentException('Given data is not a string');
        }

        if (!preg_match('#^([0-9]+)mm$#', $stringData, $matches)) {
            throw new RuntimeException('Given focal length is not in a valid format. Need: "<number>mm"');
        }

        $numerator = $matches[1];

        return new self(
            "{$numerator}/1"
        );
    }
public static function fromMM ( $ stringData ) { if ( ! is_string ( $ stringData ) ) { throw new InvalidArgumentException ( 'Given data is not a string' ) ; } if ( ! preg_match ( '#^([0-9]+)mm$#' , $ stringData , $ matches ) ) { throw new RuntimeException ( 'Given focal length is not in a valid format. Need: "<number>mm"' ) ; } $ numerator = $ matches [ 1 ] ; return new self ( "{$numerator}/1" ) ; }
Creates new instance with data in milimeter

@param string $stringData

@return FocalLength
Creates new instance with data in milimeter