Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RouteCompiler.php

function RouteCompiler::findNextSeparator

Returns the next static character in the Route pattern that will serve as a separator (or the empty string when none available).

1 call to RouteCompiler::findNextSeparator()
RouteCompiler::compilePattern in vendor/symfony/routing/RouteCompiler.php

File

vendor/symfony/routing/RouteCompiler.php, line 265

Class

RouteCompiler
RouteCompiler compiles Route instances to CompiledRoute instances.

Namespace

Symfony\Component\Routing

Code

private static function findNextSeparator(string $pattern, bool $useUtf8) : string {
    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
    if ('' === ($pattern = preg_replace('#\\{[\\w\\x80-\\xFF]+\\}#', '', $pattern))) {
        return '';
    }
    if ($useUtf8) {
        preg_match('/^./u', $pattern, $pattern);
    }
    return str_contains(static::SEPARATORS, $pattern[0]) ? $pattern[0] : '';
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal