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

@@ -68,15 +68,15 @@ class MockArraySessionStorage implements SessionStorageInterface
$this->setMetadataBag($metaBag);
}
/**
* @return void
*/
public function setSessionData(array $array)
{
$this->data = $array;
}
/**
* {@inheritdoc}
*/
public function start()
public function start(): bool
{
if ($this->started) {
return true;
@@ -91,10 +91,7 @@ class MockArraySessionStorage implements SessionStorageInterface
return true;
}
/**
* {@inheritdoc}
*/
public function regenerate(bool $destroy = false, int $lifetime = null)
public function regenerate(bool $destroy = false, int $lifetime = null): bool
{
if (!$this->started) {
$this->start();
@@ -106,16 +103,13 @@ class MockArraySessionStorage implements SessionStorageInterface
return true;
}
/**
* {@inheritdoc}
*/
public function getId()
public function getId(): string
{
return $this->id;
}
/**
* {@inheritdoc}
* @return void
*/
public function setId(string $id)
{
@@ -126,16 +120,13 @@ class MockArraySessionStorage implements SessionStorageInterface
$this->id = $id;
}
/**
* {@inheritdoc}
*/
public function getName()
public function getName(): string
{
return $this->name;
}
/**
* {@inheritdoc}
* @return void
*/
public function setName(string $name)
{
@@ -143,7 +134,7 @@ class MockArraySessionStorage implements SessionStorageInterface
}
/**
* {@inheritdoc}
* @return void
*/
public function save()
{
@@ -156,7 +147,7 @@ class MockArraySessionStorage implements SessionStorageInterface
}
/**
* {@inheritdoc}
* @return void
*/
public function clear()
{
@@ -173,17 +164,14 @@ class MockArraySessionStorage implements SessionStorageInterface
}
/**
* {@inheritdoc}
* @return void
*/
public function registerBag(SessionBagInterface $bag)
{
$this->bags[$bag->getName()] = $bag;
}
/**
* {@inheritdoc}
*/
public function getBag(string $name)
public function getBag(string $name): SessionBagInterface
{
if (!isset($this->bags[$name])) {
throw new \InvalidArgumentException(sprintf('The SessionBagInterface "%s" is not registered.', $name));
@@ -196,29 +184,26 @@ class MockArraySessionStorage implements SessionStorageInterface
return $this->bags[$name];
}
/**
* {@inheritdoc}
*/
public function isStarted()
public function isStarted(): bool
{
return $this->started;
}
/**
* @return void
*/
public function setMetadataBag(MetadataBag $bag = null)
{
if (null === $bag) {
$bag = new MetadataBag();
if (1 > \func_num_args()) {
trigger_deprecation('symfony/http-foundation', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
}
$this->metadataBag = $bag;
$this->metadataBag = $bag ?? new MetadataBag();
}
/**
* Gets the MetadataBag.
*
* @return MetadataBag
*/
public function getMetadataBag()
public function getMetadataBag(): MetadataBag
{
return $this->metadataBag;
}
@@ -228,21 +213,22 @@ class MockArraySessionStorage implements SessionStorageInterface
*
* This doesn't need to be particularly cryptographically secure since this is just
* a mock.
*
* @return string
*/
protected function generateId()
protected function generateId(): string
{
return hash('sha256', uniqid('ss_mock_', true));
}
/**
* @return void
*/
protected function loadSession()
{
$bags = array_merge($this->bags, [$this->metadataBag]);
foreach ($bags as $bag) {
$key = $bag->getStorageKey();
$this->data[$key] = $this->data[$key] ?? [];
$this->data[$key] ??= [];
$bag->initialize($this->data[$key]);
}