original_string: private static function expandFilenameBraces($pattern) {
      $result = [];
      if (preg_match(self::BRACE_PATTERN, $pattern, $matches) === 1) {
        $items = explode(",", $matches[2]);
        foreach($items as $match) {
          $str = $matches[1] . $match . $matches[3];
          $exp = static::expandFilenameBraces($str);
          $result = array_merge($result, $exp);
        }
      } else {
        $result[] = $pattern;
      }
      return $result;
    }
code: private static function expandFilenameBraces($pattern) {
      $result = [];
      if (preg_match(self::BRACE_PATTERN, $pattern, $matches) === 1) {
        $items = explode(",", $matches[2]);
        foreach($items as $match) {
          $str = $matches[1] . $match . $matches[3];
          $exp = static::expandFilenameBraces($str);
          $result = array_merge($result, $exp);
        }
      } else {
        $result[] = $pattern;
      }
      return $result;
    }
code_tokens: private static function expandFilenameBraces ( $ pattern ) { $ result = [ ] ; if ( preg_match ( self :: BRACE_PATTERN , $ pattern , $ matches ) === 1 ) { $ items = explode ( "," , $ matches [ 2 ] ) ; foreach ( $ items as $ match ) { $ str = $ matches [ 1 ] . $ match . $ matches [ 3 ] ; $ exp = static :: expandFilenameBraces ( $ str ) ; $ result = array_merge ( $ result , $ exp ) ; } } else { $ result [ ] = $ pattern ; } return $ result ; }
docstring: Expand out any braces in the incomming pattern, acording to shell brace
  rules.
  
  @param $pattern The pattern to expand.
  @return An array where any braces have been expanded.
docstring_tokens: Expand out any braces in the incomming pattern acording to shell brace rules .