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

Codechecker problems with PHP 7 function return types declaration


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

      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

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


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