Skip to content

Commit 3ec1622

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: fixed a typo in the upgrade guide [Mime] Update mime types [Security] Avoid extra warning when preloading file when EL is not installed [PasswordHasher] Fix documentation link [HttpKernel] Backport type declaration fixes Run PHP 8.1 CI with all extensions
2 parents a9ad831 + 5dc09b7 commit 3ec1622

12 files changed

+51
-17
lines changed

CacheClearer/ChainCacheClearer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class ChainCacheClearer implements CacheClearerInterface
2222
{
2323
private $clearers;
2424

25+
/**
26+
* @param iterable<mixed, CacheClearerInterface> $clearers
27+
*/
2528
public function __construct(iterable $clearers = [])
2629
{
2730
$this->clearers = $clearers;

CacheClearer/Psr6CacheClearer.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,32 @@
1111

1212
namespace Symfony\Component\HttpKernel\CacheClearer;
1313

14+
use Psr\Cache\CacheItemPoolInterface;
15+
1416
/**
1517
* @author Nicolas Grekas <p@tchwork.com>
1618
*/
1719
class Psr6CacheClearer implements CacheClearerInterface
1820
{
1921
private $pools = [];
2022

23+
/**
24+
* @param array<string, CacheItemPoolInterface> $pools
25+
*/
2126
public function __construct(array $pools = [])
2227
{
2328
$this->pools = $pools;
2429
}
2530

26-
public function hasPool(string $name)
31+
public function hasPool(string $name): bool
2732
{
2833
return isset($this->pools[$name]);
2934
}
3035

31-
public function getPool(string $name)
36+
/**
37+
* @throws \InvalidArgumentException If the cache pool with the given name does not exist
38+
*/
39+
public function getPool(string $name): CacheItemPoolInterface
3240
{
3341
if (!$this->hasPool($name)) {
3442
throw new \InvalidArgumentException(sprintf('Cache pool not found: "%s".', $name));
@@ -37,7 +45,10 @@ public function getPool(string $name)
3745
return $this->pools[$name];
3846
}
3947

40-
public function clearPool(string $name)
48+
/**
49+
* @throws \InvalidArgumentException If the cache pool with the given name does not exist
50+
*/
51+
public function clearPool(string $name): bool
4152
{
4253
if (!isset($this->pools[$name])) {
4354
throw new \InvalidArgumentException(sprintf('Cache pool not found: "%s".', $name));

CacheWarmer/CacheWarmerAggregate.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class CacheWarmerAggregate implements CacheWarmerInterface
2626
private $optionalsEnabled = false;
2727
private $onlyOptionalsEnabled = false;
2828

29+
/**
30+
* @param iterable<mixed, CacheWarmerInterface> $warmers
31+
*/
2932
public function __construct(iterable $warmers = [], bool $debug = false, string $deprecationLogsFilepath = null)
3033
{
3134
$this->warmers = $warmers;

Controller/ArgumentResolver.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@
2828
final class ArgumentResolver implements ArgumentResolverInterface
2929
{
3030
private $argumentMetadataFactory;
31+
private $argumentValueResolvers;
3132

3233
/**
33-
* @var iterable|ArgumentValueResolverInterface[]
34+
* @param iterable<mixed, ArgumentValueResolverInterface> $argumentValueResolvers
3435
*/
35-
private $argumentValueResolvers;
36-
3736
public function __construct(ArgumentMetadataFactoryInterface $argumentMetadataFactory = null, iterable $argumentValueResolvers = [])
3837
{
3938
$this->argumentMetadataFactory = $argumentMetadataFactory ?? new ArgumentMetadataFactory();
@@ -83,6 +82,9 @@ public function getArguments(Request $request, callable $controller): array
8382
return $arguments;
8483
}
8584

85+
/**
86+
* @return iterable<int, ArgumentValueResolverInterface>
87+
*/
8688
public static function getDefaultArgumentValueResolvers(): iterable
8789
{
8890
return [

DependencyInjection/LazyLoadingFragmentHandler.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
class LazyLoadingFragmentHandler extends FragmentHandler
2525
{
2626
private $container;
27+
28+
/**
29+
* @var array<string, bool>
30+
*/
2731
private $initialized = [];
2832

2933
public function __construct(ContainerInterface $container, RequestStack $requestStack, bool $debug = false)

DependencyInjection/MergeExtensionConfigurationPass.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class MergeExtensionConfigurationPass extends BaseMergeExtensionConfigurationPas
2323
{
2424
private $extensions;
2525

26+
/**
27+
* @param string[] $extensions
28+
*/
2629
public function __construct(array $extensions)
2730
{
2831
$this->extensions = $extensions;

DependencyInjection/ServicesResetter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class ServicesResetter implements ResetInterface
2626
private $resettableServices;
2727
private $resetMethods;
2828

29+
/**
30+
* @param \Traversable<string, object> $resettableServices
31+
* @param array<string, string|string[]> $resetMethods
32+
*/
2933
public function __construct(\Traversable $resettableServices, array $resetMethods)
3034
{
3135
$this->resettableServices = $resettableServices;

EventListener/DebugHandlersListener.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ class DebugHandlersListener implements EventSubscriberInterface
4343
private $hasTerminatedWithException;
4444

4545
/**
46-
* @param callable|null $exceptionHandler A handler that must support \Throwable instances that will be called on Exception
47-
* @param array|int $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants
48-
* @param int|null $throwAt Thrown errors in a bit field of E_* constants, or null to keep the current value
49-
* @param bool $scream Enables/disables screaming mode, where even silenced errors are logged
50-
* @param bool $scope Enables/disables scoping mode
46+
* @param callable|null $exceptionHandler A handler that must support \Throwable instances that will be called on Exception
47+
* @param array|int|null $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants
48+
* @param int|null $throwAt Thrown errors in a bit field of E_* constants, or null to keep the current value
49+
* @param bool $scream Enables/disables screaming mode, where even silenced errors are logged
50+
* @param bool $scope Enables/disables scoping mode
5151
*/
5252
public function __construct(callable $exceptionHandler = null, LoggerInterface $logger = null, $levels = \E_ALL, ?int $throwAt = \E_ALL, bool $scream = true, bool $scope = true, LoggerInterface $deprecationLogger = null)
5353
{

EventListener/RouterListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function __construct(UrlMatcherInterface|RequestMatcherInterface $matcher
6565
}
6666

6767
$this->matcher = $matcher;
68-
$this->context = $context ?: $matcher->getContext();
68+
$this->context = $context ?? $matcher->getContext();
6969
$this->requestStack = $requestStack;
7070
$this->logger = $logger;
7171
$this->projectDir = $projectDir;

HttpKernel.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ public function __construct(EventDispatcherInterface $dispatcher, ControllerReso
6060
$this->dispatcher = $dispatcher;
6161
$this->resolver = $resolver;
6262
$this->requestStack = $requestStack ?? new RequestStack();
63-
$this->argumentResolver = $argumentResolver;
64-
65-
if (null === $this->argumentResolver) {
66-
$this->argumentResolver = new ArgumentResolver();
67-
}
63+
$this->argumentResolver = $argumentResolver ?? new ArgumentResolver();
6864
}
6965

7066
/**

0 commit comments

Comments
 (0)