Uploaded image for project: 'Moodle Community Sites'
  1. Moodle Community Sites
  2. MDLSITE-1766

We need coding style guidance for the ternary operator

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: Coding style
    • Labels:
      None

      Description

      a) When its acceptable to use it (is it always acceptable? i've always stayed away from it in Moodle).
      b) What whitespacing should be - e.g. is this ok:

      $params['limit'] = (!empty($CFG->navcourselimit))?$CFG->navcourselimit:20;
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: