I have a (pretty minor) query about coding style. This in in relation to assigning by reference. By looking at the Moodle code, there are 3 different ways that are used to use whitespaces in such a construction:
- $mform =& $this->_form;
- $mform = & $this->_form;
- $buttonarray[] = &$mform->createElement
I have run it through grep against latest Moodle 2 code - I have included only .php and excluded everything inside the lib directory. The 1st form is the most common: I've found it used 658 times. The other two (2,3) together are much less commonly used: 168 times.
Would everyone here agree that form 1 should be used? It would be nice to get Coding_style page updated with that info as well.
cheers,
Tomasz Muras
Enovation Solutions