Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Debug][ErrorHandler] Preserve next error handler
Co-authored-by: Joe <cuchac@email.cz>
- Loading branch information
Showing
4 changed files
with
58 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Symfony/Component/Debug/Tests/Fixtures/ErrorHandlerThatUsesThePreviousOne.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Debug\Tests\Fixtures; | ||
|
||
class ErrorHandlerThatUsesThePreviousOne | ||
{ | ||
private static $previous; | ||
|
||
public static function register() | ||
{ | ||
$handler = new static(); | ||
|
||
self::$previous = set_error_handler([$handler, 'handleError']); | ||
|
||
return $handler; | ||
} | ||
|
||
public function handleError($type, $message, $file, $line, $context) | ||
{ | ||
return \call_user_func(self::$previous, $type, $message, $file, $line, $context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters