Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-8043

Ensure that whitespace rules about function hinted return types and params are enforced

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Deferred
    • Affects Version/s: 3.9
    • Fix Version/s: None
    • Component/s: Local: Code checker
    • Labels:
      None
    • Affected Branches:
      MOODLE_39_STABLE

      Description

      From MDLSITE-5667:

      Policy: Function/methods whitespace rules about return types and nullables

      Since 02nd April 2020, this has been agreed:

      (matching the PSR-12)

      1) No whitespace between the nullable character (question mark -?) and params or return types.
      2) No whitespace between the function closing brackets and the colon.

      With an image speaking a thousand words. Correct:

      public function foo(string $bar, ?int $baz): ?bool {}
      

      This issue is about to verify those 2 details in the codechecker. Nothing more, nothing less.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              moodle.com moodle.com
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              moodle.com, Eloy Lafuente (stronk7)
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: