Some refactoring in order to reduce the number of redirects#23
Some refactoring in order to reduce the number of redirects#23bancer wants to merge 13 commits intoProLoser:masterfrom
Conversation
redirects-optimization Conflicts: Controller/Component/WizardComponent.php
| protected function _setCurrentStep($step) { | ||
| if (!in_array($step, $this->steps)) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
I'm not a fan of checks like this. I mean I'd be concerned where they got the step from if it's an invalid choice, this is sort of an error you should never reach.
There was a problem hiding this comment.
I do not remember exactly why that was needed. I think that has something to do with internal workings of this component to prevent setting the future step that is not in $this->steps yet. An infinite loop happened without this check. Notice while (current($this->steps) != $step) below. The clients cannot call _setCurrentStep() directly as it is protected so there is no need to worry.
There was a problem hiding this comment.
That would be the exact reason to leave comments in the code. Otherwise I would take out the code rather than just hiding it under private.
No description provided.