Skip to content

Commit ae9107b

Browse files
afilinaTimWolla
authored andcommitted
Modify autoloader signature per spl_autoload_register docs
https://www.php.net/manual/en/function.spl-autoload-register.php
1 parent d2874c0 commit ae9107b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

phpdotnet/phd/Autoloader.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Autoloader
88
*/
99
private static array $package_dirs = [];
1010

11-
public static function autoload($name)
11+
public static function autoload(string $name): void
1212
{
1313
// Only try autoloading classes we know about (i.e. from our own namespace)
1414
if (strncmp('phpdotnet\phd\\', $name, 14) === 0) {
@@ -24,12 +24,10 @@ public static function autoload($name)
2424
fclose($fp);
2525
require $file;
2626

27-
return false;
27+
return;
2828
}
2929
trigger_error(vsprintf('Cannot find file for %s: %s', [$name, $file ?? $filename]), E_USER_ERROR);
3030
}
31-
32-
return false;
3331
}
3432

3533
/**

0 commit comments

Comments
 (0)