Skip to content

Commit f92ada8

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Fixes #22264 - add support for Chrome headless, see also Seldaek/monolog#966 Dont call sprintf() when no placeholders are used
2 parents d5ea533 + cb49907 commit f92ada8

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function onKernelResponse(FilterResponseEvent $event)
4141
return;
4242
}
4343

44-
if (!preg_match('{\b(?:Chrome/\d+(?:\.\d+)*|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}', $event->getRequest()->headers->get('User-Agent'))) {
44+
if (!preg_match('{\b(?:Chrome/\d+(?:\.\d+)*|HeadlessChrome|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}', $event->getRequest()->headers->get('User-Agent'))) {
4545
$this->sendHeaders = false;
4646
$this->headers = array();
4747

src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ protected function getContainerBuilder()
169169
}
170170

171171
if (!$this->getApplication()->getKernel()->isDebug()) {
172-
throw new \LogicException(sprintf('Debug information about the container is only available in debug mode.'));
172+
throw new \LogicException('Debug information about the container is only available in debug mode.');
173173
}
174174

175175
if (!is_file($cachedFile = $this->getContainer()->getParameter('debug.container.dump'))) {
176-
throw new \LogicException(sprintf('Debug information about the container could not be found. Please clear the cache and try again.'));
176+
throw new \LogicException('Debug information about the container could not be found. Please clear the cache and try again.');
177177
}
178178

179179
$container = new ContainerBuilder();

src/Symfony/Component/DependencyInjection/Definition.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public function setMethodCalls(array $calls = array())
379379
public function addMethodCall($method, array $arguments = array())
380380
{
381381
if (empty($method)) {
382-
throw new InvalidArgumentException(sprintf('Method name cannot be empty.'));
382+
throw new InvalidArgumentException('Method name cannot be empty.');
383383
}
384384
$this->calls[] = array($method, $arguments);
385385

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ private function addService($id, $definition)
9393
}
9494

9595
if ($definition->isSynthetic()) {
96-
$code .= sprintf(" synthetic: true\n");
96+
$code .= " synthetic: true\n";
9797
}
9898

9999
if ($definition->isSynchronized(false)) {
100-
$code .= sprintf(" synchronized: true\n");
100+
$code .= " synchronized: true\n";
101101
}
102102

103103
if ($definition->isDeprecated()) {
@@ -121,7 +121,7 @@ private function addService($id, $definition)
121121
}
122122

123123
if ($definition->isLazy()) {
124-
$code .= sprintf(" lazy: true\n");
124+
$code .= " lazy: true\n";
125125
}
126126

127127
if ($definition->getFactoryMethod(false)) {

src/Symfony/Component/HttpFoundation/ParameterBag.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function get($key, $default = null, $deep = false)
135135
}
136136

137137
if (null !== $currentKey) {
138-
throw new \InvalidArgumentException(sprintf('Malformed path. Path must end with "]".'));
138+
throw new \InvalidArgumentException('Malformed path. Path must end with "]".');
139139
}
140140

141141
return $value;

src/Symfony/Component/Validator/Validator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function validatePropertyValue($containingValue, $property, $value, $grou
151151
? '"'.$containingValue.'"'
152152
: 'the value of type '.gettype($containingValue);
153153

154-
throw new ValidatorException(sprintf('The metadata for '.$valueAsString.' does not support properties.'));
154+
throw new ValidatorException(sprintf('The metadata for %s does not support properties.', $valueAsString));
155155
}
156156

157157
// If $containingValue is passed as class name, take $value as root

0 commit comments

Comments
 (0)