You are here

class Handle in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Component/Assertion/Handle.php \Drupal\Component\Assertion\Handle

Handler for runtime assertion failures.

@todo Deprecate this class. https://www.drupal.org/node/3054072

Hierarchy

  • class \Drupal\Component\Assertion\Handle

Expanded class hierarchy of Handle

Related topics

3 files declare their use of Handle
bootstrap.php in core/tests/bootstrap.php
Autoloader for Drupal PHPUnit testing.
DrupalKernel.php in core/lib/Drupal/Core/DrupalKernel.php
TestBase.php in core/modules/simpletest/src/TestBase.php

File

core/lib/Drupal/Component/Assertion/Handle.php, line 12

Namespace

Drupal\Component\Assertion
View source
class Handle {

  /**
   * Ensures exceptions are thrown when an assertion fails.
   */
  public static function register() {

    // Since we're using exceptions, turn error warnings off.
    assert_options(ASSERT_WARNING, FALSE);

    // Turn exception throwing on.
    assert_options(ASSERT_EXCEPTION, TRUE);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Handle::register public static function Ensures exceptions are thrown when an assertion fails.