Skip to content

Commit b95a05a

Browse files
committed
bug symfony#25268 [DI] turn $private to protected in dumped container, to make cache:clear BC (nicolas-grekas)
This PR was merged into the 4.0 branch. Discussion ---------- [DI] turn $private to protected in dumped container, to make cache:clear BC | Q | A | ------------- | --- | Branch? | 4.0 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Turning this property to protected changes nothing to its visibility in practice as the class is final anyway, but when migrating to SF4.0 from 3.4, the `cache:clear` command chokes with "Compile Error: Access level to srcDevDebugProjectContainer::$privates must be protected". Let's make it protected to remove this WTF. Commits ------- c98d967 [DI] turn $private to protected in dumped container, to make cache:clear BC
2 parents 1da8591 + c98d967 commit b95a05a

25 files changed

+126
-26
lines changed

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,11 @@ class $class extends $baseClass
878878
{
879879
private \$parameters;
880880
private \$targetDirs = array();
881-
private \$privates = array();
881+
882+
/*{$this->docStar}
883+
* @internal but protected for BC on cache:clear
884+
*/
885+
protected \$privates = array();
882886
883887
public function __construct()
884888
{
@@ -1062,7 +1066,7 @@ private function addAliases(): string
10621066
return $code." );\n";
10631067
}
10641068

1065-
private function addInlineRequires() :string
1069+
private function addInlineRequires(): string
10661070
{
10671071
if (!$this->hotPathTag || !$this->inlineRequires) {
10681072
return '';

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ class Container extends \Symfony\Component\DependencyInjection\Dump\AbstractCont
2020
{
2121
private $parameters;
2222
private $targetDirs = array();
23-
private $privates = array();
23+
24+
/**
25+
* @internal but protected for BC on cache:clear
26+
*/
27+
protected $privates = array();
2428

2529
public function __construct()
2630
{

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ class ProjectServiceContainer extends Container
1818
{
1919
private $parameters;
2020
private $targetDirs = array();
21-
private $privates = array();
21+
22+
/**
23+
* @internal but protected for BC on cache:clear
24+
*/
25+
protected $privates = array();
2226

2327
public function __construct()
2428
{

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ class ProjectServiceContainer extends Container
1818
{
1919
private $parameters;
2020
private $targetDirs = array();
21-
private $privates = array();
21+
22+
/**
23+
* @internal but protected for BC on cache:clear
24+
*/
25+
protected $privates = array();
2226

2327
public function __construct()
2428
{

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ class ProjectServiceContainer extends Container
1818
{
1919
private $parameters;
2020
private $targetDirs = array();
21-
private $privates = array();
21+
22+
/**
23+
* @internal but protected for BC on cache:clear
24+
*/
25+
protected $privates = array();
2226

2327
public function __construct()
2428
{

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ class ProjectServiceContainer extends Container
1818
{
1919
private $parameters;
2020
private $targetDirs = array();
21-
private $privates = array();
21+
22+
/**
23+
* @internal but protected for BC on cache:clear
24+
*/
25+
protected $privates = array();
2226

2327
public function __construct()
2428
{

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ class ProjectServiceContainer extends Container
1818
{
1919
private $parameters;
2020
private $targetDirs = array();
21-
private $privates = array();
21+
22+
/**
23+
* @internal but protected for BC on cache:clear
24+
*/
25+
protected $privates = array();
2226

2327
public function __construct()
2428
{

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services24.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ class ProjectServiceContainer extends Container
1818
{
1919
private $parameters;
2020
private $targetDirs = array();
21-
private $privates = array();
21+
22+
/**
23+
* @internal but protected for BC on cache:clear
24+
*/
25+
protected $privates = array();
2226

2327
public function __construct()
2428
{

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ class Symfony_DI_PhpDumper_Test_EnvParameters extends Container
1818
{
1919
private $parameters;
2020
private $targetDirs = array();
21-
private $privates = array();
21+
22+
/**
23+
* @internal but protected for BC on cache:clear
24+
*/
25+
protected $privates = array();
2226

2327
public function __construct()
2428
{

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services33.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ class ProjectServiceContainer extends Container
1818
{
1919
private $parameters;
2020
private $targetDirs = array();
21-
private $privates = array();
21+
22+
/**
23+
* @internal but protected for BC on cache:clear
24+
*/
25+
protected $privates = array();
2226

2327
public function __construct()
2428
{

0 commit comments

Comments
 (0)