Skip to content

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

Merged
mnapoli merged 1 commit into5.0from
simpler-scopes
Apr 20, 2015
Merged

Simpler scopes: one less Composer dependency and better performances#252
mnapoli merged 1 commit into5.0from
simpler-scopes

Conversation

@mnapoli
Copy link
Copy Markdown
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