ErrorContainer.php 552 Bytes
Newer Older
1 2
<?php

3
namespace Drupal\FunctionalTests\Bootstrap;
4 5 6 7 8 9 10 11 12 13 14 15

use Drupal\Core\DependencyInjection\Container;

/**
 * Container base class which triggers an error.
 */
class ErrorContainer extends Container {

  /**
   * {@inheritdoc}
   */
  public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
16 17
    if ($id === 'http_kernel') {
      // Enforce a recoverable error.
18
      $callable = function (ErrorContainer $container) {
19 20 21 22 23 24
      };
      $callable(1);
    }
    else {
      return parent::get($id, $invalidBehavior);
    }
25 26 27
  }

}