class ServiceNotFoundException

This exception is thrown when a non-existent service is requested.

@author Johannes M. Schmitt <schmittjoh@gmail.com>

Hierarchy

Expanded class hierarchy of ServiceNotFoundException

2 files declare their use of ServiceNotFoundException
CheckExceptionOnInvalidReferenceBehaviorPass.php in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php
Container.php in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php, line 19

Namespace

Symfony\Component\DependencyInjection\Exception
View source
class ServiceNotFoundException extends InvalidArgumentException {
  private $id;
  private $sourceId;
  public function __construct($id, $sourceId = null) {
    if (null === $sourceId) {
      $msg = sprintf('You have requested a non-existent service "%s".', $id);
    }
    else {
      $msg = sprintf('The service "%s" has a dependency on a non-existent service "%s".', $sourceId, $id);
    }
    parent::__construct($msg);
    $this->id = $id;
    $this->sourceId = $sourceId;
  }
  public function getId() {
    return $this->id;
  }
  public function getSourceId() {
    return $this->sourceId;
  }

}

Members