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

shorten getController function #10445

Closed
wants to merge 1 commit into from
Closed

shorten getController function #10445

wants to merge 1 commit into from

Conversation

PabloJoan
Copy link

Please issue pull request against the 3.x-dev branch as the master branch currently represents our 2.X version which is in LTS mode.

Important fixes will be merged into master if needed after it was merged to 3.x-dev.

shorten getController function before it gets out of hand

shorten getController function before it gets out of hand
$controller = $this->createReportMenuController($module, $action, $parameters);
if ($controller) {
return $controller;
foreach(['Plugin', 'Widget', 'Report', 'ReportMenu'] as $controler) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Short array notation is not compatible with PHP 5.3, but Piwik 2.x still is. We can do it that way for Piwik 3.x

@tsteur
Copy link
Member

tsteur commented Aug 30, 2016

@PabloJoan thank you for the PR 👍 I'd personally prefer how it is done currently as it allows us to use refactoring tools in the IDE, auto completion for this functions, "find usage" feature in IDE etc. Not a huge fan of such tweaks while it's shorter it removes readability etc. Not sure what others think

@tsteur tsteur changed the base branch from master to 2.x-dev September 1, 2016 06:36
@mattab mattab closed this Sep 23, 2016
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants