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 $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;
/**
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);
*/
public function getDeprecationMessage($id)
{
- return str_replace('%service_id%', $id, $this->deprecationTemplate);
+ return str_replace('%service_id%', $id, $this->deprecationTemplate ?: self::$defaultDeprecationTemplate);
}
/**