[phd] master: Modify autoloader signature per spl_autoload_register docs

From: Date: Tue, 21 Oct 2025 17:58:59 +0000
Subject: [phd] master: Modify autoloader signature per spl_autoload_register docs
Groups: php.doc.cvs 
Request: Send a blank email to [email protected] to get a copy of this message
Author: Anna Filina (afilina)
Committer: Tim Düsterhus (TimWolla)
Date: 2025-10-21T19:58:57+02:00

Commit: https://github.com/php/phd/commit/ae9107bcd838d9d45a79e3d45d5233f1056f04b8
Raw diff: https://github.com/php/phd/commit/ae9107bcd838d9d45a79e3d45d5233f1056f04b8.diff

Modify autoloader signature per spl_autoload_register docs

https://www.php.net/manual/en/function.spl-autoload-register.php

Changed paths:
  M  phpdotnet/phd/Autoloader.php


Diff:

diff --git a/phpdotnet/phd/Autoloader.php b/phpdotnet/phd/Autoloader.php
index 66487f92..9ef5d0b8 100644
--- a/phpdotnet/phd/Autoloader.php
+++ b/phpdotnet/phd/Autoloader.php
@@ -8,7 +8,7 @@ class Autoloader
      */
     private static array $package_dirs = [];
 
-    public static function autoload($name)
+    public static function autoload(string $name): void
     {
         // Only try autoloading classes we know about (i.e. from our own namespace)
         if (strncmp('phpdotnet\phd\\', $name, 14) === 0) {
@@ -24,12 +24,10 @@ public static function autoload($name)
                 fclose($fp);
                 require $file;
 
-                return false;
+                return;
             }
             trigger_error(vsprintf('Cannot find file for %s: %s', [$name, $file ??
$filename]), E_USER_ERROR);
         }
-
-        return false;
     }
 
     /**


Thread (1 message)

  • Anna Filina via Tim Düsterhus
« previous php.doc.cvs (#22816) next »