Skip to content

Commit c088c03

Browse files
committed
Merge branch '2.8' into 3.2
* 2.8: fixed CS [DI] Fix PhpDumper blank lines around namespace fixed CS Filesystem: annotate the one network test with a "network" group. [DependencyInjection] Don't store default deprecation template in every service definition instance
2 parents 5e00857 + 6f229d0 commit c088c03

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Definition.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Definition
2626
private $factory;
2727
private $shared = true;
2828
private $deprecated = false;
29-
private $deprecationTemplate = 'The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed.';
29+
private $deprecationTemplate;
3030
private $properties = array();
3131
private $calls = array();
3232
private $configurator;
@@ -39,6 +39,8 @@ class Definition
3939
private $autowired = false;
4040
private $autowiringTypes = array();
4141

42+
private static $defaultDeprecationTemplate = 'The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed.';
43+
4244
protected $arguments;
4345

4446
/**
@@ -610,7 +612,7 @@ public function isDeprecated()
610612
*/
611613
public function getDeprecationMessage($id)
612614
{
613-
return str_replace('%service_id%', $id, $this->deprecationTemplate);
615+
return str_replace('%service_id%', $id, $this->deprecationTemplate ?: self::$defaultDeprecationTemplate);
614616
}
615617

616618
/**

Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ private function addNewInstance(Definition $definition, $return, $instantiation,
772772
private function startClass($class, $baseClass, $namespace)
773773
{
774774
$bagClass = $this->container->isFrozen() ? 'use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;' : 'use Symfony\Component\DependencyInjection\ParameterBag\\ParameterBag;';
775-
$namespaceLine = $namespace ? "namespace $namespace;\n" : '';
775+
$namespaceLine = $namespace ? "\nnamespace $namespace;\n" : '';
776776

777777
return <<<EOF
778778
<?php

Tests/Fixtures/php/services1-1.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Symfony\Component\DependencyInjection\Dump;
34

45
use Symfony\Component\DependencyInjection\ContainerInterface;

0 commit comments

Comments
 (0)