File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -22,18 +22,21 @@ trait HeroTrait
2222 /** @var string */
2323 private $ result = '' ;
2424
25+ private static function isUncaught (array $ error )
26+ {
27+ return 0 === strpos ($ error ['message ' ], 'Uncaught ' );
28+ }
29+
2530 public function phpFatalErrorHandler ($ buffer ): string
2631 {
2732 $ error = \error_get_last ();
2833 if (! $ error ) {
2934 return $ buffer ;
3035 }
3136
32- if (0 === strpos ($ error ['message ' ], 'Uncaught ' )) {
33- return $ buffer ;
34- }
35-
36- return $ this ->result === '' ? $ buffer : $ this ->result ;
37+ return self ::isUncaught ($ error ) || $ this ->result === ''
38+ ? $ buffer
39+ : $ this ->result ;
3740 }
3841
3942 public function execOnShutdown () : void
@@ -43,7 +46,7 @@ public function execOnShutdown() : void
4346 return ;
4447 }
4548
46- if (0 === strpos ($ error[ ' message ' ], ' Uncaught ' )) {
49+ if (self :: isUncaught ($ error )) {
4750 return ;
4851 }
4952
You can’t perform that action at this time.
0 commit comments