src/Router/RouteCollector/CachedCollector.php
private function isCacheable($data)
    {
        $cacheable = true;
        array_walk_recursive($data, function ($value) use (&$cacheable) {
                if ($value instanceof \Closure) {
                    $cacheable = false;
                }
            });

        return $cacheable;
    }
private function isCacheable($data)
    {
        $cacheable = true;
        array_walk_recursive($data, function ($value) use (&$cacheable) {
                if ($value instanceof \Closure) {
                    $cacheable = false;
                }
            });

        return $cacheable;
    }
Ensures route data does not contain any Closures

@return bool