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

Simpler scopes: one less Composer dependency and better performances #252

Merged
merged 1 commit into from
Apr 20, 2015

Conversation

mnapoli
Copy link
Member

@mnapoli mnapoli commented Apr 20, 2015

The internal implementation of scopes has been simplified: this results in one less Composer dependency and better performances. Backward compatibility is kept (static methods still work).

Before:

return [
    'MyClass' => DI\object()
        ->scope(Scope::PROTOTYPE()), // static method
];

After:

return [
    'MyClass' => DI\object()
        ->scope(Scope::PROTOTYPE), // constant
];

This is more inline with PSR-1/PSR-2, more natural (the concept of enum was a bit forced here) and more efficient.

@mnapoli mnapoli added this to the 5.0 milestone Apr 20, 2015
mnapoli added a commit that referenced this pull request Apr 20, 2015
Simpler scopes: one less Composer dependency and better performances
@mnapoli mnapoli merged commit d624513 into 5.0 Apr 20, 2015
@mnapoli mnapoli deleted the simpler-scopes branch April 20, 2015 05:49
@mnapoli mnapoli mentioned this pull request Apr 20, 2015
31 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant