ErrorContainer.php 552 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Drupal\FunctionalTests\Bootstrap;
  3. use Drupal\Core\DependencyInjection\Container;
  4. /**
  5. * Container base class which triggers an error.
  6. */
  7. class ErrorContainer extends Container {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
  12. if ($id === 'http_kernel') {
  13. // Enforce a recoverable error.
  14. $callable = function (ErrorContainer $container) {
  15. };
  16. $callable(1);
  17. }
  18. else {
  19. return parent::get($id, $invalidBehavior);
  20. }
  21. }
  22. }