Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-76411 PHP 8.2: Dynamic Properties are deprecated
  3. MDL-77348

PHP 8.2: Dynamic Properties are deprecated for mod data, glossary, lesson, lti and scorm

    XMLWordPrintable

Details

    • MOODLE_402_STABLE
    • MOODLE_402_STABLE
    • MDL-77348-master
    • Hide
      Prerequisite:

      The scanning process will consume memory resources. I suggest increasing the memory limit in your PHP.ini to 256M, or more if needed.

      Run analysis
      1. Install PHPStan

        composer require --dev phpstan/phpstan
        

      2. Download : phpstan_mdl77348.neon and phpstan3rdparty.neon and put the files into Moodle's root folder.
      3. Run the analysis:

        php -dmemory_limit=256M vendor/bin/phpstan analyse --configuration phpstan_mdl77348.neon -vvv | tee result.txt 

      4. Search for "Access to an undefined property".

        grep -i "Access to an undefined property" result.txt  

      5. Verify that you have an empty result.
      Show
      Prerequisite: The scanning process will consume memory resources. I suggest increasing the memory limit in your PHP.ini to 256M, or more if needed. Run analysis Install PHPStan composer require --dev phpstan/phpstan Download : phpstan_mdl77348.neon and phpstan3rdparty.neon and put the files into Moodle's root folder. Run the analysis: php -dmemory_limit=256M vendor/bin/phpstan analyse --configuration phpstan_mdl77348.neon -vvv | tee result.txt Search for "Access to an undefined property". grep -i "Access to an undefined property" result.txt  Verify that you have an empty result.
    • 2
    • Team Hedgehog Sprint 1 review, Team Hedgehog Sprint 2.1, Team Hedgehog Sprint 2.2, Team Hedgehog 2023 Sprint 1.3, Team Hedgehog 2023 Sprint 1.4, Team Hedgehog 2023 Sprint 2.0, Team Hedgehog 2023 Sprint 2.1, Team Hedgehog 2023 Sprint 2.2

    Description

      This issue was created to fix all the PHP files inside the following folders:

      • mod/data/
      • mod/glossary/
      • mod/lesson/
      • mod/lti/
      • mod/scorm

      related to dynamic properties deprecation on PHP 8.2.

      https://php.watch/versions/8.2/dynamic-properties-deprecated

      Attachments

        1. MDL-77348.png
          68 kB
          Ron Carl Alfon Yu
        2. phpstan_mdl77348.neon
          2 kB
          Meirza
        3. phpstan3rdparty.neon
          3 kB
          Meirza

        Issue Links

          Activity

            People

              meirza.arson@moodle.com Meirza
              meirza.arson@moodle.com Meirza
              Safat Shahin Safat Shahin
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Ron Carl Alfon Yu Ron Carl Alfon Yu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 40 minutes Original Estimate - 40 minutes
                  40m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 1 hour, 24 minutes
                  1d 1h 24m

                  Clockify

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