public static function fromURI($URI)
    {
        $regex = '/^(([^-]|--)+)-(([^-]|--)+)-(([^-]|--)+)\.(svg|png|gif|jpg)$/';
        $match = array();

        if (1 != preg_match($regex, $URI, $match) && (7 != count($match))) {
            throw new \InvalidArgumentException('The URI given is not a valid URI'.$URI);
        }

        $subject = $match[1];
        $status  = $match[3];
        $color   = $match[5];
        $format  = $match[7];

        return new self($subject, $status, $color, $format);
    }
public static function fromURI($URI)
    {
        $regex = '/^(([^-]|--)+)-(([^-]|--)+)-(([^-]|--)+)\.(svg|png|gif|jpg)$/';
        $match = array();

        if (1 != preg_match($regex, $URI, $match) && (7 != count($match))) {
            throw new \InvalidArgumentException('The URI given is not a valid URI'.$URI);
        }

        $subject = $match[1];
        $status  = $match[3];
        $color   = $match[5];
        $format  = $match[7];

        return new self($subject, $status, $color, $format);
    }
public static function fromURI ( $ URI ) { $ regex = '/^(([^-]|--)+)-(([^-]|--)+)-(([^-]|--)+)\.(svg|png|gif|jpg)$/' ; $ match = array ( ) ; if ( 1 != preg_match ( $ regex , $ URI , $ match ) && ( 7 != count ( $ match ) ) ) { throw new \ InvalidArgumentException ( 'The URI given is not a valid URI' . $ URI ) ; } $ subject = $ match [ 1 ] ; $ status = $ match [ 3 ] ; $ color = $ match [ 5 ] ; $ format = $ match [ 7 ] ; return new self ( $ subject , $ status , $ color , $ format ) ; }
Factory method the creates a Badge from an URI
eg. I_m-liuggio-yellow.svg

@param string $URI

@return Badge
@throws \InvalidArgumentException
Factory method the creates a Badge from an URI eg . I_m - liuggio - yellow . svg