original_string: public static function extensions($extensions = null, $merge = true)
      {
          $collection = static::$_collection;
          if ($extensions === null) {
              if (!static::$initialized) {
                  static::_loadRoutes();
              }
  
              return array_unique(array_merge(static::$_defaultExtensions, $collection->getExtensions()));
          }
          $extensions = (array)$extensions;
          if ($merge) {
              $extensions = array_unique(array_merge(static::$_defaultExtensions, $extensions));
          }
  
          return static::$_defaultExtensions = $extensions;
      }
code: public static function extensions($extensions = null, $merge = true)
      {
          $collection = static::$_collection;
          if ($extensions === null) {
              if (!static::$initialized) {
                  static::_loadRoutes();
              }
  
              return array_unique(array_merge(static::$_defaultExtensions, $collection->getExtensions()));
          }
          $extensions = (array)$extensions;
          if ($merge) {
              $extensions = array_unique(array_merge(static::$_defaultExtensions, $extensions));
          }
  
          return static::$_defaultExtensions = $extensions;
      }
code_tokens: public static function extensions ( $ extensions = null , $ merge = true ) { $ collection = static :: $ _collection ; if ( $ extensions === null ) { if ( ! static :: $ initialized ) { static :: _loadRoutes ( ) ; } return array_unique ( array_merge ( static :: $ _defaultExtensions , $ collection -> getExtensions ( ) ) ) ; } $ extensions = ( array ) $ extensions ; if ( $ merge ) { $ extensions = array_unique ( array_merge ( static :: $ _defaultExtensions , $ extensions ) ) ; } return static :: $ _defaultExtensions = $ extensions ; }
docstring: Get or set valid extensions for all routes connected later.
  
  Instructs the router to parse out file extensions
  from the URL. For example, http://example.com/posts.rss would yield a file
  extension of "rss". The file extension itself is made available in the
  controller as `$this->request->getParam('_ext')`, and is used by the RequestHandler
  component to automatically switch to alternate layouts and templates, and
  load helpers corresponding to the given content, i.e. RssHelper. Switching
  layouts and helpers requires that the chosen extension has a defined mime type
  in `Cake\Http\Response`.
  
  A string or an array of valid extensions can be passed to this method.
  If called without any parameters it will return current list of set extensions.
  
  @param array|string|null $extensions List of extensions to be added.
  @param bool $merge Whether to merge with or override existing extensions.
  Defaults to `true`.
  @return array Array of extensions Router is configured to parse.
docstring_tokens: Get or set valid extensions for all routes connected later .