phpspec/phpspec — pull request #465 by stof (2014-08-19 12:50:42+00:00)
Title: Extracted the container building to a separate class

This extracts the container building into a separate class rather than doing all this code in the Application class. this way, we have a clear separation of responsibilities:

- ContainerAssembler registers all core services
- Application builds the CLI application (customizing the Symfony one).

for now, I kept the parsing of the config file in the Application class as this involves the Input and does not concern core services anymore but registering extensions and user-provided params.

There is technically a small BC break given that the container building methods were protected. However, the only people affected by this BC break are those extending the Application class, which requires changing the phpspec bin script as well, and so is not a supported extension point. any change done by overwriting one of these methods can be done in a supported way by registering an extension to manipulate the container anyway.

Note that similar change was included in https://github.com/jakzal/phpspec/pull/1 which was part of https://github.com/phpspec/phpspec/pull/205 before being reverted as it was making the patch far too big and too difficult to review. The intend was to redo it separately after the merge, but it was never done.

It would be great that this PR is merged quickly to avoid the pain of checking that any change merged in the Application class in the meantime are copied to the ContainerAssembler properly before merging (currently, the code is exactly the same. It is just moved to the other file).