[DI] Add missing check in PhpDumper

This commit is contained in:
Nicolas Grekas 2017-04-21 13:48:46 +02:00
parent bc6128b486
commit 5cabf880d6
1 changed files with 4 additions and 1 deletions

View File

@ -1331,9 +1331,12 @@ EOF;
if (null !== $this->definitionVariables && $this->definitionVariables->contains($value)) {
return $this->dumpValue($this->definitionVariables->offsetGet($value), $interpolate);
}
if (count($value->getMethodCalls()) > 0) {
if ($value->getMethodCalls()) {
throw new RuntimeException('Cannot dump definitions which have method calls.');
}
if ($value->getProperties()) {
throw new RuntimeException('Cannot dump definitions which have properties.');
}
if (null !== $value->getConfigurator()) {
throw new RuntimeException('Cannot dump definitions which have a configurator.');
}