File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 88
99class HeroAutoload
1010{
11- public static function handle (string $ class )
11+ public static function handle (string $ classOrTraitOrInterface )
1212 {
13- if (\class_exists ($ class , false )) {
14- return ;
15- }
16-
1713 $ debugBacktrace = \debug_backtrace ();
1814 if (
1915 isset ($ debugBacktrace [1 ]['function ' ], $ debugBacktrace [2 ]['function ' ]) &&
2016 $ debugBacktrace [1 ]['function ' ] === 'spl_autoload_call ' &&
2117 (
22- $ debugBacktrace [2 ]['function ' ] === 'class_exists ' || $ debugBacktrace [2 ]['function ' ] === 'interface_exists '
18+ $ debugBacktrace [2 ]['function ' ] === 'class_exists ' ||
19+ $ debugBacktrace [2 ]['function ' ] === 'trait_exists ' ||
20+ $ debugBacktrace [2 ]['function ' ] === 'interface_exists '
2321 )
2422 ) {
2523 return ;
2624 }
2725
2826 throw new RuntimeException (sprintf (
29- 'class %s not found ' ,
30- $ class
27+ 'class or trait or interface %s not found ' ,
28+ $ classOrTraitOrInterface
3129 ));
3230 }
3331}
You can’t perform that action at this time.
0 commit comments