Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move factories to be plain protected closures which return a cache #7

Open
CHH opened this issue Nov 22, 2016 · 0 comments
Open

Move factories to be plain protected closures which return a cache #7

CHH opened this issue Nov 22, 2016 · 0 comments
Milestone

Comments

@CHH
Copy link
Owner

CHH commented Nov 22, 2016

Currently the cache.factory and the cache.namespace services are protected closures, which return closures, which then return a cache instance. Change these services to be just protected closures, which return a cache instance to reduce complexity and bring it in line with conventions.

Before:

$app['caches'] = $app->extend('caches', function ($caches) use ($app) {
    $caches['foo'] = $app['cache.namespace']('foobar');
    return $caches;
});

After:

$app['caches'] = $app->extend('caches', function ($caches) use ($app) {
    $caches['foo'] = function () use ($app) {
        return $app['cache.namespace']('foobar');
    };
    return $caches;
});
@CHH CHH added this to the v3.0.0 milestone Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant