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

PHP 8.2: Dynamic Properties are deprecated for the Google lib

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Critical Critical
    • 4.2
    • 4.2
    • Libraries
    • MOODLE_402_STABLE
    • MOODLE_402_STABLE
    • MDL-77374-master
    • Hide

      Unfortunately, PHPStan still has an issue detecting classes with the #[AllowDynamicProperties] attribute. So we rely on PHPUnit.

       

      Testing scenario

      1. Run the following PHPUnit test with PHP 8.2:

        mdk phpunit -r -u lib/tests/googlelib_test.php

      2.  Verify that the following PHP deprecated warning has gone (there will be other similar ones, but Google_Service_YouTube::$serviceName shouldn't appear):

        PHP Deprecated:  Creation of dynamic property Google_Service_YouTube::$serviceName is deprecated in /home/meirza/moodle/web/php82/moodle/lib/google/src/Google/Service/YouTube.php on line 87
        R                                                                   1 / 1 (100%)
        Deprecated: Creation of dynamic property Google_Service_YouTube::$serviceName is deprecated in /home/meirza/moodle/web/php82/moodle/lib/google/src/Google/Service/YouTube.php on line 87

      Show
      Unfortunately, PHPStan still has an issue detecting classes with the # [AllowDynamicProperties] attribute. So we rely on PHPUnit.   Testing scenario Run the following PHPUnit test with PHP 8.2: mdk phpunit -r -u lib/tests/googlelib_test.php   Verify that the following PHP deprecated warning has gone (there will be other similar ones, but Google_Service_YouTube::$serviceName shouldn't appear): PHP Deprecated:  Creation of dynamic property Google_Service_YouTube::$serviceName is deprecated in /home/meirza/moodle/web/php82/moodle/lib/google/src/Google/Service/YouTube.php on line 87 R                                                                   1 / 1 ( 100 %) Deprecated: Creation of dynamic property Google_Service_YouTube::$serviceName is deprecated in /home/meirza/moodle/web/php82/moodle/lib/google/src/Google/Service/YouTube.php on line 87
    • 6
    • 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/google/ folder related to dynamic properties deprecation on PHP 8.2.

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

        1. MDL-77374.png
          MDL-77374.png
          233 kB
        2. emptyline.png
          emptyline.png
          19 kB

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

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 4 hours, 25 minutes
                2d 4h 25m

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