I have developped an habit of using a return to stop a code sequence from executing, even if the return is used on a function that returns nothing
$form = $this->getForm('activity');
$this->view->form = $form;
return $this->render('create'); // Like this
In Zend Framework it stop the execution of the current action and renders the view which name is the parameter of the function $this->render()
.
I have recently ran PHPMD on my code and all of those statements gets flagged as Void function result used
I was wondering, how bad is this habit and what would be better?