From 914653d866c46e20075af048564091e17a6ddd9c Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Wed, 8 May 2019 18:03:40 +0200 Subject: [PATCH 1/2] [Intl] Enable error handler during compile --- src/Symfony/Component/Intl/Resources/bin/common.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Intl/Resources/bin/common.php b/src/Symfony/Component/Intl/Resources/bin/common.php index 6c63062d4f..addaa9415e 100644 --- a/src/Symfony/Component/Intl/Resources/bin/common.php +++ b/src/Symfony/Component/Intl/Resources/bin/common.php @@ -68,6 +68,12 @@ function get_icu_version_from_genrb($genrb) return $matches[1]; } +error_reporting(E_ALL); + +set_error_handler(function ($type, $msg, $file, $line) { + throw new \ErrorException($msg, 0, $type, $file, $line); +}); + set_exception_handler(function (\Throwable $exception) { echo "\n"; @@ -82,10 +88,7 @@ set_exception_handler(function (\Throwable $exception) { echo get_class($cause).': '.$cause->getMessage()."\n"; echo "\n"; echo $cause->getFile().':'.$cause->getLine()."\n"; - foreach ($cause->getTrace() as $trace) { - echo $trace['file'].':'.$trace['line']."\n"; - } - echo "\n"; + echo $cause->getTraceAsString()."\n"; $cause = $cause->getPrevious(); $root = false; From 95e53ed7e0cb6ba060c5494bc76851c0240c05be Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 8 May 2019 19:26:55 +0200 Subject: [PATCH 2/2] fixed CS --- .../Component/DependencyInjection/Dumper/PhpDumper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index ba704d5d9e..467171eda2 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -690,7 +690,7 @@ EOF; $code .= $this->addServiceInclude($id, $definition); if ($this->getProxyDumper()->isProxyCandidate($definition)) { - $factoryCode = $asFile ? ($definition->isShared() ? "\$this->load('%s.php', false)" : "\$this->factories[%2\$s](false)") : '$this->%s(false)'; + $factoryCode = $asFile ? ($definition->isShared() ? "\$this->load('%s.php', false)" : '$this->factories[%2$s](false)') : '$this->%s(false)'; $code .= $this->getProxyDumper()->getProxyFactoryCode($definition, $id, sprintf($factoryCode, $methodName, $this->doExport($id))); } @@ -1386,14 +1386,14 @@ EOF; if (!$this->container->hasDefinition($service)) { return 'false'; } - $conditions[] = sprintf("isset(\$this->%s[%s])", $this->container->getDefinition($service)->isPublic() ? 'services' : 'privates', $this->doExport($service)); + $conditions[] = sprintf('isset($this->%s[%s])', $this->container->getDefinition($service)->isPublic() ? 'services' : 'privates', $this->doExport($service)); } foreach (ContainerBuilder::getServiceConditionals($value) as $service) { if ($this->container->hasDefinition($service) && !$this->container->getDefinition($service)->isPublic()) { continue; } - $conditions[] = sprintf("\$this->has(%s)", $this->doExport($service)); + $conditions[] = sprintf('$this->has(%s)', $this->doExport($service)); } if (!$conditions) {