Sfoglia il codice sorgente

address PHP 8.5 deprecation

El RIDO 8 mesi fa
parent
commit
6f778eeec3
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      tst/ControllerTest.php

+ 6 - 1
tst/ControllerTest.php

@@ -155,7 +155,12 @@ class ControllerTest extends TestCase
     {
     {
         $newConfig   = new class extends Configuration {};
         $newConfig   = new class extends Configuration {};
         $configValue = (new ReflectionClass(Controller::class))->getProperty('_conf');
         $configValue = (new ReflectionClass(Controller::class))->getProperty('_conf');
-        $configValue->setAccessible(true);
+        if (version_compare(PHP_VERSION, '8.1') < 0) {
+            // > This function has been DEPRECATED as of PHP 8.5.0. [...]
+            // > As of PHP 8.1.0, calling this method has no effect; all properties are accessible by default.
+            // @see: https://www.php.net/manual/en/reflectionproperty.setaccessible.php
+            $configValue->setAccessible(true);
+        }
         ob_start();
         ob_start();
         $controller = new Controller($newConfig);
         $controller = new Controller($newConfig);
         ob_end_clean();
         ob_end_clean();