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

Codechecker problems with PHP 7 function return types declaration

    XMLWordPrintable

    Details

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

      Description

      Problem 1:
      When installing local_codechecker locally this is considered correct syntax:

      function xyz(): int {
      

      When sending this code to integration cibot complains about missing space before the ":" example
      Plugins checks using https://github.com/moodlerooms/moodle-plugin-ci are ok with both space and no space

      As Eloy Lafuente (stronk7) suggests this happens because of mismatching phpcs versions that are included in local_ci and local_codechecker

      Problem 2:
      In PHP 7.1 it is possible to define nullable return types

      function xyz(): ?int {
      

      Regardless of spaces this never passes in local_codechecker

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: