[DOC-CVS] [phd] master: Modify autoloader signature per spl_autoload_register docs

[email protected] (Anna Filina via Tim Düsterhus)
Newsgroups php.doc.cvs
Message-ID <[email protected]>
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;
     }
 
     /**
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.