Arcanedev\Localization\Utilities\Url::hasAttributesFromUriPath PHP Method

hasAttributesFromUriPath() private static method

Check if has attributes from a route.
private static hasAttributesFromUriPath ( array $url, string $path, array &$attributes ) : boolean
$url array
$path string
$attributes array
return boolean
    private static function hasAttributesFromUriPath($url, $path, &$attributes)
    {
        $i = 0;
        $match = true;
        $path = explode('/', $path);
        foreach ($path as $j => $segment) {
            if (isset($url[$i])) {
                if ($segment !== $url[$i]) {
                    self::extractAttributesFromSegment($url, $path, $i, $j, $segment, $attributes);
                }
                $i++;
                continue;
            } elseif (!preg_match('/{[\\w]+\\?}/', $segment)) {
                // No optional parameters but no more $url given this route does not match the url
                $match = false;
                break;
            }
        }
        if (isset($url[$i + 1])) {
            $match = false;
        }
        return $match;
    }