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

PHP 8.2: Dynamic Properties are deprecated for lib dml

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.2.2
    • 4.3
    • Libraries
    • MOODLE_403_STABLE
    • MOODLE_402_STABLE
    • MDL-78160-master
    • Hide
      Run analysis
      1. Install PHPStan

        composer require --dev phpstan/phpstan
        

      2. Download : phpstan_mdl78160.neon and put the file into Moodle's root folder.
      3. Run the analysis:

        php -dmemory_limit=1G vendor/bin/phpstan analyse --configuration phpstan_mdl78160.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 will have a lot of messages like the below:

        205    Access to an undefined property core\dml_table_test::$tdb.                            
        51     Access to an undefined property core\dml_test::$tdb.  

        We can ignore those false alarms from PHPStan because the $tdb property has been defined in the parent class, database_driver_testcase.

      Other Testing
      1. Run mdk phpunit -r -u lib/dml/tests/dml_read_slave_test.php
      2. Verify the testing is a successful.
      Show
      Run analysis Install PHPStan composer require --dev phpstan/phpstan Download : phpstan_mdl78160.neon and put the file into Moodle's root folder. Run the analysis: php -dmemory_limit=1G vendor/bin/phpstan analyse --configuration phpstan_mdl78160.neon -vvv | tee result.txt Search for "Access to an undefined property". grep -i "Access to an undefined property" result.txt Verify that you will have a lot of messages like the below: 205    Access to an undefined property core\dml_table_test::$tdb.                             51     Access to an undefined property core\dml_test::$tdb. We can ignore those false alarms from PHPStan because the $tdb property has been defined in the parent class, database_driver_testcase. Other Testing Run mdk phpunit -r -u lib/dml/tests/dml_read_slave_test.php Verify the testing is a successful.
    • 1
    • 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

      This issue was created to fix all the PHP files inside the lib/dml folder related to dynamic properties deprecation on PHP 8.2.

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

       

            meirza.arson@moodle.com Meirza
            meirza.arson@moodle.com Meirza
            Raquel Ortega Raquel Ortega
            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 - 4 hours, 5 minutes
                4h 5m

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