• Type: Sub-task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: Coding style
    • Labels:


      Partially motivated by the great blog post by Sam Marshall at and partially motivated by my own experience (recently discussed in September in MDL-42190 peer-review for example), I am proposing the following changes in the

      (A) In the "Wrapping Arrays" section, modify the example so that the => operators are not lined up and remove the mention of it being optional. Put a new note that such an alignment is discouraged. So that the recommended layout is

      $plugininfo['preferences'][$plugin] = array(
          'id' => $plugin, 
          'link' => $pref_url, 
          'string' => $modulenamestr

      (B) Remove the "Wrapping function declarations" section. I do not have many objective arguments against it but I simply do not like it. I believe we should not waste valuable space on the left given the limited line length. Additionally, I suspect that vast majority of the existing code does not follow this style anyway.

      So my proposal is to remove that section or replace it with a note that functions with long list of parameters may be sign of a bad signature design but otherwise the standard wrapping rules apply (that is use 8 spaces for the second and following lines).

      public function graded_users_iterator($course, $grade_items = null,
              $groupid = 0, $sortfield1 = 'lastname', $sortorder1 = 'ASC',
              $sortfield2 = 'firstname', $sortorder2 = 'ASC') {


          Issue Links



              • Votes:
                2 Vote for this issue
                9 Start watching this issue


                • Created: