namespace Drupal\Component\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\DependencyInjection\IntrospectableContainerInterface;
use Symfony\Component\DependencyInjection\ResettableContainerInterface;
-use Symfony\Component\DependencyInjection\ScopeInterface;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
* getAServiceWithAnIdByCamelCase().
* - The function getServiceIds() was added as it has a use-case in core and
* contrib.
- * - Scopes are explicitly not allowed, because Symfony 2.8 has deprecated
- * them and they will be removed in Symfony 3.0.
- * - Synchronized services are explicitly not supported, because Symfony 2.8 has
- * deprecated them and they will be removed in Symfony 3.0.
*
* @ingroup container
*/
-class Container implements IntrospectableContainerInterface, ResettableContainerInterface {
+class Container implements ContainerInterface, ResettableContainerInterface {
/**
* The parameters of the container.
}
}
- // Share the service if it is public.
- if (!isset($definition['public']) || $definition['public'] !== FALSE) {
- // Forward compatibility fix for Symfony 2.8 update.
- if (!isset($definition['shared']) || $definition['shared'] !== FALSE) {
- $this->services[$id] = $service;
- }
+ if (!isset($definition['shared']) || $definition['shared'] !== FALSE) {
+ $this->services[$id] = $service;
}
if (isset($definition['calls'])) {
/**
* {@inheritdoc}
*/
- public function set($id, $service, $scope = ContainerInterface::SCOPE_CONTAINER) {
- if (!in_array($scope, ['container', 'request']) || ('request' === $scope && 'request' !== $id)) {
- @trigger_error('The concept of container scopes is deprecated since version 2.8 and will be removed in 3.0. Omit the third parameter.', E_USER_DEPRECATED);
- }
-
+ public function set($id, $service) {
$this->services[$id] = $service;
}
return $this->getAlternatives($name, array_keys($this->parameters));
}
-
- /**
- * {@inheritdoc}
- */
- public function enterScope($name) {
- if ('request' !== $name) {
- @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- }
-
- throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__));
- }
-
- /**
- * {@inheritdoc}
- */
- public function leaveScope($name) {
- if ('request' !== $name) {
- @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- }
-
- throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__));
- }
-
- /**
- * {@inheritdoc}
- */
- public function addScope(ScopeInterface $scope) {
-
- $name = $scope->getName();
- if ('request' !== $name) {
- @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- }
- throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__));
- }
-
- /**
- * {@inheritdoc}
- */
- public function hasScope($name) {
- if ('request' !== $name) {
- @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- }
-
- throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__));
- }
-
- /**
- * {@inheritdoc}
- */
- public function isScopeActive($name) {
- @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
-
- throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__));
- }
-
/**
* Gets all defined service IDs.
*
/**
* Ensure that cloning doesn't work.
*/
- private function __clone()
- {
+ private function __clone() {
}
}