composer update

This commit is contained in:
2020-12-06 10:28:55 +00:00
parent 69d92960d9
commit 09413522bb
1596 changed files with 60456 additions and 39587 deletions

View File

@@ -53,7 +53,7 @@ class CacheWarmerAggregate implements CacheWarmerInterface
if ($collectDeprecations = $this->debug && !\defined('PHPUNIT_COMPOSER_INSTALL')) {
$collectedLogs = [];
$previousHandler = set_error_handler(function ($type, $message, $file, $line) use (&$collectedLogs, &$previousHandler) {
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
if (\E_USER_DEPRECATED !== $type && \E_DEPRECATED !== $type) {
return $previousHandler ? $previousHandler($type, $message, $file, $line) : false;
}
@@ -63,7 +63,7 @@ class CacheWarmerAggregate implements CacheWarmerInterface
return null;
}
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
$backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 3);
// Clean the trace by removing first frames added by the error handler itself.
for ($i = 0; isset($backtrace[$i]); ++$i) {
if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) {

View File

@@ -166,7 +166,7 @@ EOF;
'',
$value->getClientOriginalName(),
$value->getClientMimeType(),
UPLOAD_ERR_INI_SIZE,
\UPLOAD_ERR_INI_SIZE,
true
);
} else {

View File

@@ -40,7 +40,7 @@ class FileLocator extends BaseFileLocator
}
if (4 !== \func_num_args() || func_get_arg(3)) {
@trigger_error(sprintf('Passing more than one argument to %s is deprecated since Symfony 4.4 and will be removed in 5.0.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Passing more than one argument to %s is deprecated since Symfony 4.4 and will be removed in 5.0.', __METHOD__), \E_USER_DEPRECATED);
}
} else {
$paths = [];
@@ -63,7 +63,7 @@ class FileLocator extends BaseFileLocator
if (isset($file[0]) && !(
'/' === $file[0] || '\\' === $file[0]
|| (\strlen($file) > 3 && ctype_alpha($file[0]) && ':' === $file[1] && ('\\' === $file[2] || '/' === $file[2]))
|| null !== parse_url($file, PHP_URL_SCHEME)
|| null !== parse_url($file, \PHP_URL_SCHEME)
)) {
$deprecation = false;
@@ -81,7 +81,7 @@ class FileLocator extends BaseFileLocator
}
if ($deprecation) {
@trigger_error($deprecation, E_USER_DEPRECATED);
@trigger_error($deprecation, \E_USER_DEPRECATED);
}
}

View File

@@ -64,7 +64,7 @@ class ControllerResolver implements ControllerResolverInterface
}
if (!\is_callable($controller)) {
throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable: '.$this->getControllerError($controller), $request->getPathInfo()));
throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable: ', $request->getPathInfo()).$this->getControllerError($controller));
}
return $controller;
@@ -85,7 +85,7 @@ class ControllerResolver implements ControllerResolverInterface
try {
$callable = $this->createController($controller);
} catch (\InvalidArgumentException $e) {
throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable: '.$e->getMessage(), $request->getPathInfo()), 0, $e);
throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable: ', $request->getPathInfo()).$e->getMessage(), 0, $e);
}
if (!\is_callable($callable)) {
@@ -116,7 +116,7 @@ class ControllerResolver implements ControllerResolverInterface
return $controller;
}
list($class, $method) = explode('::', $controller, 2);
[$class, $method] = explode('::', $controller, 2);
try {
$controller = [$this->instantiateController($class), $method];
@@ -176,7 +176,7 @@ class ControllerResolver implements ControllerResolverInterface
return 'Invalid array callable, expected [controller, method].';
}
list($controller, $method) = $callable;
[$controller, $method] = $callable;
if (\is_string($controller) && !class_exists($controller)) {
return sprintf('Class "%s" does not exist.', $controller);

View File

@@ -48,7 +48,7 @@ final class ArgumentMetadataFactory implements ArgumentMetadataFactoryInterface
if (!$type = $parameter->getType()) {
return null;
}
$name = $type->getName();
$name = $type instanceof \ReflectionNamedType ? $type->getName() : (string) $type;
if ($function instanceof \ReflectionMethod) {
$lcName = strtolower($name);

View File

@@ -34,10 +34,10 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
public function __construct(string $name = null, string $version = null)
{
if (1 <= \func_num_args()) {
@trigger_error(sprintf('The "$name" argument in method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "$name" argument in method "%s()" is deprecated since Symfony 4.2.', __METHOD__), \E_USER_DEPRECATED);
}
if (2 <= \func_num_args()) {
@trigger_error(sprintf('The "$version" argument in method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "$version" argument in method "%s()" is deprecated since Symfony 4.2.', __METHOD__), \E_USER_DEPRECATED);
}
$this->name = $name;
@@ -67,13 +67,13 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
'symfony_state' => 'unknown',
'env' => isset($this->kernel) ? $this->kernel->getEnvironment() : 'n/a',
'debug' => isset($this->kernel) ? $this->kernel->isDebug() : 'n/a',
'php_version' => PHP_VERSION,
'php_architecture' => PHP_INT_SIZE * 8,
'php_version' => \PHP_VERSION,
'php_architecture' => \PHP_INT_SIZE * 8,
'php_intl_locale' => class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a',
'php_timezone' => date_default_timezone_get(),
'xdebug_enabled' => \extension_loaded('xdebug'),
'apcu_enabled' => \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN),
'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN),
'apcu_enabled' => \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN),
'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN),
'bundles' => [],
'sapi_name' => \PHP_SAPI,
];
@@ -116,7 +116,7 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
*/
public function getApplicationName()
{
@trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.2.', __METHOD__), \E_USER_DEPRECATED);
return $this->data['app_name'];
}
@@ -126,7 +126,7 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
*/
public function getApplicationVersion()
{
@trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.2.', __METHOD__), \E_USER_DEPRECATED);
return $this->data['app_version'];
}
@@ -255,7 +255,7 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
*/
public function getAppName()
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), \E_USER_DEPRECATED);
return 'n/a';
}

View File

@@ -43,9 +43,9 @@ abstract class DataCollector implements DataCollectorInterface
*/
public function serialize()
{
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.3, store all the serialized state in the data property instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.3, store all the serialized state in the data property instead.', __METHOD__), \E_USER_DEPRECATED);
$trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2);
$trace = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT, 2);
$isCalledFromOverridingMethod = isset($trace[1]['function'], $trace[1]['object']) && 'serialize' === $trace[1]['function'] && $this === $trace[1]['object'];
return $isCalledFromOverridingMethod ? $this->data : serialize($this->data);
@@ -56,7 +56,7 @@ abstract class DataCollector implements DataCollectorInterface
*/
public function unserialize($data)
{
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.3, store all the serialized state in the data property instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.3, store all the serialized state in the data property instead.', __METHOD__), \E_USER_DEPRECATED);
$this->data = \is_array($data) ? $data : unserialize($data);
}
@@ -113,7 +113,7 @@ abstract class DataCollector implements DataCollectorInterface
public function __sleep()
{
if (__CLASS__ !== $c = (new \ReflectionMethod($this, 'serialize'))->getDeclaringClass()->name) {
@trigger_error(sprintf('Implementing the "%s::serialize()" method is deprecated since Symfony 4.3, store all the serialized state in the "data" property instead.', $c), E_USER_DEPRECATED);
@trigger_error(sprintf('Implementing the "%s::serialize()" method is deprecated since Symfony 4.3, store all the serialized state in the "data" property instead.', $c), \E_USER_DEPRECATED);
$this->data = $this->serialize();
}
@@ -123,7 +123,7 @@ abstract class DataCollector implements DataCollectorInterface
public function __wakeup()
{
if (__CLASS__ !== $c = (new \ReflectionMethod($this, 'unserialize'))->getDeclaringClass()->name) {
@trigger_error(sprintf('Implementing the "%s::unserialize()" method is deprecated since Symfony 4.3, store all the serialized state in the "data" property instead.', $c), E_USER_DEPRECATED);
@trigger_error(sprintf('Implementing the "%s::unserialize()" method is deprecated since Symfony 4.3, store all the serialized state in the "data" property instead.', $c), \E_USER_DEPRECATED);
$this->unserialize($this->data);
}
}

View File

@@ -75,7 +75,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
$this->stopwatch->start('dump');
}
list('name' => $name, 'file' => $file, 'line' => $line, 'file_excerpt' => $fileExcerpt) = $this->sourceContextProvider->getContext();
['name' => $name, 'file' => $file, 'line' => $line, 'file_excerpt' => $fileExcerpt] = $this->sourceContextProvider->getContext();
if ($this->dumper instanceof Connection) {
if (!$this->dumper->write($data)) {
@@ -235,13 +235,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
--$i;
}
if (isset($_SERVER['VAR_DUMPER_FORMAT'])) {
$html = 'html' === $_SERVER['VAR_DUMPER_FORMAT'];
} else {
$html = !\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && stripos($h[$i], 'html');
}
if ($html) {
if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && stripos($h[$i], 'html')) {
$dumper = new HtmlDumper('php://output', $this->charset);
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
} else {

View File

@@ -155,7 +155,7 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte
}
$logs = [];
foreach (file($compilerLogsFilepath, FILE_IGNORE_NEW_LINES) as $log) {
foreach (file($compilerLogsFilepath, \FILE_IGNORE_NEW_LINES) as $log) {
$log = explode(': ', $log, 2);
if (!isset($log[1]) || !preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)++$/', $log[0])) {
$log = ['Unknown Compiler Pass', implode(': ', $log)];
@@ -228,7 +228,7 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte
return true;
}
if ($exception instanceof \ErrorException && \in_array($exception->getSeverity(), [E_DEPRECATED, E_USER_DEPRECATED], true)) {
if ($exception instanceof \ErrorException && \in_array($exception->getSeverity(), [\E_DEPRECATED, \E_USER_DEPRECATED], true)) {
return true;
}

View File

@@ -66,8 +66,8 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
if ($request->hasSession()) {
$session = $request->getSession();
if ($session->isStarted()) {
$sessionMetadata['Created'] = date(DATE_RFC822, $session->getMetadataBag()->getCreated());
$sessionMetadata['Last used'] = date(DATE_RFC822, $session->getMetadataBag()->getLastUsed());
$sessionMetadata['Created'] = date(\DATE_RFC822, $session->getMetadataBag()->getCreated());
$sessionMetadata['Last used'] = date(\DATE_RFC822, $session->getMetadataBag()->getLastUsed());
$sessionMetadata['Lifetime'] = $session->getMetadataBag()->getLifetime();
$sessionAttributes = $session->all();
$flashes = $session->getFlashBag()->peekAll();
@@ -263,7 +263,7 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
{
$decoded = json_decode($this->getContent());
return JSON_ERROR_NONE === json_last_error() ? json_encode($decoded, JSON_PRETTY_PRINT) : null;
return \JSON_ERROR_NONE === json_last_error() ? json_encode($decoded, \JSON_PRETTY_PRINT) : null;
}
public function getContentType()

View File

@@ -37,7 +37,7 @@ class FileLinkFormatter
$fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
if ($fileLinkFormat && !\is_array($fileLinkFormat)) {
$i = strpos($f = $fileLinkFormat, '&', max(strrpos($f, '%f'), strrpos($f, '%l'))) ?: \strlen($f);
$fileLinkFormat = [substr($f, 0, $i)] + preg_split('/&([^>]++)>/', substr($f, $i), -1, PREG_SPLIT_DELIM_CAPTURE);
$fileLinkFormat = [substr($f, 0, $i)] + preg_split('/&([^>]++)>/', substr($f, $i), -1, \PREG_SPLIT_DELIM_CAPTURE);
}
$this->fileLinkFormat = $fileLinkFormat;

View File

@@ -127,10 +127,10 @@ class AddAnnotatedClassesToCachePass implements CompilerPassInterface
private function matchAnyRegexps(string $class, array $regexps): bool
{
$blacklisted = false !== strpos($class, 'Test');
$isTest = false !== strpos($class, 'Test');
foreach ($regexps as $regex) {
if ($blacklisted && false === strpos($regex, 'Test')) {
if ($isTest && false === strpos($regex, 'Test')) {
continue;
}

View File

@@ -93,13 +93,13 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
}
foreach (['action', 'argument', 'id'] as $k) {
if (!isset($attributes[$k][0])) {
throw new InvalidArgumentException(sprintf('Missing "%s" attribute on tag "%s" %s for service "%s".', $k, $this->controllerTag, json_encode($attributes, JSON_UNESCAPED_UNICODE), $id));
throw new InvalidArgumentException(sprintf('Missing "%s" attribute on tag "%s" %s for service "%s".', $k, $this->controllerTag, json_encode($attributes, \JSON_UNESCAPED_UNICODE), $id));
}
}
if (!isset($methods[$action = strtolower($attributes['action'])])) {
throw new InvalidArgumentException(sprintf('Invalid "action" attribute on tag "%s" for service "%s": no public "%s()" method found on class "%s".', $this->controllerTag, $id, $attributes['action'], $class));
}
list($r, $parameters) = $methods[$action];
[$r, $parameters] = $methods[$action];
$found = false;
foreach ($parameters as $p) {
@@ -117,7 +117,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
}
}
foreach ($methods as list($r, $parameters)) {
foreach ($methods as [$r, $parameters]) {
/** @var \ReflectionMethod $r */
// create a per-method map of argument-names to service/type-references
@@ -139,7 +139,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
} elseif (isset($bindings[$bindingName = $type.' $'.$p->name]) || isset($bindings[$bindingName = '$'.$p->name]) || isset($bindings[$bindingName = $type])) {
$binding = $bindings[$bindingName];
list($bindingValue, $bindingId, , $bindingType, $bindingFile) = $binding->getValues();
[$bindingValue, $bindingId, , $bindingType, $bindingFile] = $binding->getValues();
$binding->setValues([$bindingValue, $bindingId, true, $bindingType, $bindingFile]);
if (!$bindingValue instanceof Reference) {

View File

@@ -42,9 +42,9 @@ class RemoveEmptyControllerArgumentLocatorsPass implements CompilerPassInterface
} else {
// any methods listed for call-at-instantiation cannot be actions
$reason = false;
list($id, $action) = explode('::', $controller);
[$id, $action] = explode('::', $controller);
$controllerDef = $container->getDefinition($id);
foreach ($controllerDef->getMethodCalls() as list($method)) {
foreach ($controllerDef->getMethodCalls() as [$method]) {
if (0 === strcasecmp($action, $method)) {
$reason = sprintf('Removing method "%s" of service "%s" from controller candidates: the method is called at instantiation, thus cannot be an action.', $action, $id);
break;

View File

@@ -18,7 +18,7 @@ namespace Symfony\Component\HttpKernel\Event;
* current request. The propagation of this event is stopped as soon as a
* response is set.
*
* You can also call setException() to replace the thrown exception. This
* You can also call setThrowable() to replace the thrown exception. This
* exception will be thrown if no response is set during processing of this
* event.
*

View File

@@ -54,7 +54,7 @@ class GetResponseForExceptionEvent extends RequestEvent
*/
public function getException()
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.4, use "getThrowable()" instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.4, use "getThrowable()" instead.', __METHOD__), \E_USER_DEPRECATED);
return $this->exception ?? $this->exception = $this->throwable instanceof \Exception ? $this->throwable : new FatalThrowableError($this->throwable);
}
@@ -66,7 +66,7 @@ class GetResponseForExceptionEvent extends RequestEvent
*/
public function setException(\Exception $exception)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.4, use "setThrowable()" instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.4, use "setThrowable()" instead.', __METHOD__), \E_USER_DEPRECATED);
$this->throwable = $this->exception = $exception;
}

View File

@@ -55,12 +55,9 @@ abstract class AbstractSessionListener implements EventSubscriberInterface
$session = null;
$request = $event->getRequest();
if ($request->hasSession()) {
// no-op
} elseif (method_exists($request, 'setSessionFactory')) {
$request->setSessionFactory(function () { return $this->getSession(); });
} elseif ($session = $this->getSession()) {
$request->setSession($session);
if (!$request->hasSession()) {
$sess = null;
$request->setSessionFactory(function () use (&$sess) { return $sess ?? $sess = $this->getSession(); });
}
$session = $session ?? ($this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : null);

View File

@@ -51,12 +51,12 @@ class DebugHandlersListener implements EventSubscriberInterface
* @param string|FileLinkFormatter|null $fileLinkFormat The format for links to source files
* @param bool $scope Enables/disables scoping mode
*/
public function __construct(callable $exceptionHandler = null, LoggerInterface $logger = null, $levels = E_ALL, ?int $throwAt = E_ALL, bool $scream = true, $fileLinkFormat = null, bool $scope = true)
public function __construct(callable $exceptionHandler = null, LoggerInterface $logger = null, $levels = \E_ALL, ?int $throwAt = \E_ALL, bool $scream = true, $fileLinkFormat = null, bool $scope = true)
{
$this->exceptionHandler = $exceptionHandler;
$this->logger = $logger;
$this->levels = null === $levels ? E_ALL : $levels;
$this->throwAt = \is_int($throwAt) ? $throwAt : (null === $throwAt ? null : ($throwAt ? E_ALL : null));
$this->levels = null === $levels ? \E_ALL : $levels;
$this->throwAt = \is_int($throwAt) ? $throwAt : (null === $throwAt ? null : ($throwAt ? \E_ALL : null));
$this->scream = $scream;
$this->fileLinkFormat = $fileLinkFormat;
$this->scope = $scope;
@@ -95,7 +95,7 @@ class DebugHandlersListener implements EventSubscriberInterface
$handler->screamAt($levels);
}
if ($this->scope) {
$handler->scopeAt($levels & ~E_USER_DEPRECATED & ~E_DEPRECATED);
$handler->scopeAt($levels & ~\E_USER_DEPRECATED & ~\E_DEPRECATED);
} else {
$handler->scopeAt(0, true);
}

View File

@@ -99,7 +99,7 @@ class ErrorListener implements EventSubscriberInterface
$r = new \ReflectionFunction(\Closure::fromCallable($event->getController()));
$r = $r->getParameters()[$k] ?? null;
if ($r && (!$r->hasType() || \in_array($r->getType()->getName(), [FlattenException::class, LegacyFlattenException::class], true))) {
if ($r && (!($r = $r->getType()) instanceof \ReflectionNamedType || \in_array($r->getName(), [FlattenException::class, LegacyFlattenException::class], true))) {
$arguments = $event->getArguments();
$arguments[$k] = FlattenException::createFromThrowable($e);
$event->setArguments($arguments);

View File

@@ -22,7 +22,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "ErrorListener" instead.', ExceptionListener::class), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "ErrorListener" instead.', ExceptionListener::class), \E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use ErrorListener instead

View File

@@ -11,7 +11,7 @@
namespace Symfony\Component\HttpKernel\EventListener;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1, use AbstractSessionListener instead.', SaveSessionListener::class), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1, use AbstractSessionListener instead.', SaveSessionListener::class), \E_USER_DEPRECATED);
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;

View File

@@ -11,7 +11,7 @@
namespace Symfony\Component\HttpKernel\EventListener;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3 and will be removed in 5.0, use LocaleAwareListener instead.', TranslatorListener::class), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3 and will be removed in 5.0, use LocaleAwareListener instead.', TranslatorListener::class), \E_USER_DEPRECATED);
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Request;

View File

@@ -61,7 +61,7 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
}
if ($templating instanceof EngineInterface) {
@trigger_error(sprintf('Using a "%s" instance for "%s" is deprecated since version 4.3; use a \Twig\Environment instance instead.', EngineInterface::class, __CLASS__), E_USER_DEPRECATED);
@trigger_error(sprintf('Using a "%s" instance for "%s" is deprecated since version 4.3; use a \Twig\Environment instance instead.', EngineInterface::class, __CLASS__), \E_USER_DEPRECATED);
}
$this->templating = $templating;
@@ -113,7 +113,7 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
}
$renderedAttributes = '';
if (\count($attributes) > 0) {
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
$flags = \ENT_QUOTES | \ENT_SUBSTITUTE;
foreach ($attributes as $attribute => $value) {
$renderedAttributes .= sprintf(
' %s="%s"',

View File

@@ -80,13 +80,13 @@ class Esi extends AbstractSurrogate
$content = preg_replace('#<esi\:remove>.*?</esi\:remove>#s', '', $content);
$content = preg_replace('#<esi\:comment[^>]+>#s', '', $content);
$chunks = preg_split('#<esi\:include\s+(.*?)\s*(?:/|</esi\:include)>#', $content, -1, PREG_SPLIT_DELIM_CAPTURE);
$chunks = preg_split('#<esi\:include\s+(.*?)\s*(?:/|</esi\:include)>#', $content, -1, \PREG_SPLIT_DELIM_CAPTURE);
$chunks[0] = str_replace($this->phpEscapeMap[0], $this->phpEscapeMap[1], $chunks[0]);
$i = 1;
while (isset($chunks[$i])) {
$options = [];
preg_match_all('/(src|onerror|alt)="([^"]*?)"/', $chunks[$i], $matches, PREG_SET_ORDER);
preg_match_all('/(src|onerror|alt)="([^"]*?)"/', $chunks[$i], $matches, \PREG_SET_ORDER);
foreach ($matches as $set) {
$options[$set[1]] = $set[2];
}

View File

@@ -65,13 +65,13 @@ class Ssi extends AbstractSurrogate
// we don't use a proper XML parser here as we can have SSI tags in a plain text response
$content = $response->getContent();
$chunks = preg_split('#<!--\#include\s+(.*?)\s*-->#', $content, -1, PREG_SPLIT_DELIM_CAPTURE);
$chunks = preg_split('#<!--\#include\s+(.*?)\s*-->#', $content, -1, \PREG_SPLIT_DELIM_CAPTURE);
$chunks[0] = str_replace($this->phpEscapeMap[0], $this->phpEscapeMap[1], $chunks[0]);
$i = 1;
while (isset($chunks[$i])) {
$options = [];
preg_match_all('/(virtual)="([^"]*?)"/', $chunks[$i], $matches, PREG_SET_ORDER);
preg_match_all('/(virtual)="([^"]*?)"/', $chunks[$i], $matches, \PREG_SET_ORDER);
foreach ($matches as $set) {
$options[$set[1]] = $set[2];
}

View File

@@ -48,7 +48,7 @@ class Store implements StoreInterface
{
// unlock everything
foreach ($this->locks as $lock) {
flock($lock, LOCK_UN);
flock($lock, \LOCK_UN);
fclose($lock);
}
@@ -70,7 +70,7 @@ class Store implements StoreInterface
return $path;
}
$h = fopen($path, 'cb');
if (!flock($h, LOCK_EX | LOCK_NB)) {
if (!flock($h, \LOCK_EX | \LOCK_NB)) {
fclose($h);
return $path;
@@ -92,7 +92,7 @@ class Store implements StoreInterface
$key = $this->getCacheKey($request);
if (isset($this->locks[$key])) {
flock($this->locks[$key], LOCK_UN);
flock($this->locks[$key], \LOCK_UN);
fclose($this->locks[$key]);
unset($this->locks[$key]);
@@ -115,8 +115,8 @@ class Store implements StoreInterface
}
$h = fopen($path, 'rb');
flock($h, LOCK_EX | LOCK_NB, $wouldBlock);
flock($h, LOCK_UN); // release the lock we just acquired
flock($h, \LOCK_EX | \LOCK_NB, $wouldBlock);
flock($h, \LOCK_UN); // release the lock we just acquired
fclose($h);
return (bool) $wouldBlock;
@@ -150,8 +150,8 @@ class Store implements StoreInterface
}
$headers = $match[1];
if (file_exists($body = $this->getPath($headers['x-content-digest'][0]))) {
return $this->restoreResponse($headers, $body);
if (file_exists($path = $this->getPath($headers['x-content-digest'][0]))) {
return $this->restoreResponse($headers, $path);
}
// TODO the metaStore referenced an entity that doesn't exist in
@@ -175,16 +175,25 @@ class Store implements StoreInterface
$key = $this->getCacheKey($request);
$storedEnv = $this->persistRequest($request);
// write the response body to the entity store if this is the original response
if (!$response->headers->has('X-Content-Digest')) {
$digest = $this->generateContentDigest($response);
if (!$this->save($digest, $response->getContent())) {
throw new \RuntimeException('Unable to store the entity.');
if ($response->headers->has('X-Body-File')) {
// Assume the response came from disk, but at least perform some safeguard checks
if (!$response->headers->has('X-Content-Digest')) {
throw new \RuntimeException('A restored response must have the X-Content-Digest header.');
}
$digest = $response->headers->get('X-Content-Digest');
if ($this->getPath($digest) !== $response->headers->get('X-Body-File')) {
throw new \RuntimeException('X-Body-File and X-Content-Digest do not match.');
}
// Everything seems ok, omit writing content to disk
} else {
$digest = $this->generateContentDigest($response);
$response->headers->set('X-Content-Digest', $digest);
if (!$this->save($digest, $response->getContent(), false)) {
throw new \RuntimeException('Unable to store the entity.');
}
if (!$response->headers->has('Transfer-Encoding')) {
$response->headers->set('Content-Length', \strlen($response->getContent()));
}
@@ -319,7 +328,7 @@ class Store implements StoreInterface
{
$key = $this->getCacheKey(Request::create($url));
if (isset($this->locks[$key])) {
flock($this->locks[$key], LOCK_UN);
flock($this->locks[$key], \LOCK_UN);
fclose($this->locks[$key]);
unset($this->locks[$key]);
}
@@ -346,10 +355,14 @@ class Store implements StoreInterface
/**
* Save data for the given key.
*/
private function save(string $key, string $data): bool
private function save(string $key, string $data, bool $overwrite = true): bool
{
$path = $this->getPath($key);
if (!$overwrite && file_exists($path)) {
return true;
}
if (isset($this->locks[$key])) {
$fp = $this->locks[$key];
@ftruncate($fp, 0);
@@ -448,15 +461,15 @@ class Store implements StoreInterface
/**
* Restores a Response from the HTTP headers and body.
*/
private function restoreResponse(array $headers, string $body = null): Response
private function restoreResponse(array $headers, string $path = null): Response
{
$status = $headers['X-Status'][0];
unset($headers['X-Status']);
if (null !== $body) {
$headers['X-Body-File'] = [$body];
if (null !== $path) {
$headers['X-Body-File'] = [$path];
}
return new Response($body, $status, $headers);
return new Response($path, $status, $headers);
}
}

View File

@@ -35,7 +35,7 @@ final class HttpClientKernel implements HttpKernelInterface
public function __construct(HttpClientInterface $client = null)
{
if (!class_exists(HttpClient::class)) {
if (null === $client && !class_exists(HttpClient::class)) {
throw new \LogicException(sprintf('You cannot use "%s" as the HttpClient component is not installed. Try running "composer require symfony/http-client".', __CLASS__));
}
@@ -53,11 +53,14 @@ final class HttpClientKernel implements HttpKernelInterface
$response = $this->client->request($request->getMethod(), $request->getUri(), [
'headers' => $headers,
'body' => $body,
'max_redirects' => 0,
] + $request->attributes->get('http_client_options', []));
$response = new Response($response->getContent(!$catch), $response->getStatusCode(), $response->getHeaders(!$catch));
$response->headers->remove('X-Body-File');
$response->headers->remove('X-Body-Eval');
$response->headers->remove('X-Content-Digest');
$response->headers = new class($response->headers->all()) extends ResponseHeaderBag {
protected function computeCacheControlValue(): string
{

View File

@@ -76,11 +76,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
private static $freshCache = [];
const VERSION = '4.4.8';
const VERSION_ID = 40408;
const VERSION = '4.4.17';
const VERSION_ID = 40417;
const MAJOR_VERSION = 4;
const MINOR_VERSION = 4;
const RELEASE_VERSION = 8;
const RELEASE_VERSION = 17;
const EXTRA_VERSION = '';
const END_OF_MAINTENANCE = '11/2022';
@@ -228,10 +228,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
public function getBundle($name)
{
if (!isset($this->bundles[$name])) {
$class = static::class;
$class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the "registerBundles()" method of your "%s.php" file?', $name, $class));
throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the "registerBundles()" method of your "%s.php" file?', $name, get_debug_type($this)));
}
return $this->bundles[$name];
@@ -247,7 +244,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
$first = 3 <= \func_num_args() ? func_get_arg(2) : true;
if (4 !== \func_num_args() || func_get_arg(3)) {
@trigger_error(sprintf('Passing more than one argument to %s is deprecated since Symfony 4.4 and will be removed in 5.0.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Passing more than one argument to %s is deprecated since Symfony 4.4 and will be removed in 5.0.', __METHOD__), \E_USER_DEPRECATED);
}
} else {
$dir = null;
@@ -265,7 +262,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
$bundleName = substr($name, 1);
$path = '';
if (false !== strpos($bundleName, '/')) {
list($bundleName, $path) = explode('/', $bundleName, 2);
[$bundleName, $path] = explode('/', $bundleName, 2);
}
$isResource = 0 === strpos($path, 'Resources') && null !== $dir;
@@ -277,7 +274,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
$files[] = $file;
// see https://symfony.com/doc/current/bundles/override.html on how to overwrite parts of a bundle
@trigger_error(sprintf('Overwriting the resource "%s" with "%s" is deprecated since Symfony 4.4 and will be removed in 5.0.', $name, $file), E_USER_DEPRECATED);
@trigger_error(sprintf('Overwriting the resource "%s" with "%s" is deprecated since Symfony 4.4 and will be removed in 5.0.', $name, $file), \E_USER_DEPRECATED);
}
if (file_exists($file = $bundle->getPath().'/'.$path)) {
@@ -302,7 +299,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
public function getName(/* $triggerDeprecation = true */)
{
if (0 === \func_num_args() || func_get_arg(0)) {
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), \E_USER_DEPRECATED);
}
if (null === $this->name) {
@@ -339,7 +336,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
public function getRootDir(/* $triggerDeprecation = true */)
{
if (0 === \func_num_args() || func_get_arg(0)) {
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use getProjectDir() instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use getProjectDir() instead.', __METHOD__), \E_USER_DEPRECATED);
}
if (null === $this->rootDir) {
@@ -383,7 +380,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
public function getContainer()
{
if (!$this->container) {
@trigger_error('Getting the container from a non-booted kernel is deprecated since Symfony 4.4.', E_USER_DEPRECATED);
@trigger_error('Getting the container from a non-booted kernel is deprecated since Symfony 4.4.', \E_USER_DEPRECATED);
}
return $this->container;
@@ -402,7 +399,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
*/
public function getStartTime()
{
return $this->debug && null !== $this->startTime ? $this->startTime : -INF;
return $this->debug && null !== $this->startTime ? $this->startTime : -\INF;
}
/**
@@ -474,7 +471,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
protected function getContainerClass()
{
$class = static::class;
$class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).str_replace('.', '_', ContainerBuilder::hash($class)) : $class;
$class = false !== strpos($class, "@anonymous\0") ? get_parent_class($class).str_replace('.', '_', ContainerBuilder::hash($class)) : $class;
$class = $this->name.str_replace('\\', '_', $class).ucfirst($this->environment).($this->debug ? 'Debug' : '').'Container';
if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $class)) {
@@ -510,7 +507,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
$cachePath = $cache->getPath();
// Silence E_WARNING to ignore "include" failures - don't use "@" to prevent silencing fatal errors
$errorLevel = error_reporting(E_ALL ^ E_WARNING);
$errorLevel = error_reporting(\E_ALL ^ \E_WARNING);
try {
if (file_exists($cachePath) && \is_object($this->container = include $cachePath)
@@ -531,15 +528,15 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
is_dir($cacheDir) ?: mkdir($cacheDir, 0777, true);
if ($lock = fopen($cachePath.'.lock', 'w')) {
flock($lock, LOCK_EX | LOCK_NB, $wouldBlock);
flock($lock, \LOCK_EX | \LOCK_NB, $wouldBlock);
if (!flock($lock, $wouldBlock ? LOCK_SH : LOCK_EX)) {
if (!flock($lock, $wouldBlock ? \LOCK_SH : \LOCK_EX)) {
fclose($lock);
$lock = null;
} elseif (!\is_object($this->container = include $cachePath)) {
$this->container = null;
} elseif (!$oldContainer || \get_class($this->container) !== $oldContainer->name) {
flock($lock, LOCK_UN);
flock($lock, \LOCK_UN);
fclose($lock);
$this->container->set('kernel', $this);
@@ -554,7 +551,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
if ($collectDeprecations = $this->debug && !\defined('PHPUNIT_COMPOSER_INSTALL')) {
$collectedLogs = [];
$previousHandler = set_error_handler(function ($type, $message, $file, $line) use (&$collectedLogs, &$previousHandler) {
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
if (\E_USER_DEPRECATED !== $type && \E_DEPRECATED !== $type) {
return $previousHandler ? $previousHandler($type, $message, $file, $line) : false;
}
@@ -564,7 +561,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
return null;
}
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5);
$backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 5);
// Clean the trace by removing first frames added by the error handler itself.
for ($i = 0; isset($backtrace[$i]); ++$i) {
if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) {
@@ -609,7 +606,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
$this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
if ($lock) {
flock($lock, LOCK_UN);
flock($lock, \LOCK_UN);
fclose($lock);
}
@@ -623,7 +620,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
static $legacyContainers = [];
$oldContainerDir = \dirname($oldContainer->getFileName());
$legacyContainers[$oldContainerDir.'.legacy'] = true;
foreach (glob(\dirname($oldContainerDir).\DIRECTORY_SEPARATOR.'*.legacy', GLOB_NOSORT) as $legacyContainer) {
foreach (glob(\dirname($oldContainerDir).\DIRECTORY_SEPARATOR.'*.legacy', \GLOB_NOSORT) as $legacyContainer) {
if (!isset($legacyContainers[$legacyContainer]) && @unlink($legacyContainer)) {
(new Filesystem())->remove(substr($legacyContainer, 0, -7));
}
@@ -844,14 +841,14 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
$token = $tokens[$i];
if (!isset($token[1]) || 'b"' === $token) {
$rawChunk .= $token;
} elseif (T_START_HEREDOC === $token[0]) {
} elseif (\T_START_HEREDOC === $token[0]) {
$output .= $rawChunk.$token[1];
do {
$token = $tokens[++$i];
$output .= isset($token[1]) && 'b"' !== $token ? $token[1] : $token;
} while (T_END_HEREDOC !== $token[0]);
} while (\T_END_HEREDOC !== $token[0]);
$rawChunk = '';
} elseif (T_WHITESPACE === $token[0]) {
} elseif (\T_WHITESPACE === $token[0]) {
if ($ignoreSpace) {
$ignoreSpace = false;
@@ -860,13 +857,13 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
// replace multiple new lines with a single newline
$rawChunk .= preg_replace(['/\n{2,}/S'], "\n", $token[1]);
} elseif (\in_array($token[0], [T_COMMENT, T_DOC_COMMENT])) {
} elseif (\in_array($token[0], [\T_COMMENT, \T_DOC_COMMENT])) {
$ignoreSpace = true;
} else {
$rawChunk .= $token[1];
// The PHP-open tag already has a new-line
if (T_OPEN_TAG === $token[0]) {
if (\T_OPEN_TAG === $token[0]) {
$ignoreSpace = true;
}
}
@@ -885,7 +882,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
*/
public function serialize()
{
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.3.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.3.', __METHOD__), \E_USER_DEPRECATED);
return serialize([$this->environment, $this->debug]);
}
@@ -895,8 +892,8 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
*/
public function unserialize($data)
{
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.3.', __METHOD__), E_USER_DEPRECATED);
list($environment, $debug) = unserialize($data, ['allowed_classes' => false]);
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.3.', __METHOD__), \E_USER_DEPRECATED);
[$environment, $debug] = unserialize($data, ['allowed_classes' => false]);
$this->__construct($environment, $debug);
}
@@ -907,7 +904,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
public function __sleep()
{
if (__CLASS__ !== $c = (new \ReflectionMethod($this, 'serialize'))->getDeclaringClass()->name) {
@trigger_error(sprintf('Implementing the "%s::serialize()" method is deprecated since Symfony 4.3.', $c), E_USER_DEPRECATED);
@trigger_error(sprintf('Implementing the "%s::serialize()" method is deprecated since Symfony 4.3.', $c), \E_USER_DEPRECATED);
$this->serialized = $this->serialize();
return ['serialized'];
@@ -919,7 +916,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
public function __wakeup()
{
if (__CLASS__ !== $c = (new \ReflectionMethod($this, 'serialize'))->getDeclaringClass()->name) {
@trigger_error(sprintf('Implementing the "%s::serialize()" method is deprecated since Symfony 4.3.', $c), E_USER_DEPRECATED);
@trigger_error(sprintf('Implementing the "%s::serialize()" method is deprecated since Symfony 4.3.', $c), \E_USER_DEPRECATED);
$this->unserialize($this->serialized);
unset($this->serialized);

View File

@@ -37,10 +37,10 @@ class Logger extends AbstractLogger
private $formatter;
private $handle;
public function __construct(string $minLevel = null, $output = 'php://stderr', callable $formatter = null)
public function __construct(string $minLevel = null, $output = null, callable $formatter = null)
{
if (null === $minLevel) {
$minLevel = 'php://stdout' === $output || 'php://stderr' === $output ? LogLevel::CRITICAL : LogLevel::WARNING;
$minLevel = null === $output || 'php://stdout' === $output || 'php://stderr' === $output ? LogLevel::ERROR : LogLevel::WARNING;
if (isset($_ENV['SHELL_VERBOSITY']) || isset($_SERVER['SHELL_VERBOSITY'])) {
switch ((int) (isset($_ENV['SHELL_VERBOSITY']) ? $_ENV['SHELL_VERBOSITY'] : $_SERVER['SHELL_VERBOSITY'])) {
@@ -58,7 +58,7 @@ class Logger extends AbstractLogger
$this->minLevelIndex = self::$levels[$minLevel];
$this->formatter = $formatter ?: [$this, 'format'];
if (false === $this->handle = \is_resource($output) ? $output : @fopen($output, 'a')) {
if ($output && false === $this->handle = \is_resource($output) ? $output : @fopen($output, 'a')) {
throw new InvalidArgumentException(sprintf('Unable to open "%s".', $output));
}
}
@@ -79,10 +79,14 @@ class Logger extends AbstractLogger
}
$formatter = $this->formatter;
@fwrite($this->handle, $formatter($level, $message, $context));
if ($this->handle) {
@fwrite($this->handle, $formatter($level, $message, $context));
} else {
error_log($formatter($level, $message, $context, false));
}
}
private function format(string $level, string $message, array $context): string
private function format(string $level, string $message, array $context, bool $prefixDate = true): string
{
if (false !== strpos($message, '{')) {
$replacements = [];
@@ -101,6 +105,11 @@ class Logger extends AbstractLogger
$message = strtr($message, $replacements);
}
return sprintf('%s [%s] %s', date(\DateTime::RFC3339), $level, $message).PHP_EOL;
$log = sprintf('[%s] %s', $level, $message).\PHP_EOL;
if ($prefixDate) {
$log = date(\DateTime::RFC3339).' '.$log;
}
return $log;
}
}

View File

@@ -56,12 +56,12 @@ class FileProfilerStorage implements ProfilerStorageInterface
}
$file = fopen($file, 'r');
fseek($file, 0, SEEK_END);
fseek($file, 0, \SEEK_END);
$result = [];
while (\count($result) < $limit && $line = $this->readLineFromFile($file)) {
$values = str_getcsv($line);
list($csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode) = $values;
[$csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode] = $values;
$csvTime = (int) $csvTime;
if ($ip && false === strpos($csvIp, $ip) || $url && false === strpos($csvUrl, $url) || $method && false === strpos($csvMethod, $method) || $statusCode && false === strpos($csvStatusCode, $statusCode)) {
@@ -260,7 +260,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
$position += $upTo;
$line = substr($buffer, $upTo + 1).$line;
fseek($file, max(0, $position), SEEK_SET);
fseek($file, max(0, $position), \SEEK_SET);
if ('' !== $line) {
break;

View File

@@ -65,7 +65,7 @@
<div class="wrapper">
<div class="warning">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" width="32"><path fill="currentColor" d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z" class=""></path></svg>
You're seeing this page because you haven't configured any homepage URL.
You're seeing this page because you haven't configured any homepage URL and <a href="https://symfony.com/doc/<?= $docVersion; ?>/debug-mode" style="padding: 0 7px">debug mode</a> is enabled.
</div>
<div class="container">

View File

@@ -89,7 +89,7 @@ class UriSigner
private function buildUrl(array $url, array $params = []): string
{
ksort($params, SORT_STRING);
ksort($params, \SORT_STRING);
$url['query'] = http_build_query($params, '', '&');
$scheme = isset($url['scheme']) ? $url['scheme'].'://' : '';

View File

@@ -16,12 +16,14 @@
}
],
"require": {
"php": "^7.1.3",
"php": ">=7.1.3",
"symfony/error-handler": "^4.4",
"symfony/event-dispatcher": "^4.4",
"symfony/http-client-contracts": "^1.1|^2",
"symfony/http-foundation": "^4.4|^5.0",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-php73": "^1.9",
"symfony/polyfill-php80": "^1.15",
"psr/log": "~1.0"
},
"require-dev": {
@@ -65,10 +67,5 @@
"/Tests/"
]
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "4.4-dev"
}
}
"minimum-stability": "dev"
}