private static function RouteCompiler::findNextSeparator

Returns the next static character in the Route pattern that will serve as a separator.

Parameters

string $pattern The route pattern:

Return value

string The next static character that functions as separator (or empty string when none available)

1 call to RouteCompiler::findNextSeparator()
RouteCompiler::compilePattern in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCompiler.php

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCompiler.php, line 183

Class

RouteCompiler
RouteCompiler compiles Route instances to CompiledRoute instances.

Namespace

Symfony\Component\Routing

Code

private static function findNextSeparator($pattern) {
  if ('' == $pattern) {

    // return empty string if pattern is empty or false (false which can be returned by substr)
    return '';
  }

  // first remove all placeholders from the pattern so we can find the next real static character
  $pattern = preg_replace('#\\{\\w+\\}#', '', $pattern);
  return isset($pattern[0]) && false !== strpos(static::SEPARATORS, $pattern[0]) ? $pattern[0] : '';
}