googleapis / google-api-php-client

A PHP client library for accessing Google APIs
Apache License 2.0
9.2k stars 3.52k forks source link

PHP Deprecated: Calling get_class() without arguments is deprecated => change get_class() by __CLASS__ #2525

Closed tovets closed 6 months ago

tovets commented 7 months ago

https://github.com/googleapis/google-api-php-client/blob/7a95ed29e4b6c6859d2d22300c5455a92e2622ad/src/Http/REST.php#L58

qeepcologne commented 7 months ago

php 8.3 related

zachborboa commented 7 months ago
diff --recursive --unified "REST_before.php" "REST_after.php"
--- REST_before.php 2023-12-05 06:28:00.630267395 -0800
+++ REST_after.php  2023-12-05 06:28:15.734536416 -0800
@@ -55,7 +55,7 @@
         $runner = new Runner(
             $config,
             sprintf('%s %s', $request->getMethod(), (string) $request->getUri()),
-            [get_class(), 'doExecute'],
+            [static::class, 'doExecute'],
             [$client, $request, $expectedClass]
         );
parallels999 commented 7 months ago

Maybe

-[get_class(), 'doExecute'],
+[self::class, 'doExecute'],
bshaffer commented 6 months ago

Closing, as this will be fixed in the next release