From 5cabf880d62e6fe80158e318ddf1f8e3e9c8b1ea Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 21 Apr 2017 13:48:46 +0200 Subject: [PATCH] [DI] Add missing check in PhpDumper --- .../Component/DependencyInjection/Dumper/PhpDumper.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index cabcbcd657..de910517c8 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -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.'); }