Handle.php 511 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Drupal\Component\Assertion;
  3. /**
  4. * Handler for runtime assertion failures.
  5. *
  6. * @ingroup php_assert
  7. *
  8. * @todo Deprecate this class. https://www.drupal.org/node/3054072
  9. */
  10. class Handle {
  11. /**
  12. * Ensures exceptions are thrown when an assertion fails.
  13. */
  14. public static function register() {
  15. // Since we're using exceptions, turn error warnings off.
  16. assert_options(ASSERT_WARNING, FALSE);
  17. // Turn exception throwing on.
  18. assert_options(ASSERT_EXCEPTION, TRUE);
  19. }
  20. }