original_string: public static function fromString(string $format)
      {
          if (preg_match('/^(([^-]|--)+)-(([^-]|--)+)-(([^-]|--)+)\.(svg|png|gif|jpg)$/', $format, $match) === false && (7 != count($match))) {
              throw new InvalidArgumentException('The given format string is invalid: '.$format);
          }
  
          $subject = $match[1];
          $status = $match[3];
          $color = $match[5];
          $format = $match[7];
  
          return new self($subject, $status, $color, $format);
      }
code: public static function fromString(string $format)
      {
          if (preg_match('/^(([^-]|--)+)-(([^-]|--)+)-(([^-]|--)+)\.(svg|png|gif|jpg)$/', $format, $match) === false && (7 != count($match))) {
              throw new InvalidArgumentException('The given format string is invalid: '.$format);
          }
  
          $subject = $match[1];
          $status = $match[3];
          $color = $match[5];
          $format = $match[7];
  
          return new self($subject, $status, $color, $format);
      }
code_tokens: public static function fromString ( string $ format ) { if ( preg_match ( '/^(([^-]|--)+)-(([^-]|--)+)-(([^-]|--)+)\.(svg|png|gif|jpg)$/' , $ format , $ match ) === false && ( 7 != count ( $ match ) ) ) { throw new InvalidArgumentException ( 'The given format string is invalid: ' . $ format ) ; } $ subject = $ match [ 1 ] ; $ status = $ match [ 3 ] ; $ color = $ match [ 5 ] ; $ format = $ match [ 7 ] ; return new self ( $ subject , $ status , $ color , $ format ) ; }
docstring: Generates a badge from a string format.
  
  Example: I_m-liuggio-yellow.svg
  
  @param string $format
  
  @return \AltThree\Badger\Badge
docstring_tokens: Generates a badge from a string format .