Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FrontController refactoring #7361

Merged
merged 5 commits into from Mar 10, 2015
Merged

FrontController refactoring #7361

merged 5 commits into from Mar 10, 2015

Conversation

mnapoli
Copy link
Contributor

@mnapoli mnapoli commented Mar 4, 2015

This is a small refactoring: I have extracted code from the FrontController in order to simplify it.

I have followed Symfony's architecture by putting the code responsible to create the controllers in a ControllerResolver class. A controller is now a simple callable in the front controller.

Also that's minor but the report/widget classes where created 2-3 times, now there are created only once. I think in the future the Widget::factory()/Report::factory() static methods could be moved to the ControllerResolver so that widget and report classes are created by the container: that would allow to use dependency injection in them.

(if you want to see the diff, I think seeing each commit diff separately is easier)

@mattab mattab added this to the Piwik 2.12.0 milestone Mar 4, 2015
@mattab mattab added the Needs Review PRs that need a code review label Mar 4, 2015
@mattab
Copy link
Member

mattab commented Mar 4, 2015

(adding Needs review label and milestone to 2.12.0)

@mnapoli
Copy link
Contributor Author

mnapoli commented Mar 10, 2015

No comments, merging

mnapoli added a commit that referenced this pull request Mar 10, 2015
@mnapoli mnapoli merged commit 4026bc9 into master Mar 10, 2015
@mnapoli mnapoli added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. and removed Needs Review PRs that need a code review labels Mar 10, 2015
@mnapoli mnapoli deleted the frontcontroller-refactoring branch March 10, 2015 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants