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

PHP 8.2: Dynamic Properties are deprecated for the third-party lib

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Duplicate
    • Critical
    • None
    • 4.2
    • Libraries
    • MOODLE_402_STABLE
    • MDL-77133-master
    • Hide
      Prerequisite:

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

      Run analysis
      1. Install PHPStan

        composer require --dev phpstan/phpstan
        

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

        php -dmemory_limit=1G vendor/bin/phpstan analyse --configuration phpstan_mdl77133.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 only got the below result:

        Access to an undefined property object::$_elements.                                             
        Access to an undefined property object::$_elements.                                             
        Access to an undefined property object::$_duplicateIndex.

        Those errors come from PHPStan's failure to analyze the code because $_elements and $_duplicateIndex properties are already defined here and here.

      Show
      Prerequisite: The scanning process will consume memory resources. I suggest increasing the memory limit in your PHP.ini to 1G, or more if needed. Run analysis Install PHPStan composer require --dev phpstan/phpstan Download: phpstan_mdl77133.neon and put it into Moodle's root folder. Run the analysis: php -dmemory_limit=1G vendor/bin/phpstan analyse --configuration phpstan_mdl77133.neon -vvv | tee result.txt Search for "Access to an undefined property". grep -i "Access to an undefined property" result.txt  Verify that you only got the below result: Access to an undefined property object::$_elements.                                              Access to an undefined property object::$_elements.                                              Access to an undefined property object::$_duplicateIndex. Those errors come from PHPStan's failure to analyze the code because $_elements and $_duplicateIndex properties are already defined here and here .
    • 10
    • 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 focuses on fixing the dynamic properties deprecation for the third-party libs. The list is as follows:

      Libs requiring updates:

      Lib Status Notes
      adodb Pull request sent.
      bennu   Pull request N/A.
      google    MDL-77374
      htmlpurifier  Pull request N/A.
      lti1p3    MDL-76926
      ltiprovider  Pull request N/A.
      pear  Pull request N/A.
      phpmailer  Pull request N/A.
      h5p Core: Pull request #146 and Pull Request #148 sent
      Editor: Pull request sent 

      Libs confirmed not requiring updates:

      Lib Notes
      emoji-data  
      evalmath  
      geopattern-php  
      horde Fixed on MDL-76089
      html2text  
      http-message  
      jquery  
      markdown  
      maxmind   
      minify  
      mlbackend  
      mustache  
      openspout  
      php-css-parser  
      php-enum  
      php-jwt  
      phpspreadsheet  
      phpxmlrpc  
      plist  
      polyfills  
      requirejs  
      rtlcss  
      scssphp  
      simplepie  
      tcpdf  
      xhprof  
      yuilib  
      zipstream  

      Attachments

        Issue Links

          Activity

            People

              meirza.arson@moodle.com Meirza
              meirza.arson@moodle.com Meirza
              Raquel Ortega Raquel Ortega
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 days, 39 minutes
                  4d 39m

                  Clockify

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