⬆️ N°4770 Update to latest Symfony 3.4

This commit is contained in:
Pierre Goiffon
2022-02-10 15:18:50 +01:00
parent b494ff2ce6
commit f29a8792af
401 changed files with 4329 additions and 2378 deletions

View File

@@ -87,7 +87,7 @@ class CodeHelper extends Helper
} elseif ('array' === $item[0]) {
$formattedValue = sprintf('<em>array</em>(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
} elseif ('string' === $item[0]) {
$formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->getCharset()));
$formattedValue = sprintf("'%s'", htmlspecialchars($item[1], \ENT_QUOTES, $this->getCharset()));
} elseif ('null' === $item[0]) {
$formattedValue = '<em>null</em>';
} elseif ('boolean' === $item[0]) {
@@ -95,7 +95,7 @@ class CodeHelper extends Helper
} elseif ('resource' === $item[0]) {
$formattedValue = '<em>resource</em>';
} else {
$formattedValue = str_replace("\n", '', var_export(htmlspecialchars((string) $item[1], ENT_QUOTES, $this->getCharset()), true));
$formattedValue = str_replace("\n", '', var_export(htmlspecialchars((string) $item[1], \ENT_QUOTES, $this->getCharset()), true));
}
$result[] = \is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue);
@@ -119,7 +119,7 @@ class CodeHelper extends Helper
$finfo = new \finfo();
// Check if the file is an application/octet-stream (eg. Phar file) because highlight_file cannot parse these files
if ('application/octet-stream' === $finfo->file($file, FILEINFO_MIME_TYPE)) {
if ('application/octet-stream' === $finfo->file($file, \FILEINFO_MIME_TYPE)) {
return '';
}
}
@@ -153,7 +153,7 @@ class CodeHelper extends Helper
*/
public function formatFile($file, $line, $text = null)
{
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
$flags = \ENT_QUOTES | \ENT_SUBSTITUTE;
if (null === $text) {
$file = trim($file);

View File

@@ -243,9 +243,9 @@ class FormHelper extends Helper
public function formEncodeCurrency($text, $widget = '')
{
if ('UTF-8' === $charset = $this->getCharset()) {
$text = htmlspecialchars($text, ENT_QUOTES | (\defined('ENT_SUBSTITUTE') ? ENT_SUBSTITUTE : 0), 'UTF-8');
$text = htmlspecialchars($text, \ENT_QUOTES | \ENT_SUBSTITUTE, 'UTF-8');
} else {
$text = htmlentities($text, ENT_QUOTES | (\defined('ENT_SUBSTITUTE') ? ENT_SUBSTITUTE : 0), 'UTF-8');
$text = htmlentities($text, \ENT_QUOTES | \ENT_SUBSTITUTE, 'UTF-8');
$text = iconv('UTF-8', $charset, $text);
$widget = iconv('UTF-8', $charset, $widget);
}

View File

@@ -43,6 +43,6 @@ class StopwatchHelper extends Helper
return \call_user_func_array([$this->stopwatch, $method], $arguments);
}
throw new \BadMethodCallException(sprintf('Method "%s" of Stopwatch does not exist', $method));
throw new \BadMethodCallException(sprintf('Method "%s" of Stopwatch does not exist.', $method));
}
}

View File

@@ -79,7 +79,7 @@ class TemplateLocator implements FileLocatorInterface
try {
return $this->cacheHits[$key] = $this->locator->locate($template->getPath(), $currentPath);
} catch (\InvalidArgumentException $e) {
throw new \InvalidArgumentException(sprintf('Unable to find template "%s" : "%s".', $template, $e->getMessage()), 0, $e);
throw new \InvalidArgumentException(sprintf('Unable to find template "%s": ', $template).$e->getMessage(), 0, $e);
}
}
}

View File

@@ -44,7 +44,7 @@ class TemplateNameParser extends BaseTemplateNameParser
}
// normalize name
$name = str_replace(':/', ':', preg_replace('#/{2,}#', '/', str_replace('\\', '/', $name)));
$name = preg_replace('#/{2,}#', '/', str_replace('\\', '/', $name));
if (false !== strpos($name, '..')) {
throw new \RuntimeException(sprintf('Template name "%s" contains invalid characters.', $name));
@@ -72,7 +72,7 @@ class TemplateNameParser extends BaseTemplateNameParser
$isAbsolute = (bool) preg_match('#^(?:/|[a-zA-Z]:)#', $file);
if ($isAbsolute) {
@trigger_error('Absolute template path support is deprecated since Symfony 3.1 and will be removed in 4.0.', E_USER_DEPRECATED);
@trigger_error('Absolute template path support is deprecated since Symfony 3.1 and will be removed in 4.0.', \E_USER_DEPRECATED);
}
return $isAbsolute;