File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed
Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace ErrorHeroModule ;
6+
7+ use RuntimeException ;
8+
9+ class HeroAutoload
10+ {
11+ public static function handle (string $ class )
12+ {
13+ if (\class_exists ($ class )) {
14+ return ;
15+ }
16+
17+ throw new RuntimeException (sprintf (
18+ 'class %s not found ' ,
19+ $ class
20+ ));
21+ }
22+ }
Original file line number Diff line number Diff line change 66
77use Assert \Assertion ;
88use ErrorHeroModule \Handler \Logging ;
9+ use ErrorHeroModule \HeroAutoload ;
910use ErrorHeroModule \HeroTrait ;
1011use Zend \Console \Response as ConsoleResponse ;
1112use Zend \EventManager \AbstractListenerAggregate ;
@@ -56,6 +57,7 @@ public function phpError(MvcEvent $e) : void
5657 {
5758 \register_shutdown_function ([$ this , 'execOnShutdown ' ]);
5859 \set_error_handler ([$ this , 'phpErrorHandler ' ]);
60+ //\spl_autoload_register([HeroAutoload::class, 'handle']);
5961 }
6062
6163 public function exceptionError (MvcEvent $ e ) : void
Original file line number Diff line number Diff line change 77use Closure ;
88use Error ;
99use ErrorHeroModule \Handler \Logging ;
10+ use ErrorHeroModule \HeroAutoload ;
1011use ErrorHeroModule \HeroTrait ;
1112use Exception ;
1213use Psr \Http \Message \ResponseInterface ;
@@ -60,6 +61,7 @@ public function phpError() : void
6061 {
6162 \register_shutdown_function ([$ this , 'execOnShutdown ' ]);
6263 \set_error_handler ([$ this , 'phpErrorHandler ' ]);
64+ //\spl_autoload_register([HeroAutoload::class, 'handle']);
6365 }
6466
6567 /**
You can’t perform that action at this time.
0 commit comments