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

Merged
merged 1 commit into from Apr 20, 2015

Conversation

Projects
None yet
1 participant
@mnapoli
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

Merge pull request #252 from mnapoli/simpler-scopes
Simpler scopes: one less Composer dependency and better performances

@mnapoli mnapoli merged commit d624513 into 5.0 Apr 20, 2015

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 referenced this pull request Apr 20, 2015

Merged

v5.0 #200

31 of 31 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment