Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / dependency-injection / Definition.php
index 7781220a97fec3b04542b705d944154490fb81a4..aee2edb81debf8dda388d0312c4bbea606a3ac4c 100644 (file)
@@ -24,13 +24,9 @@ class Definition
     private $class;
     private $file;
     private $factory;
-    private $factoryClass;
-    private $factoryMethod;
-    private $factoryService;
     private $shared = true;
     private $deprecated = false;
     private $deprecationTemplate;
-    private $scope = ContainerInterface::SCOPE_CONTAINER;
     private $properties = array();
     private $calls = array();
     private $configurator;
@@ -38,7 +34,6 @@ class Definition
     private $public = true;
     private $synthetic = false;
     private $abstract = false;
-    private $synchronized = false;
     private $lazy = false;
     private $decoratedService;
     private $autowired = false;
@@ -86,59 +81,6 @@ class Definition
         return $this->factory;
     }
 
-    /**
-     * Sets the name of the class that acts as a factory using the factory method,
-     * which will be invoked statically.
-     *
-     * @param string $factoryClass The factory class name
-     *
-     * @return $this
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function setFactoryClass($factoryClass)
-    {
-        @trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', __METHOD__, $factoryClass), E_USER_DEPRECATED);
-
-        $this->factoryClass = $factoryClass;
-
-        return $this;
-    }
-
-    /**
-     * Gets the factory class.
-     *
-     * @return string|null The factory class name
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function getFactoryClass($triggerDeprecationError = true)
-    {
-        if ($triggerDeprecationError) {
-            @trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
-        }
-
-        return $this->factoryClass;
-    }
-
-    /**
-     * Sets the factory method able to create an instance of this class.
-     *
-     * @param string $factoryMethod The factory method name
-     *
-     * @return $this
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function setFactoryMethod($factoryMethod)
-    {
-        @trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', __METHOD__, $factoryMethod), E_USER_DEPRECATED);
-
-        $this->factoryMethod = $factoryMethod;
-
-        return $this;
-    }
-
     /**
      * Sets the service that this service is decorating.
      *
@@ -153,7 +95,7 @@ class Definition
     public function setDecoratedService($id, $renamedId = null, $priority = 0)
     {
         if ($renamedId && $id == $renamedId) {
-            throw new \InvalidArgumentException(sprintf('The decorated service inner name for "%s" must be different than the service name itself.', $id));
+            throw new InvalidArgumentException(sprintf('The decorated service inner name for "%s" must be different than the service name itself.', $id));
         }
 
         if (null === $id) {
@@ -175,58 +117,6 @@ class Definition
         return $this->decoratedService;
     }
 
-    /**
-     * Gets the factory method.
-     *
-     * @return string|null The factory method name
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function getFactoryMethod($triggerDeprecationError = true)
-    {
-        if ($triggerDeprecationError) {
-            @trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
-        }
-
-        return $this->factoryMethod;
-    }
-
-    /**
-     * Sets the name of the service that acts as a factory using the factory method.
-     *
-     * @param string $factoryService The factory service id
-     *
-     * @return $this
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function setFactoryService($factoryService, $triggerDeprecationError = true)
-    {
-        if ($triggerDeprecationError) {
-            @trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', __METHOD__, $factoryService), E_USER_DEPRECATED);
-        }
-
-        $this->factoryService = $factoryService;
-
-        return $this;
-    }
-
-    /**
-     * Gets the factory service id.
-     *
-     * @return string|null The factory service id
-     *
-     * @deprecated since version 2.6, to be removed in 3.0.
-     */
-    public function getFactoryService($triggerDeprecationError = true)
-    {
-        if ($triggerDeprecationError) {
-            @trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
-        }
-
-        return $this->factoryService;
-    }
-
     /**
      * Sets the service class.
      *
@@ -572,46 +462,6 @@ class Definition
         return $this->shared;
     }
 
-    /**
-     * Sets the scope of the service.
-     *
-     * @param string $scope Whether the service must be shared or not
-     *
-     * @return $this
-     *
-     * @deprecated since version 2.8, to be removed in 3.0.
-     */
-    public function setScope($scope, $triggerDeprecationError = true)
-    {
-        if ($triggerDeprecationError) {
-            @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
-        }
-
-        if (ContainerInterface::SCOPE_PROTOTYPE === $scope) {
-            $this->setShared(false);
-        }
-
-        $this->scope = $scope;
-
-        return $this;
-    }
-
-    /**
-     * Returns the scope of the service.
-     *
-     * @return string
-     *
-     * @deprecated since version 2.8, to be removed in 3.0.
-     */
-    public function getScope($triggerDeprecationError = true)
-    {
-        if ($triggerDeprecationError) {
-            @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
-        }
-
-        return $this->scope;
-    }
-
     /**
      * Sets the visibility of this service.
      *
@@ -636,42 +486,6 @@ class Definition
         return $this->public;
     }
 
-    /**
-     * Sets the synchronized flag of this service.
-     *
-     * @param bool $boolean
-     *
-     * @return $this
-     *
-     * @deprecated since version 2.7, will be removed in 3.0.
-     */
-    public function setSynchronized($boolean, $triggerDeprecationError = true)
-    {
-        if ($triggerDeprecationError) {
-            @trigger_error('The '.__METHOD__.' method is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
-        }
-
-        $this->synchronized = (bool) $boolean;
-
-        return $this;
-    }
-
-    /**
-     * Whether this service is synchronized.
-     *
-     * @return bool
-     *
-     * @deprecated since version 2.7, will be removed in 3.0.
-     */
-    public function isSynchronized($triggerDeprecationError = true)
-    {
-        if ($triggerDeprecationError) {
-            @trigger_error('The '.__METHOD__.' method is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
-        }
-
-        return $this->synchronized;
-    }
-
     /**
      * Sets the lazy flag of this service.
      *
@@ -804,13 +618,17 @@ class Definition
     /**
      * Sets a configurator to call after the service is fully initialized.
      *
-     * @param callable $callable A PHP callable
+     * @param string|array $configurator A PHP callable
      *
      * @return $this
      */
-    public function setConfigurator($callable)
+    public function setConfigurator($configurator)
     {
-        $this->configurator = $callable;
+        if (is_string($configurator) && strpos($configurator, '::') !== false) {
+            $configurator = explode('::', $configurator, 2);
+        }
+
+        $this->configurator = $configurator;
 
         return $this;
     }