Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-77599

Replace all @const uses in core documenting constants by @var

XMLWordPrintable

    • MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_403_STABLE
    • Hide
      1. Run any of this with the patch applied:
      • rg '@const' -t php
      • ag '@const' --php
      • grep -r '@const ' --include '*.php'
      1. Verify that they return no results, meaning that all the cases in core have been changed.
      2. Verify that CiBoT is passing ok in this issue, meaning that all the new @var uses are correct.
      Show
      Run any of this with the patch applied: rg '@const' -t php ag '@const' --php grep -r '@const ' --include '*.php' Verify that they return no results, meaning that all the cases in core have been changed. Verify that CiBoT is passing ok in this issue, meaning that all the new @var uses are correct.

      Curiously, @const is not a valid PHPDoc tag.

      Link: https://docs.phpdoc.org/3.0/guide/references/phpdoc/tags/var.html

      Some more sources about to using @var instead:

      So all current uses of @const in core (our code) should be moved to @var [type] description instead.

      There are a few uses to fix:

      $ ag '@const' --php | wc -l
      37
      

      So this issue is about to:

      • Fix all current @const uses in core (excluding 3rd part libs).
      • PR#110 - Ensure that local_moodlechecker detects wrong uses.
      • PR#673 - Amend the coding style, so it matches the FIG/PHPDoc.

      Ciao

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Paul Holden Paul Holden
            Andrew Lyons Andrew Lyons
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 20 minutes
                2h 20m

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