fabpot/Pimple — pull request #83 by fabpot (2013-11-10 17:36:58+00:00)
Title: [2.0] changed services to be shared by default

Now that we have several years of experience using Pimple, I think everyone agrees that having to call `share` everytime you need to define a service is cumbersome. And it is even error-prone when calling `extend` as one needs to call `share` again.

#62 propose a shortcut for the extend use case, but I want to go one step further in Pimple 2.0: remove the need to call `share` altogether.

The reasoning is quite simple: services are 99.9% shared (I don't even have an example for a prototype service).

So, this PR makes closure shared by default. If you need to define a prototype service, call `prototype`.

This change is almost backward compatible as the `share` method is kept as a no-op method. The only BC break is if you have a prototype service in which, you need to wrap it with a `prototype` call.

Of course, Pimple 2.0 will be used in Silex 2.0, which will make things much easier to read and shorter.