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

Coding style: white spaces around =

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Low Low
    • Coding style
    • None

      Policy: Space before and after the "=" sign

      Note: The original outcome decided in this issue has been completely reverted and left without effect. Please see MDLSITE-7156 for more information about that.

      Strikethrough (invalid) original outcome follows this line:

      Since the 3rd of February 2023, the following coding style policy will be implemented:

      There should be only one blank space before and after the assignment operator "=".

      Good example:
      ...
      ...

      Bad example:
      ...
      ...

      Voting

      Timeframe

      Voting for this issue opens immediately (Thursday 26 January 2023) and will remain open until Friday 3 February 2023 at 12pm UTC.

      Voting options

      The following options are suggested for voting:

      Option A

      In the new code, only one space before and after = sign:

      $forumid = required_param('id', PARAM_INT);
      $userids = optional_param_array('userids', [], PARAM_INT);
      $discussionids = optional_param_array('discids', [], PARAM_INT);
      $from = optional_param_array('from', [], PARAM_INT);
      $to = optional_param_array('to', [], PARAM_INT);
      

      The existing code will not be bulk-updated at this time. Scope-specific changes (methods, classes) will be allowed in related issues.

      Option B

      In the new code, the = should be aligned vertically:

      $action   = required_param('action', PARAM_ALPHA);
      $id       = optional_param('entryid', 0, PARAM_INT);
      $confirm  = optional_param('confirm', 0, PARAM_BOOL);
      

      The existing code will not be bulk-updated at this time. Scope-specific changes (methods, classes) will be allowed in related issues.

      Option C

      No change to the existing coding style. That is to say that both options (A and B) are permitted, though their use should be consistent with the surrounding code.

            Created:
            Updated:
            Resolved:

              Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.