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 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 the enhancement label Apr 20, 2015
@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
4 checks passed
4 checks passed
Scrutinizer 1 new issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.1%) to 86.65%
Details
@mnapoli mnapoli deleted the simpler-scopes branch Apr 20, 2015
@mnapoli mnapoli mentioned this pull request Apr 20, 2015
31 of 31 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.