Commit cbeadaff authored by Fabien Potencier's avatar Fabien Potencier

merged branch igorw/provider-param-convention (PR #622)

This PR was merged into the master branch.

Commits
-------

3eaa38cf Clarify provider conventions for params

Discussion
----------

Clarify provider conventions for params

The current conventions for parameters is outdated. At some point we
decided that providers can define default values for params. Therefore
parameters must be registered *after* the extension is registered.

Related commit: 9766faf0
parents 7fe94866 3eaa38cf
...@@ -37,9 +37,13 @@ with providers. Just keep to these rules: ...@@ -37,9 +37,13 @@ with providers. Just keep to these rules:
* Overriding existing services must occur **after** the provider is * Overriding existing services must occur **after** the provider is
registered. registered.
*Reason: If the services already exist, the provider will overwrite it.* *Reason: If the service already exists, the provider will overwrite it.*
* You can set parameters any time before the service is accessed. * You can set parameters any time **after** the provider is registered, but
**before** the service is accessed.
*Reason: Providers can set default values for parameters. Just like with
services, the provider will overwrite existing values.*
Make sure to stick to this behavior when creating your own providers. Make sure to stick to this behavior when creating your own providers.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment