private static function splitPath(string $path): array
    {
        if ($path === '') {
            return [];
        }

        $result = explode('/', $path);

        foreach ($result as $pathPart) {
            if ($pathPart === '') {
                throw new InvalidRoutePathException('Path "' . $path . '" contains empty part.');
            }
            if (preg_match('/[^a-zA-Z0-9._-]/', $pathPart, $matches)) {
                throw new InvalidRoutePathException('Path "' . $path . '" contains invalid character "' . $matches[0] . '".');
            }
        }

        return $result;
    }