Yaffs site version 1.1
[yaffs-website] / vendor / symfony / dependency-injection / Definition.php
index 1b3a1c24e9aa0269716c8a461ac1aab91c29e64a..7781220a97fec3b04542b705d944154490fb81a4 100644 (file)
@@ -29,7 +29,7 @@ class Definition
     private $factoryService;
     private $shared = true;
     private $deprecated = false;
     private $factoryService;
     private $shared = true;
     private $deprecated = false;
-    private $deprecationTemplate = 'The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed.';
+    private $deprecationTemplate;
     private $scope = ContainerInterface::SCOPE_CONTAINER;
     private $properties = array();
     private $calls = array();
     private $scope = ContainerInterface::SCOPE_CONTAINER;
     private $properties = array();
     private $calls = array();
@@ -44,6 +44,8 @@ class Definition
     private $autowired = false;
     private $autowiringTypes = array();
 
     private $autowired = false;
     private $autowiringTypes = array();
 
+    private static $defaultDeprecationTemplate = 'The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed.';
+
     protected $arguments;
 
     /**
     protected $arguments;
 
     /**
@@ -379,7 +381,7 @@ class Definition
     public function addMethodCall($method, array $arguments = array())
     {
         if (empty($method)) {
     public function addMethodCall($method, array $arguments = array())
     {
         if (empty($method)) {
-            throw new InvalidArgumentException(sprintf('Method name cannot be empty.'));
+            throw new InvalidArgumentException('Method name cannot be empty.');
         }
         $this->calls[] = array($method, $arguments);
 
         }
         $this->calls[] = array($method, $arguments);
 
@@ -796,7 +798,7 @@ class Definition
      */
     public function getDeprecationMessage($id)
     {
      */
     public function getDeprecationMessage($id)
     {
-        return str_replace('%service_id%', $id, $this->deprecationTemplate);
+        return str_replace('%service_id%', $id, $this->deprecationTemplate ?: self::$defaultDeprecationTemplate);
     }
 
     /**
     }
 
     /**