tickit-project/tickit — pull request #32 by jameshalsall (2013-10-07 20:18:51+00:00)
Title: Refactoring controllers so they are not container aware

Currently all of the controllers extend the base controller from the `FrameworkBundle`, which makes it easier to perform some tasks but then makes it nigh on impossible to unit test controllers.

This PR aims to make controllers service definitions, so they receive their required dependencies at instantiation which allows for easier mocking.

TODO:

- [ ] Refactor all controllers so they are not container aware
- [ ] Create (several) controller helpers that can be injected to reduce code duplication

With reference to the second point above, I think we should probably start off with something like:

- CSRF helper (anything related to csrf tokens)
- Base helper (provides access to the request, domain object decorator etc.)
- Form helper (provides methods for forms)