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
This commit is contained in:
Fabien Potencier 2017-04-05 06:42:13 -07:00
commit f92ada80f4
6 changed files with 9 additions and 9 deletions

View File

@ -41,7 +41,7 @@ class ChromePhpHandler extends BaseChromePhpHandler
return;
}
if (!preg_match('{\b(?:Chrome/\d+(?:\.\d+)*|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}', $event->getRequest()->headers->get('User-Agent'))) {
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'))) {
$this->sendHeaders = false;
$this->headers = array();

View File

@ -169,11 +169,11 @@ EOF
}
if (!$this->getApplication()->getKernel()->isDebug()) {
throw new \LogicException(sprintf('Debug information about the container is only available in debug mode.'));
throw new \LogicException('Debug information about the container is only available in debug mode.');
}
if (!is_file($cachedFile = $this->getContainer()->getParameter('debug.container.dump'))) {
throw new \LogicException(sprintf('Debug information about the container could not be found. Please clear the cache and try again.'));
throw new \LogicException('Debug information about the container could not be found. Please clear the cache and try again.');
}
$container = new ContainerBuilder();

View File

@ -379,7 +379,7 @@ class Definition
public function addMethodCall($method, array $arguments = array())
{
if (empty($method)) {
throw new InvalidArgumentException(sprintf('Method name cannot be empty.'));
throw new InvalidArgumentException('Method name cannot be empty.');
}
$this->calls[] = array($method, $arguments);

View File

@ -93,11 +93,11 @@ class YamlDumper extends Dumper
}
if ($definition->isSynthetic()) {
$code .= sprintf(" synthetic: true\n");
$code .= " synthetic: true\n";
}
if ($definition->isSynchronized(false)) {
$code .= sprintf(" synchronized: true\n");
$code .= " synchronized: true\n";
}
if ($definition->isDeprecated()) {
@ -121,7 +121,7 @@ class YamlDumper extends Dumper
}
if ($definition->isLazy()) {
$code .= sprintf(" lazy: true\n");
$code .= " lazy: true\n";
}
if ($definition->getFactoryMethod(false)) {

View File

@ -135,7 +135,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
}
if (null !== $currentKey) {
throw new \InvalidArgumentException(sprintf('Malformed path. Path must end with "]".'));
throw new \InvalidArgumentException('Malformed path. Path must end with "]".');
}
return $value;

View File

@ -151,7 +151,7 @@ class Validator implements ValidatorInterface, Mapping\Factory\MetadataFactoryIn
? '"'.$containingValue.'"'
: 'the value of type '.gettype($containingValue);
throw new ValidatorException(sprintf('The metadata for '.$valueAsString.' does not support properties.'));
throw new ValidatorException(sprintf('The metadata for %s does not support properties.', $valueAsString));
}
// If $containingValue is passed as class name, take $value as root