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

    • Improvement
    • Status: Closed
    • Low
    • Resolution: Fixed
    • Coding style
    • 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 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

              stronk7 Eloy Lafuente (stronk7)
              marina Marina Glancy
              Marina Glancy, Eloy Lafuente (stronk7)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: