[$staticRoutes,
$dynamicRoutes] =
$this->
groupStaticRoutes($routes);
$conditions =
[null
];
$compiledRoutes[] =
$this->
compileStaticRoutes($staticRoutes,
$conditions);
$chunkLimit = \
count($dynamicRoutes);
while (true
) { try { $this->signalingException =
new \
RuntimeException('Compilation failed: regular expression is too large'
);
$compiledRoutes =
array_merge($compiledRoutes,
$this->
compileDynamicRoutes($dynamicRoutes,
$matchHost,
$chunkLimit,
$conditions));
break;
} catch (\Exception
$e) { if (1 <
$chunkLimit &&
$this->signalingException ===
$e) { $chunkLimit = 1 +
($chunkLimit >> 1
);
continue;
} throw $e;
} }