3 namespace Drupal\error_service_test\Controller;
5 use Drupal\Core\Controller\ControllerBase;
6 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
7 use Drupal\error_service_test\LonelyMonkeyClass;
8 use Symfony\Component\DependencyInjection\ContainerInterface;
11 * Provides a controller which calls out to a service with missing dependencies.
13 class LonelyMonkeyController extends ControllerBase implements ContainerInjectionInterface {
15 public function __construct(LonelyMonkeyClass $class) {
16 $this->class = $class;
19 public function testBrokenClass() {
21 '#markup' => $this->t('This should be broken.'),
28 public static function create(ContainerInterface $container) {
29 return new static($container->get('broken_class_with_missing_dependency'));