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,11 +20,11 @@ use Psr\Container\NotFoundExceptionInterface;
*/
class ParameterNotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface
{
private $key;
private $sourceId;
private $sourceKey;
private $alternatives;
private $nonNestedAlternative;
private string $key;
private ?string $sourceId;
private ?string $sourceKey;
private array $alternatives;
private ?string $nonNestedAlternative;
/**
* @param string $key The requested parameter key
@@ -47,12 +47,17 @@ class ParameterNotFoundException extends InvalidArgumentException implements Not
$this->updateRepr();
}
/**
* @return void
*/
public function updateRepr()
{
if (null !== $this->sourceId) {
$this->message = sprintf('The service "%s" has a dependency on a non-existent parameter "%s".', $this->sourceId, $this->key);
} elseif (null !== $this->sourceKey) {
$this->message = sprintf('The parameter "%s" has a dependency on a non-existent parameter "%s".', $this->sourceKey, $this->key);
} elseif ('.' === ($this->key[0] ?? '')) {
$this->message = sprintf('Parameter "%s" not found. It was probably deleted during the compilation of the container.', $this->key);
} else {
$this->message = sprintf('You have requested a non-existent parameter "%s".', $this->key);
}
@@ -69,21 +74,33 @@ class ParameterNotFoundException extends InvalidArgumentException implements Not
}
}
/**
* @return string
*/
public function getKey()
{
return $this->key;
}
/**
* @return string|null
*/
public function getSourceId()
{
return $this->sourceId;
}
/**
* @return string|null
*/
public function getSourceKey()
{
return $this->sourceKey;
}
/**
* @return void
*/
public function setSourceId(?string $sourceId)
{
$this->sourceId = $sourceId;
@@ -91,6 +108,9 @@ class ParameterNotFoundException extends InvalidArgumentException implements Not
$this->updateRepr();
}
/**
* @return void
*/
public function setSourceKey(?string $sourceKey)
{
$this->sourceKey = $sourceKey;