d430e3b6a708bbd829f6892b7506c7860e76ff18
[yaffs-website] / web / core / modules / system / src / Tests / Bootstrap / ExceptionContainer.php
1 <?php
2
3 namespace Drupal\system\Tests\Bootstrap;
4
5 use Drupal\Core\DependencyInjection\Container;
6
7 /**
8  * Base container which throws an exception.
9  */
10 class ExceptionContainer extends Container {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
16     if ($id === 'http_kernel') {
17       throw new \Exception('Thrown exception during Container::get');
18     }
19     else {
20       return parent::get($id, $invalidBehavior);
21     }
22   }
23
24 }