ExceptionHandler.php 380 B

12345678910111213141516171819202122
  1. <?php
  2. namespace PhpOffice\PhpSpreadsheet\Calculation;
  3. class ExceptionHandler
  4. {
  5. /**
  6. * Register errorhandler.
  7. */
  8. public function __construct()
  9. {
  10. set_error_handler([Exception::class, 'errorHandlerCallback'], E_ALL);
  11. }
  12. /**
  13. * Unregister errorhandler.
  14. */
  15. public function __destruct()
  16. {
  17. restore_error_handler();
  18. }
  19. }