diff vendor/symfony/dependency-injection/Container.php @ 12:7a779792577d

Update Drupal core to v8.4.5 (via Composer)
author Chris Cannam
date Fri, 23 Feb 2018 15:52:07 +0000
parents 4c8ae668cc8c
children 1fec387a4317
line wrap: on
line diff
--- a/vendor/symfony/dependency-injection/Container.php	Fri Feb 23 15:51:18 2018 +0000
+++ b/vendor/symfony/dependency-injection/Container.php	Fri Feb 23 15:52:07 2018 +0000
@@ -28,16 +28,6 @@
  *
  * Parameter and service keys are case insensitive.
  *
- * A service id can contain lowercased letters, digits, underscores, and dots.
- * Underscores are used to separate words, and dots to group services
- * under namespaces:
- *
- * <ul>
- *   <li>request</li>
- *   <li>mysql_session_storage</li>
- *   <li>symfony.mysql_session_storage</li>
- * </ul>
- *
  * A service can also be defined by creating a method named
  * getXXXService(), where XXX is the camelized version of the id:
  *
@@ -66,10 +56,14 @@
 
     protected $services = array();
     protected $methodMap = array();
-    protected $privates = array();
     protected $aliases = array();
     protected $loading = array();
 
+    /**
+     * @internal
+     */
+    protected $privates = array();
+
     private $underscoreMap = array('_' => '', '.' => '_', '\\' => '_');
     private $envCache = array();
 
@@ -200,6 +194,10 @@
     public function has($id)
     {
         for ($i = 2;;) {
+            if (isset($this->privates[$id])) {
+                @trigger_error(sprintf('Checking for the existence of the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
+            }
+
             if ('service_container' === $id
                 || isset($this->aliases[$id])
                 || isset($this->services[$id])
@@ -207,10 +205,6 @@
                 return true;
             }
 
-            if (isset($this->privates[$id])) {
-                @trigger_error(sprintf('Checking for the existence of the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
-            }
-
             if (isset($this->methodMap[$id])) {
                 return true;
             }
@@ -256,16 +250,20 @@
         // this method can be called thousands of times during a request, avoid
         // calling strtolower() unless necessary.
         for ($i = 2;;) {
-            if ('service_container' === $id) {
-                return $this;
+            if (isset($this->privates[$id])) {
+                @trigger_error(sprintf('Requesting the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
             }
             if (isset($this->aliases[$id])) {
                 $id = $this->aliases[$id];
             }
+
             // Re-use shared service instance if it exists.
             if (isset($this->services[$id])) {
                 return $this->services[$id];
             }
+            if ('service_container' === $id) {
+                return $this;
+            }
 
             if (isset($this->loading[$id])) {
                 throw new ServiceCircularReferenceException($id, array_keys($this->loading));
@@ -300,9 +298,6 @@
 
                 return;
             }
-            if (isset($this->privates[$id])) {
-                @trigger_error(sprintf('Requesting the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
-            }
 
             $this->loading[$id] = true;
 
@@ -331,14 +326,14 @@
     {
         $id = strtolower($id);
 
+        if (isset($this->aliases[$id])) {
+            $id = $this->aliases[$id];
+        }
+
         if ('service_container' === $id) {
             return false;
         }
 
-        if (isset($this->aliases[$id])) {
-            $id = $this->aliases[$id];
-        }
-
         return isset($this->services[$id]);
     }