Open DaveRandom opened 10 years ago
Looks like their own example is not PSR-4 compliant in that case: https://github.com/php-fig/fig-standards/blob/master/proposed/psr-4-autoloader/psr-4-autoloader-examples.md
Or is it about register()
and unregister()
?
According to their own spec, public function loadClass($class)
should not return false;
(although it is a "should" and not a "must").
ircmaxell pointed out that while return values in SPL registered autoloaders are inspected, their use is redundant - what matters is whether the class is added to the symbol table.
I am going to raise this as an issue with fig, although they'll probably just say "shoud not must, fuck off".
Personally I'd prefer not to logically decide whether I found a class or not - if there's a typo in a class name in a file I loaded, I might think I loaded it but actually I didn't. Better to let PHP determine whether it actually has a usable class definition IMO.
PSR-4 #2.4:
(emphasis mine)