N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)

* Update Symfony lib to version ~6.4.0
* Update code missing return type
* Add an iTop general configuration entry to store application secret (Symfony mandatory parameter)
* Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
bdalsass
2023-12-05 13:56:56 +01:00
committed by GitHub
parent 863ab4560c
commit 27ce51ab07
1392 changed files with 44869 additions and 27799 deletions

View File

@@ -20,23 +20,20 @@ use Symfony\Component\Cache\Exception\CacheException;
*/
class DefaultMarshaller implements MarshallerInterface
{
private $useIgbinarySerialize = true;
private $throwOnSerializationFailure;
private bool $useIgbinarySerialize = true;
private bool $throwOnSerializationFailure = false;
public function __construct(bool $useIgbinarySerialize = null, bool $throwOnSerializationFailure = false)
{
if (null === $useIgbinarySerialize) {
$useIgbinarySerialize = \extension_loaded('igbinary') && (\PHP_VERSION_ID < 70400 || version_compare('3.1.6', phpversion('igbinary'), '<='));
} elseif ($useIgbinarySerialize && (!\extension_loaded('igbinary') || (\PHP_VERSION_ID >= 70400 && version_compare('3.1.6', phpversion('igbinary'), '>')))) {
throw new CacheException(\extension_loaded('igbinary') && \PHP_VERSION_ID >= 70400 ? 'Please upgrade the "igbinary" PHP extension to v3.1.6 or higher.' : 'The "igbinary" PHP extension is not loaded.');
$useIgbinarySerialize = \extension_loaded('igbinary') && version_compare('3.1.6', phpversion('igbinary'), '<=');
} elseif ($useIgbinarySerialize && (!\extension_loaded('igbinary') || version_compare('3.1.6', phpversion('igbinary'), '>'))) {
throw new CacheException(\extension_loaded('igbinary') ? 'Please upgrade the "igbinary" PHP extension to v3.1.6 or higher.' : 'The "igbinary" PHP extension is not loaded.');
}
$this->useIgbinarySerialize = $useIgbinarySerialize;
$this->throwOnSerializationFailure = $throwOnSerializationFailure;
}
/**
* {@inheritdoc}
*/
public function marshall(array $values, ?array &$failed): array
{
$serialized = $failed = [];
@@ -59,10 +56,7 @@ class DefaultMarshaller implements MarshallerInterface
return $serialized;
}
/**
* {@inheritdoc}
*/
public function unmarshall(string $value)
public function unmarshall(string $value): mixed
{
if ('b:0;' === $value) {
return false;
@@ -71,7 +65,7 @@ class DefaultMarshaller implements MarshallerInterface
return null;
}
static $igbinaryNull;
if ($value === ($igbinaryNull ?? $igbinaryNull = \extension_loaded('igbinary') ? igbinary_serialize(null) : false)) {
if ($value === $igbinaryNull ??= \extension_loaded('igbinary') ? igbinary_serialize(null) : false) {
return null;
}
$unserializeCallbackHandler = ini_set('unserialize_callback_func', __CLASS__.'::handleUnserializeCallback');
@@ -97,7 +91,7 @@ class DefaultMarshaller implements MarshallerInterface
/**
* @internal
*/
public static function handleUnserializeCallback(string $class)
public static function handleUnserializeCallback(string $class): never
{
throw new \DomainException('Class not found: '.$class);
}