8000 [DependencyInjection] PhpDumper::isFrozen inconsistency · symfony/symfony@7c0a62c · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c0a62c

Browse files
allflamefabpot
authored andcommitted
[DependencyInjection] PhpDumper::isFrozen inconsistency
1 parent c89f80a commit 7c0a62c

File tree

5 files changed

+53
-0
lines changed

5 files changed

+53
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public function dump(array $options = array())
144144
if ($this->container->isFrozen()) {
145145
$code .= $this->addFrozenConstructor();
146146
$code .= $this->addFrozenCompile();
147+
$code .= $this->addIsFrozenMethod();
147148
} else {
148149
$code .= $this->addConstructor();
149150
}
@@ -957,6 +958,26 @@ public function compile()
957958
throw new LogicException('You cannot compile a dumped frozen container.');
958959
}
959960
961+
EOF;
962+
}
963+
964+
/**
965+
* Adds the isFrozen method for a frozen container.
966+
*
967+
* @return string
968+
*/
969+
private function addIsFrozenMethod()
970+
{
971+
return <<<EOF
972+
973+
/*{$this->docStar}
974+
* {@inheritdoc}
975+
*/
976+
public function isFrozen()
977+
{
978+
return true;
979+
}
980+
960981
EOF;
961982
}
962983

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ public function compile()
4646
throw new LogicException('You cannot compile a dumped frozen container.');
4747
}
4848

49+
/**
50+
* {@inheritdoc}
51+
*/
52+
public function isFrozen()
53+
{
54+
return true;
55+
}
56+
4957
/**
5058
* Gets the 'test' service.
5159
*

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ public function compile()
5050
throw new LogicException('You cannot compile a dumped frozen container.');
5151
}
5252

53+
/**
54+
* {@inheritdoc}
55+
*/
56+
public function isFrozen()
57+
{
58+
return true;
59+
}
60+
5361
/**
5462
* Gets the 'test' service.
5563
*

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ public function compile()
4444
throw new LogicException('You cannot compile a dumped frozen container.');
4545
}
4646

47+
/**
48+
* {@inheritdoc}
49+
*/
50+
public function isFrozen()
51+
{
52+
return true;
53+
}
54+
4755
/**
4856
* Gets the 'bar' service.
4957
*

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ public function compile()
6262
throw new LogicException('You cannot compile a dumped frozen container.');
6363
}
6464

65+
/**
66+
* {@inheritdoc}
67+
*/
68+
public function isFrozen()
69+
{
70+
return true;
71+
}
72+
6573
/**
6674
* Gets the 'bar' service.
6775
*

0 commit comments

Comments
 (0)
0