diff --git a/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php b/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php index bca2ea2c170da..bbee8cea3f3f8 100644 --- a/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php +++ b/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php @@ -34,7 +34,7 @@ public function __construct(ManagerRegistry $registry) /** * This cache warmer is not optional, without proxies fatal error occurs! * - * @return false + * @return bool */ public function isOptional() { diff --git a/src/Symfony/Bridge/Doctrine/Tests/IdGenerator/UuidGeneratorTest.php b/src/Symfony/Bridge/Doctrine/Tests/IdGenerator/UuidGeneratorTest.php index bfca276a811ba..34367b0bd7213 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/IdGenerator/UuidGeneratorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/IdGenerator/UuidGeneratorTest.php @@ -14,7 +14,6 @@ use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator; use Symfony\Component\Uid\Factory\UuidFactory; -use Symfony\Component\Uid\NilUuid; use Symfony\Component\Uid\Uuid; use Symfony\Component\Uid\UuidV4; use Symfony\Component\Uid\UuidV6; @@ -35,7 +34,7 @@ public function testUuidCanBeGenerated() public function testCustomUuidfactory() { - $uuid = new NilUuid(); + $uuid = new UuidV4(); $em = new EntityManager(); $factory = $this->createMock(UuidFactory::class); $factory->expects($this->any()) diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php index 29276a0dcecce..17e066045a04c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php @@ -49,7 +49,7 @@ public function warmUp(string $cacheDir) spl_autoload_register([ClassExistenceResource::class, 'throwOnRequiredClass']); try { if (!$this->doWarmUp($cacheDir, $arrayAdapter)) { - return; + return []; } } finally { spl_autoload_unregister([ClassExistenceResource::class, 'throwOnRequiredClass']); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/RouterCacheWarmerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/RouterCacheWarmerTest.php index 9e792eb278d5c..61214b039c64a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/RouterCacheWarmerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/RouterCacheWarmerTest.php @@ -28,7 +28,7 @@ public function testWarmUpWithWarmebleInterface() $routerCacheWarmer = new RouterCacheWarmer($containerMock); $routerCacheWarmer->warmUp('/tmp'); - $routerMock->expects($this->any())->method('warmUp')->with('/tmp')->willReturn(''); + $routerMock->expects($this->any())->method('warmUp')->with('/tmp')->willReturn([]); $this->addToAssertionCount(1); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php b/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php index f043d53f4e0d8..0c4deee36d8d3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php +++ b/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php @@ -100,7 +100,7 @@ public function warmUp(string $cacheDir) { // skip warmUp when translator doesn't use cache if (null === $this->options['cache_dir']) { - return; + return []; } $localesToWarmUp = $this->enabledLocales ?: array_merge($this->getFallbackLocales(), [$this->getLocale()], $this->resourceLocales); diff --git a/src/Symfony/Component/Cache/Traits/RedisTrait.php b/src/Symfony/Component/Cache/Traits/RedisTrait.php index 86878198c7724..d054882d2788f 100644 --- a/src/Symfony/Component/Cache/Traits/RedisTrait.php +++ b/src/Symfony/Component/Cache/Traits/RedisTrait.php @@ -84,7 +84,7 @@ private function init($redis, string $namespace, int $defaultLifetime, ?Marshall * * @param array $options See self::$defaultConnectionOptions * - * @return \Redis|\RedisCluster|RedisClusterProxy|RedisProxy|\Predis\ClientInterface According to the "class" option + * @return \Redis|\RedisArray|\RedisCluster|RedisClusterProxy|RedisProxy|\Predis\ClientInterface According to the "class" option * * @throws InvalidArgumentException when the DSN is invalid */ diff --git a/src/Symfony/Component/Console/Helper/HelperInterface.php b/src/Symfony/Component/Console/Helper/HelperInterface.php index 1ce823587e4a7..e3b7f92561d0a 100644 --- a/src/Symfony/Component/Console/Helper/HelperInterface.php +++ b/src/Symfony/Component/Console/Helper/HelperInterface.php @@ -26,7 +26,7 @@ public function setHelperSet(HelperSet $helperSet = null); /** * Gets the helper set associated with this helper. * - * @return HelperSet A HelperSet instance + * @return HelperSet|null */ public function getHelperSet(); diff --git a/src/Symfony/Component/Console/Tests/Fixtures/FooLock2Command.php b/src/Symfony/Component/Console/Tests/Fixtures/FooLock2Command.php index 4e4656f20f2d4..dcf78bee7432c 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/FooLock2Command.php +++ b/src/Symfony/Component/Console/Tests/Fixtures/FooLock2Command.php @@ -14,7 +14,7 @@ protected function configure() $this->setName('foo:lock2'); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { try { $this->lock(); diff --git a/src/Symfony/Component/Console/Tests/Fixtures/FooLockCommand.php b/src/Symfony/Component/Console/Tests/Fixtures/FooLockCommand.php index dfa28a6bec1f1..103954f4fb7e7 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/FooLockCommand.php +++ b/src/Symfony/Component/Console/Tests/Fixtures/FooLockCommand.php @@ -14,7 +14,7 @@ protected function configure() $this->setName('foo:lock'); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { if (!$this->lock()) { return 1; diff --git a/src/Symfony/Component/Console/Tests/Fixtures/TestCommand.php b/src/Symfony/Component/Console/Tests/Fixtures/TestCommand.php index 4fb0410b72944..7de01cebe92d4 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/TestCommand.php +++ b/src/Symfony/Component/Console/Tests/Fixtures/TestCommand.php @@ -16,7 +16,7 @@ protected function configure() ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $output->writeln('execute called'); diff --git a/src/Symfony/Component/DependencyInjection/Definition.php b/src/Symfony/Component/DependencyInjection/Definition.php index 90f8f886cd942..a3744a65ac4bc 100644 --- a/src/Symfony/Component/DependencyInjection/Definition.php +++ b/src/Symfony/Component/DependencyInjection/Definition.php @@ -812,7 +812,7 @@ public function setConfigurator($configurator) /** * Gets the configurator to call after the service is fully initialized. * - * @return callable|array|null + * @return string|array|null */ public function getConfigurator() { diff --git a/src/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php b/src/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php index a8337d4e66e62..fe2b91a2a49f9 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php @@ -36,7 +36,7 @@ public function __construct(ContainerBuilder $container, string $env = null) */ public function load($resource, string $type = null) { - $resource($this->container, $this->env); + return $resource($this->container, $this->env); } /** diff --git a/src/Symfony/Component/DependencyInjection/Loader/DirectoryLoader.php b/src/Symfony/Component/DependencyInjection/Loader/DirectoryLoader.php index d4b454a1e8133..b4e9a5917c972 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/DirectoryLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/DirectoryLoader.php @@ -38,6 +38,8 @@ public function load($file, string $type = null) $this->import($dir, null, false, $path); } } + + return null; } /** diff --git a/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php index 299b6f5a1ff97..f5f78e30f0096 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php @@ -63,7 +63,7 @@ public function import($resource, string $type = null, $ignoreErrors = false, st } try { - parent::import(...$args); + return parent::import(...$args); } catch (LoaderLoadException $e) { if (!$ignoreNotFound || !($prev = $e->getPrevious()) instanceof FileLocatorFileNotFoundException) { throw $e; @@ -79,6 +79,8 @@ public function import($resource, string $type = null, $ignoreErrors = false, st throw $e; } } + + return null; } /** diff --git a/src/Symfony/Component/DependencyInjection/Loader/GlobFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/GlobFileLoader.php index 53af9cf2b8a18..e38aaf43bedab 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/GlobFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/GlobFileLoader.php @@ -28,6 +28,8 @@ public function load($resource, string $type = null) } $this->container->addResource($globResource); + + return null; } /** diff --git a/src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php index fbf313878b807..d88d7a6307b86 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php @@ -50,6 +50,8 @@ public function load($resource, string $type = null) $this->container->setParameter($key, $this->phpize($value)); } } + + return null; } /** diff --git a/src/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php index 50e8b13839b09..b1e9038ae1e18 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php @@ -70,6 +70,8 @@ public function load($resource, string $type = null) $this->instanceof = []; $this->registerAliasesForSinglyImplementedInterfaces(); } + + return null; } /** diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index f8375d9acd56d..0d5c36e14e916 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -66,6 +66,8 @@ public function load($resource, string $type = null) } } } + + return null; } private function loadXml(\DOMDocument $xml, string $path, \DOMNode $root = null): void diff --git a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php index 85c884f354fe4..395fbccd1ac4b 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php @@ -126,7 +126,7 @@ public function load($resource, string $type = null) // empty file if (null === $content) { - return; + return null; } $this->loadContent($content, $path); @@ -145,6 +145,8 @@ public function load($resource, string $type = null) $this->env = $env; } } + + return null; } private function loadContent(array $content, string $path) diff --git a/src/Symfony/Component/DomCrawler/Field/FormField.php b/src/Symfony/Component/DomCrawler/Field/FormField.php index 3e71edef40da1..00cea429b31af 100644 --- a/src/Symfony/Component/DomCrawler/Field/FormField.php +++ b/src/Symfony/Component/DomCrawler/Field/FormField.php @@ -89,7 +89,7 @@ public function getName() /** * Gets the value of the field. * - * @return string|array The value of the field + * @return string|array|null */ public function getValue() { diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php index 40c4a3f78a06c..8a0af06762267 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php @@ -104,7 +104,7 @@ public function transform($value) * * @param string $value Percentage value * - * @return int|float Normalized value + * @return int|float|null * * @throws TransformationFailedException if the given value is not a string or * if the value could not be transformed diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index b45c9a1d2f3fd..0c12065c223bb 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -939,7 +939,7 @@ public function getScheme() * * The "X-Forwarded-Port" header must contain the client port. * - * @return int|string can be a string if fetched from the server bag + * @return int|string|null Can be a string if fetched from the server bag */ public function getPort() { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php b/src/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php index 5c42fcaa347eb..179d8ba381665 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php @@ -139,6 +139,7 @@ public function getLastUsed() public function clear() { // nothing to do + return null; } /** diff --git a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php index 2a1c80c915cd7..012c83f415681 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php @@ -22,6 +22,7 @@ use Symfony\Component\HttpKernel\Event\ControllerEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\VarDumper\Cloner\Data; /** * @author Fabien Potencier @@ -343,8 +344,8 @@ public function getRouteParams() /** * Gets the parsed controller. * - * @return array|string The controller as a string or array of data - * with keys 'class', 'method', 'file' and 'line' + * @return array|string|Data The controller as a string or array of data + * with keys 'class', 'method', 'file' and 'line' */ public function getController() { @@ -354,8 +355,8 @@ public function getController() /** * Gets the previous request attributes. * - * @return array|bool A legacy array of data from the previous redirection response - * or false otherwise + * @return array|Data|false A legacy array of data from the previous redirection response + * or false otherwise */ public function getRedirect() { diff --git a/src/Symfony/Component/HttpKernel/Profiler/Profile.php b/src/Symfony/Component/HttpKernel/Profiler/Profile.php index 99c0a3dedd668..b0728d080835b 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/Profile.php +++ b/src/Symfony/Component/HttpKernel/Profiler/Profile.php @@ -74,7 +74,7 @@ public function setParent(self $parent) /** * Returns the parent profile. * - * @return self + * @return self|null */ public function getParent() { diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php index 2b8b38501e98f..0c576e00ed4dd 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php @@ -22,6 +22,7 @@ use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionBagInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface; +use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface; use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; @@ -268,6 +269,8 @@ public function testItCollectsTheSessionTraceProperly() $session = $this->createMock(SessionInterface::class); $session->method('getMetadataBag')->willReturnCallback(static function () use ($collector) { $collector->collectSessionUsage(); + + return new MetadataBag(); }); $session->getMetadataBag(); diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php index 6bcad824fedb2..6c90943e6c202 100644 --- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -522,7 +522,7 @@ public function getNamespace(): string } /** - * @return false + * @return string|false */ public function getXsdValidationBasePath() { diff --git a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php index 23e4182b47a33..13dada9fadc19 100644 --- a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php +++ b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php @@ -147,7 +147,12 @@ public function testBindFailureShouldThrowAnException() public function testQueryForDn() { - $collection = new \ArrayIterator([new Entry('')]); + $collection = new class([new Entry('')]) extends \ArrayObject implements CollectionInterface { + public function toArray(): array + { + return $this->getArrayCopy(); + } + }; $query = $this->createMock(QueryInterface::class); $query->expects($this->once())->method('execute')->willReturn($collection); diff --git a/src/Symfony/Component/Routing/Matcher/ExpressionLanguageProvider.php b/src/Symfony/Component/Routing/Matcher/ExpressionLanguageProvider.php index 9b1bfe3fb4959..96bb7babf2076 100644 --- a/src/Symfony/Component/Routing/Matcher/ExpressionLanguageProvider.php +++ b/src/Symfony/Component/Routing/Matcher/ExpressionLanguageProvider.php @@ -34,8 +34,10 @@ public function __construct(ServiceProviderInterface $functions) */ public function getFunctions() { + $functions = []; + foreach ($this->functions->getProvidedServices() as $function => $type) { - yield new ExpressionFunction( + $functions[] = new ExpressionFunction( $function, static function (...$args) use ($function) { return sprintf('($context->getParameter(\'_functions\')->get(%s)(%s))', var_export($function, true), implode(', ', $args)); @@ -45,6 +47,8 @@ function ($values, ...$args) use ($function) { } ); } + + return $functions; } public function get(string $function): callable diff --git a/src/Symfony/Component/Runtime/Tests/phpt/kernel.php b/src/Symfony/Component/Runtime/Tests/phpt/kernel.php index e4ca8366e8abe..8b65a66bb4c4d 100644 --- a/src/Symfony/Component/Runtime/Tests/phpt/kernel.php +++ b/src/Symfony/Component/Runtime/Tests/phpt/kernel.php @@ -15,7 +15,7 @@ public function __construct(string $var) $this->var = $var; } - public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true) + public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true): Response { return new Response('OK Kernel '.$this->var); } diff --git a/src/Symfony/Component/Security/Http/Authenticator/AbstractAuthenticator.php b/src/Symfony/Component/Security/Http/Authenticator/AbstractAuthenticator.php index 3feab09ec0b14..f01ab340224be 100644 --- a/src/Symfony/Component/Security/Http/Authenticator/AbstractAuthenticator.php +++ b/src/Symfony/Component/Security/Http/Authenticator/AbstractAuthenticator.php @@ -28,8 +28,6 @@ abstract class AbstractAuthenticator implements AuthenticatorInterface /** * Shortcut to create a PostAuthenticationToken for you, if you don't really * care about which authenticated token you're using. - * - * @return PostAuthenticationToken */ public function createToken(Passport $passport, string $firewallName): TokenInterface { diff --git a/src/Symfony/Component/Security/Http/Authenticator/Passport/PassportTrait.php b/src/Symfony/Component/Security/Http/Authenticator/Passport/PassportTrait.php index 57d3591aa151a..d962a5964eb35 100644 --- a/src/Symfony/Component/Security/Http/Authenticator/Passport/PassportTrait.php +++ b/src/Symfony/Component/Security/Http/Authenticator/Passport/PassportTrait.php @@ -20,6 +20,9 @@ trait PassportTrait { private $badges = []; + /** + * @return $this + */ public function addBadge(BadgeInterface $badge): PassportInterface { $this->badges[\get_class($badge)] = $badge; diff --git a/src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php b/src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php index 767f553bf4d55..c9a41276c1dff 100644 --- a/src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php @@ -203,40 +203,6 @@ private function createLinker(array $options = [], array $extraProperties = ['em } } -class TestLoginLinkHandlerUserProvider implements UserProviderInterface -{ - private $users = []; - - public function createUser(TestLoginLinkHandlerUser $user): void - { - $this->users[$user->getUserIdentifier()] = $user; - } - - public function loadUserByUsername($username): TestLoginLinkHandlerUser - { - return $this->loadUserByIdentifier($username); - } - - public function loadUserByIdentifier(string $userIdentifier): TestLoginLinkHandlerUser - { - if (!isset($this->users[$userIdentifier])) { - throw new UserNotFoundException(); - } - - return clone $this->users[$userIdentifier]; - } - - public function refreshUser(UserInterface $user) - { - return $this->users[$username]; - } - - public function supportsClass(string $class) - { - return TestLoginLinkHandlerUser::class === $class; - } -} - class TestLoginLinkHandlerUser implements UserInterface { public $username; @@ -281,3 +247,37 @@ public function eraseCredentials() { } } + +class TestLoginLinkHandlerUserProvider implements UserProviderInterface +{ + private $users = []; + + public function createUser(TestLoginLinkHandlerUser $user): void + { + $this->users[$user->getUserIdentifier()] = $user; + } + + public function loadUserByUsername($username): TestLoginLinkHandlerUser + { + return $this->loadUserByIdentifier($username); + } + + public function loadUserByIdentifier(string $userIdentifier): TestLoginLinkHandlerUser + { + if (!isset($this->users[$userIdentifier])) { + throw new UserNotFoundException(); + } + + return clone $this->users[$userIdentifier]; + } + + public function refreshUser(UserInterface $user) + { + return $this->users[$username]; + } + + public function supportsClass(string $class) + { + return TestLoginLinkHandlerUser::class === $class; + } +} diff --git a/src/Symfony/Component/Validator/Tests/Mapping/MemberMetadataTest.php b/src/Symfony/Component/Validator/Tests/Mapping/MemberMetadataTest.php index 67931873637b5..32e40a964b129 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/MemberMetadataTest.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/MemberMetadataTest.php @@ -112,7 +112,7 @@ public function getPropertyValue($object) { } - protected function newReflectionMember($object): object + protected function newReflectionMember($object): \ReflectionMethod { } }