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,8 +20,8 @@ namespace Symfony\Component\Config\Resource;
*/
class DirectoryResource implements SelfCheckingResourceInterface
{
private $resource;
private $pattern;
private string $resource;
private ?string $pattern;
/**
* @param string $resource The file path to the resource
@@ -31,17 +31,19 @@ class DirectoryResource implements SelfCheckingResourceInterface
*/
public function __construct(string $resource, string $pattern = null)
{
$this->resource = realpath($resource) ?: (file_exists($resource) ? $resource : false);
$resolvedResource = realpath($resource) ?: (file_exists($resource) ? $resource : false);
$this->pattern = $pattern;
if (false === $this->resource || !is_dir($this->resource)) {
if (false === $resolvedResource || !is_dir($resolvedResource)) {
throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist.', $resource));
}
$this->resource = $resolvedResource;
}
public function __toString(): string
{
return md5(serialize([$this->resource, $this->pattern]));
return hash('xxh128', serialize([$this->resource, $this->pattern]));
}
public function getResource(): string
@@ -54,9 +56,6 @@ class DirectoryResource implements SelfCheckingResourceInterface
return $this->pattern;
}
/**
* {@inheritdoc}
*/
public function isFresh(int $timestamp): bool
{
if (!is_dir($this->resource)) {
@@ -82,7 +81,7 @@ class DirectoryResource implements SelfCheckingResourceInterface
// for broken links
try {
$fileMTime = $file->getMTime();
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
continue;
}