From 7f824fcf95701a588a8ff60becaa1e1bbbc2f1fe Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 3 Nov 2021 10:24:47 +0100 Subject: [PATCH] Add generic types to traversable implementations --- ...engerTransportDoctrineSchemaSubscriber.php | 2 +- ...doCacheAdapterDoctrineSchemaSubscriber.php | 2 +- ...eTokenProviderDoctrineSchemaSubscriber.php | 2 +- .../Handler/ElasticsearchLogstashHandler.php | 5 ++++ .../Twig/Extension/ProfilerExtension.php | 5 ++++ .../CacheWarmer/ExpressionCacheWarmer.php | 2 +- .../DependencyInjection/MainConfiguration.php | 5 +++- .../DependencyInjection/SecurityExtension.php | 2 +- .../Bundle/TwigBundle/TemplateIterator.php | 2 ++ .../Cache/Adapter/AdapterInterface.php | 2 +- .../Config/Resource/GlobResource.php | 2 ++ .../Config/ResourceCheckerConfigCache.php | 7 +++--- .../ResourceCheckerConfigCacheFactory.php | 2 +- .../Component/Console/Helper/HelperSet.php | 4 +++- .../DependencyInjection/Definition.php | 2 +- .../DependencyInjection/Dumper/PhpDumper.php | 3 +++ src/Symfony/Component/DomCrawler/Crawler.php | 4 +++- .../Debug/TraceableEventDispatcher.php | 3 +++ .../EventDispatcher/GenericEvent.php | 3 +++ src/Symfony/Component/Finder/Finder.php | 4 ++-- .../Finder/Iterator/CustomFilterIterator.php | 6 +++-- .../Iterator/DateRangeFilterIterator.php | 6 +++-- .../Iterator/DepthRangeFilterIterator.php | 11 ++++++--- .../ExcludeDirectoryFilterIterator.php | 3 +++ .../Iterator/FileTypeFilterIterator.php | 2 ++ .../Iterator/FilecontentFilterIterator.php | 2 ++ .../Iterator/FilenameFilterIterator.php | 2 ++ .../Iterator/MultiplePcreFilterIterator.php | 5 ++++ .../Finder/Iterator/PathFilterIterator.php | 2 ++ .../Iterator/SizeRangeFilterIterator.php | 6 +++-- .../Finder/Iterator/SortableIterator.php | 7 ++++-- src/Symfony/Component/Form/Button.php | 4 +++- src/Symfony/Component/Form/ButtonBuilder.php | 2 ++ .../Form/ChoiceList/View/ChoiceGroupView.php | 6 +++-- .../Validator/Constraints/FormValidator.php | 3 +++ .../ViolationMapper/ViolationPath.php | 2 +- src/Symfony/Component/Form/Form.php | 6 +++-- src/Symfony/Component/Form/FormBuilder.php | 4 +++- .../Component/Form/FormErrorIterator.php | 7 ++++-- src/Symfony/Component/Form/FormInterface.php | 3 +++ src/Symfony/Component/Form/FormView.php | 3 +++ .../Component/Form/Util/OrderedHashMap.php | 12 +++++++--- .../Form/Util/OrderedHashMapIterator.php | 23 +++++++++++-------- .../Component/HttpClient/HttplugClient.php | 5 ++++ .../HttpClient/Internal/HttplugWaitLoop.php | 5 ++++ .../HttpClient/Response/AsyncResponse.php | 6 +++++ .../Response/TransportResponseTrait.php | 2 ++ .../Component/HttpFoundation/HeaderBag.php | 11 ++++++--- .../Component/HttpFoundation/ParameterBag.php | 4 +++- .../Session/Attribute/AttributeBag.php | 4 +++- .../Attribute/AttributeBagInterface.php | 2 +- .../HttpFoundation/Session/Session.php | 4 +++- .../DataCollector/RequestDataCollector.php | 3 +++ .../DataCollector/RouterDataCollector.php | 2 +- .../EventListener/ProfilerListener.php | 4 ++++ .../Component/HttpKernel/HttpCache/Store.php | 6 ++--- .../Component/HttpKernel/KernelInterface.php | 2 +- .../Ldap/Adapter/CollectionInterface.php | 5 +++- .../Ldap/Adapter/ExtLdap/Collection.php | 4 ++-- .../Ldap/Adapter/ExtLdap/EntryManager.php | 2 +- .../Component/Ldap/Adapter/QueryInterface.php | 3 +-- .../Tests/Adapter/ExtLdap/LdapManagerTest.php | 6 ++--- .../Mailer/Transport/RoundRobinTransport.php | 3 +++ .../Handler/HandlersLocatorInterface.php | 2 +- .../Messenger/Middleware/StackMiddleware.php | 1 + .../Transport/Sender/SendersLocator.php | 4 ++-- .../Sender/SendersLocatorInterface.php | 2 +- .../Reply/Markup/InlineKeyboardMarkup.php | 2 +- .../Reply/Markup/ReplyKeyboardMarkup.php | 2 +- .../Transport/RoundRobinTransport.php | 3 +++ src/Symfony/Component/Process/InputStream.php | 4 +++- src/Symfony/Component/Process/Process.php | 4 +++- .../Component/PropertyAccess/PropertyPath.php | 4 +++- .../PropertyAccess/PropertyPathInterface.php | 4 +++- .../PropertyPathIteratorInterface.php | 4 +++- .../Extractor/ConstructorExtractor.php | 3 +-- .../PropertyInfo/PropertyInfoExtractor.php | 13 +++++++---- .../Routing/Loader/AnnotationClassLoader.php | 2 +- .../Component/Routing/RouteCollection.php | 4 +++- .../AuthenticationProviderManager.php | 4 ++-- .../TraceableAccessDecisionManager.php | 2 +- .../Security/Core/User/ChainUserProvider.php | 4 ++-- .../Firewall/GuardAuthenticationListener.php | 4 ++-- .../Provider/GuardAuthenticationProvider.php | 9 +++----- .../Component/Security/Http/Firewall.php | 6 +++++ .../Http/Firewall/ContextListener.php | 2 +- .../Security/Http/FirewallMapInterface.php | 4 +++- .../Validator/ConstraintViolationList.php | 6 +++-- .../ConstraintViolationListInterface.php | 3 +++ .../Validator/Constraints/GroupSequence.php | 2 +- .../Validator/Context/ExecutionContext.php | 4 ++++ .../Metadata/InMemoryMetadataStore.php | 3 +++ .../Workflow/TransitionBlockerList.php | 7 ++---- .../HttpClient/HttpClientInterface.php | 4 ++-- .../HttpClient/ResponseStreamInterface.php | 2 ++ 95 files changed, 280 insertions(+), 117 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/SchemaListener/MessengerTransportDoctrineSchemaSubscriber.php b/src/Symfony/Bridge/Doctrine/SchemaListener/MessengerTransportDoctrineSchemaSubscriber.php index 5b3798eb3918a..904d62bbf6552 100644 --- a/src/Symfony/Bridge/Doctrine/SchemaListener/MessengerTransportDoctrineSchemaSubscriber.php +++ b/src/Symfony/Bridge/Doctrine/SchemaListener/MessengerTransportDoctrineSchemaSubscriber.php @@ -31,7 +31,7 @@ final class MessengerTransportDoctrineSchemaSubscriber implements EventSubscribe private $transports; /** - * @param iterable|TransportInterface[] $transports + * @param iterable $transports */ public function __construct(iterable $transports) { diff --git a/src/Symfony/Bridge/Doctrine/SchemaListener/PdoCacheAdapterDoctrineSchemaSubscriber.php b/src/Symfony/Bridge/Doctrine/SchemaListener/PdoCacheAdapterDoctrineSchemaSubscriber.php index 3bf19205fb7cd..20ac1ed0efd1e 100644 --- a/src/Symfony/Bridge/Doctrine/SchemaListener/PdoCacheAdapterDoctrineSchemaSubscriber.php +++ b/src/Symfony/Bridge/Doctrine/SchemaListener/PdoCacheAdapterDoctrineSchemaSubscriber.php @@ -30,7 +30,7 @@ final class PdoCacheAdapterDoctrineSchemaSubscriber implements EventSubscriber private $pdoAdapters; /** - * @param iterable|PdoAdapter[] $pdoAdapters + * @param iterable $pdoAdapters */ public function __construct(iterable $pdoAdapters) { diff --git a/src/Symfony/Bridge/Doctrine/SchemaListener/RememberMeTokenProviderDoctrineSchemaSubscriber.php b/src/Symfony/Bridge/Doctrine/SchemaListener/RememberMeTokenProviderDoctrineSchemaSubscriber.php index 60a849789ef17..d5805196bdf30 100644 --- a/src/Symfony/Bridge/Doctrine/SchemaListener/RememberMeTokenProviderDoctrineSchemaSubscriber.php +++ b/src/Symfony/Bridge/Doctrine/SchemaListener/RememberMeTokenProviderDoctrineSchemaSubscriber.php @@ -28,7 +28,7 @@ final class RememberMeTokenProviderDoctrineSchemaSubscriber implements EventSubs private $rememberMeHandlers; /** - * @param iterable|RememberMeHandlerInterface[] $rememberMeHandlers + * @param iterable $rememberMeHandlers */ public function __construct(iterable $rememberMeHandlers) { diff --git a/src/Symfony/Bridge/Monolog/Handler/ElasticsearchLogstashHandler.php b/src/Symfony/Bridge/Monolog/Handler/ElasticsearchLogstashHandler.php index a59825f6ab1f4..080d8e620bace 100644 --- a/src/Symfony/Bridge/Monolog/Handler/ElasticsearchLogstashHandler.php +++ b/src/Symfony/Bridge/Monolog/Handler/ElasticsearchLogstashHandler.php @@ -20,6 +20,7 @@ use Symfony\Component\HttpClient\HttpClient; use Symfony\Contracts\HttpClient\Exception\ExceptionInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; +use Symfony\Contracts\HttpClient\ResponseInterface; /** * Push logs directly to Elasticsearch and format them according to Logstash specification. @@ -47,6 +48,10 @@ class ElasticsearchLogstashHandler extends AbstractHandler private $endpoint; private $index; private $client; + + /** + * @var \SplObjectStorage + */ private $responses; /** diff --git a/src/Symfony/Bridge/Twig/Extension/ProfilerExtension.php b/src/Symfony/Bridge/Twig/Extension/ProfilerExtension.php index fcc4396f1c9a1..51d6eba2da185 100644 --- a/src/Symfony/Bridge/Twig/Extension/ProfilerExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/ProfilerExtension.php @@ -12,6 +12,7 @@ namespace Symfony\Bridge\Twig\Extension; use Symfony\Component\Stopwatch\Stopwatch; +use Symfony\Component\Stopwatch\StopwatchEvent; use Twig\Extension\ProfilerExtension as BaseProfilerExtension; use Twig\Profiler\Profile; @@ -21,6 +22,10 @@ final class ProfilerExtension extends BaseProfilerExtension { private $stopwatch; + + /** + * @var \SplObjectStorage + */ private $events; public function __construct(Profile $profile, Stopwatch $stopwatch = null) diff --git a/src/Symfony/Bundle/SecurityBundle/CacheWarmer/ExpressionCacheWarmer.php b/src/Symfony/Bundle/SecurityBundle/CacheWarmer/ExpressionCacheWarmer.php index 1ca1f32ecd98e..d50f710d53038 100644 --- a/src/Symfony/Bundle/SecurityBundle/CacheWarmer/ExpressionCacheWarmer.php +++ b/src/Symfony/Bundle/SecurityBundle/CacheWarmer/ExpressionCacheWarmer.php @@ -21,7 +21,7 @@ class ExpressionCacheWarmer implements CacheWarmerInterface private $expressionLanguage; /** - * @param iterable|Expression[] $expressions + * @param iterable $expressions */ public function __construct(iterable $expressions, ExpressionLanguage $expressionLanguage) { diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php index 2ad66b3148b4f..e7eb3f0f2804a 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php @@ -42,7 +42,7 @@ class MainConfiguration implements ConfigurationInterface private $userProviderFactories; /** - * @param (SecurityFactoryInterface|AuthenticatorFactoryInterface)[] $factories + * @param array $factories */ public function __construct(array $factories, array $userProviderFactories) { @@ -219,6 +219,9 @@ private function addAccessControlSection(ArrayNodeDefinition $rootNode) ; } + /** + * @param array $factories + */ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $factories) { $firewallNodeBuilder = $rootNode diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index bb8c1b2f92fb3..2cfd73fead5b3 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -1188,7 +1188,7 @@ private function isValidIp(string $cidr): bool } /** - * @return (AuthenticatorFactoryInterface|SecurityFactoryInterface)[] + * @return array */ private function getSortedFactories(): array { diff --git a/src/Symfony/Bundle/TwigBundle/TemplateIterator.php b/src/Symfony/Bundle/TwigBundle/TemplateIterator.php index fc5034928ca58..8cc0ffc4df76f 100644 --- a/src/Symfony/Bundle/TwigBundle/TemplateIterator.php +++ b/src/Symfony/Bundle/TwigBundle/TemplateIterator.php @@ -20,6 +20,8 @@ * @author Fabien Potencier * * @internal + * + * @implements \IteratorAggregate */ class TemplateIterator implements \IteratorAggregate { diff --git a/src/Symfony/Component/Cache/Adapter/AdapterInterface.php b/src/Symfony/Component/Cache/Adapter/AdapterInterface.php index cbab77946fba7..f8dce866d2d66 100644 --- a/src/Symfony/Component/Cache/Adapter/AdapterInterface.php +++ b/src/Symfony/Component/Cache/Adapter/AdapterInterface.php @@ -34,7 +34,7 @@ public function getItem($key); /** * {@inheritdoc} * - * @return \Traversable|CacheItem[] + * @return \Traversable */ public function getItems(array $keys = []); diff --git a/src/Symfony/Component/Config/Resource/GlobResource.php b/src/Symfony/Component/Config/Resource/GlobResource.php index 31937bc9037e6..093f55916f008 100644 --- a/src/Symfony/Component/Config/Resource/GlobResource.php +++ b/src/Symfony/Component/Config/Resource/GlobResource.php @@ -22,6 +22,8 @@ * @author Nicolas Grekas * * @final + * + * @implements \IteratorAggregate */ class GlobResource implements \IteratorAggregate, SelfCheckingResourceInterface { diff --git a/src/Symfony/Component/Config/ResourceCheckerConfigCache.php b/src/Symfony/Component/Config/ResourceCheckerConfigCache.php index 0bfa3f27a5787..fa12fe9fa2ae1 100644 --- a/src/Symfony/Component/Config/ResourceCheckerConfigCache.php +++ b/src/Symfony/Component/Config/ResourceCheckerConfigCache.php @@ -29,13 +29,13 @@ class ResourceCheckerConfigCache implements ConfigCacheInterface private $file; /** - * @var iterable|ResourceCheckerInterface[] + * @var iterable */ private $resourceCheckers; /** - * @param string $file The absolute cache path - * @param iterable|ResourceCheckerInterface[] $resourceCheckers The ResourceCheckers to use for the freshness check + * @param string $file The absolute cache path + * @param iterable $resourceCheckers The ResourceCheckers to use for the freshness check */ public function __construct(string $file, iterable $resourceCheckers = []) { @@ -91,7 +91,6 @@ public function isFresh() $time = filemtime($this->file); foreach ($meta as $resource) { - /* @var ResourceInterface $resource */ foreach ($this->resourceCheckers as $checker) { if (!$checker->supports($resource)) { continue; // next checker diff --git a/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php b/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php index a789644cae13f..21b7433e884f8 100644 --- a/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php +++ b/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php @@ -22,7 +22,7 @@ class ResourceCheckerConfigCacheFactory implements ConfigCacheFactoryInterface private $resourceCheckers = []; /** - * @param iterable|ResourceCheckerInterface[] $resourceCheckers + * @param iterable $resourceCheckers */ public function __construct(iterable $resourceCheckers = []) { diff --git a/src/Symfony/Component/Console/Helper/HelperSet.php b/src/Symfony/Component/Console/Helper/HelperSet.php index be806ed9c9927..bab0aec3512c5 100644 --- a/src/Symfony/Component/Console/Helper/HelperSet.php +++ b/src/Symfony/Component/Console/Helper/HelperSet.php @@ -18,6 +18,8 @@ * HelperSet represents a set of helpers to be used with a command. * * @author Fabien Potencier + * + * @implements \IteratorAggregate */ class HelperSet implements \IteratorAggregate { @@ -98,7 +100,7 @@ public function getCommand() } /** - * @return \Traversable + * @return \Traversable */ #[\ReturnTypeWillChange] public function getIterator() diff --git a/src/Symfony/Component/DependencyInjection/Definition.php b/src/Symfony/Component/DependencyInjection/Definition.php index 00f6cda86ce47..b30137cc9859d 100644 --- a/src/Symfony/Component/DependencyInjection/Definition.php +++ b/src/Symfony/Component/DependencyInjection/Definition.php @@ -846,7 +846,7 @@ public function setAutowired(bool $autowired) /** * Gets bindings. * - * @return array|BoundArgument[] + * @return BoundArgument[] */ public function getBindings() { diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index e3d3622d18d58..c688bf9e27668 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -62,6 +62,9 @@ class PhpDumper extends Dumper */ public const NON_FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789_'; + /** + * @var \SplObjectStorage|null + */ private $definitionVariables; private $referenceVariables; private $variableCount; diff --git a/src/Symfony/Component/DomCrawler/Crawler.php b/src/Symfony/Component/DomCrawler/Crawler.php index f0a519454100b..f64e5b5dfa3af 100644 --- a/src/Symfony/Component/DomCrawler/Crawler.php +++ b/src/Symfony/Component/DomCrawler/Crawler.php @@ -18,6 +18,8 @@ * Crawler eases navigation of a list of \DOMNode objects. * * @author Fabien Potencier + * + * @implements \IteratorAggregate */ class Crawler implements \Countable, \IteratorAggregate { @@ -1129,7 +1131,7 @@ public function count() } /** - * @return \ArrayIterator|\DOMNode[] + * @return \ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() diff --git a/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php b/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php index 87d538eaf8f04..e1d2007fd1823 100644 --- a/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php +++ b/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php @@ -32,6 +32,9 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa protected $logger; protected $stopwatch; + /** + * @var \SplObjectStorage + */ private $callStack; private $dispatcher; private $wrappedListeners; diff --git a/src/Symfony/Component/EventDispatcher/GenericEvent.php b/src/Symfony/Component/EventDispatcher/GenericEvent.php index ec76329f6f8d1..51aa47bc00b63 100644 --- a/src/Symfony/Component/EventDispatcher/GenericEvent.php +++ b/src/Symfony/Component/EventDispatcher/GenericEvent.php @@ -19,6 +19,9 @@ * Encapsulates events thus decoupling the observer from the subject they encapsulate. * * @author Drak + * + * @implements \ArrayAccess + * @implements \IteratorAggregate */ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate { diff --git a/src/Symfony/Component/Finder/Finder.php b/src/Symfony/Component/Finder/Finder.php index 95640df48633e..8cc564cd67501 100644 --- a/src/Symfony/Component/Finder/Finder.php +++ b/src/Symfony/Component/Finder/Finder.php @@ -37,7 +37,7 @@ * * @author Fabien Potencier * - * @implements \IteratorAggregate + * @implements \IteratorAggregate */ class Finder implements \IteratorAggregate, \Countable { @@ -603,7 +603,7 @@ public function in($dirs) * * This method implements the IteratorAggregate interface. * - * @return \Iterator|SplFileInfo[] + * @return \Iterator * * @throws \LogicException if the in() method has not been called */ diff --git a/src/Symfony/Component/Finder/Iterator/CustomFilterIterator.php b/src/Symfony/Component/Finder/Iterator/CustomFilterIterator.php index 1ba62e6ff66c8..f7bf19b87613f 100644 --- a/src/Symfony/Component/Finder/Iterator/CustomFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/CustomFilterIterator.php @@ -18,14 +18,16 @@ * to remove files. * * @author Fabien Potencier + * + * @extends \FilterIterator */ class CustomFilterIterator extends \FilterIterator { private $filters = []; /** - * @param \Iterator $iterator The Iterator to filter - * @param callable[] $filters An array of PHP callbacks + * @param \Iterator $iterator The Iterator to filter + * @param callable[] $filters An array of PHP callbacks * * @throws \InvalidArgumentException */ diff --git a/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php b/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php index ccb6c58091f87..f592e1913bfb6 100644 --- a/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php @@ -17,14 +17,16 @@ * DateRangeFilterIterator filters out files that are not in the given date range (last modified dates). * * @author Fabien Potencier + * + * @extends \FilterIterator */ class DateRangeFilterIterator extends \FilterIterator { private $comparators = []; /** - * @param \Iterator $iterator The Iterator to filter - * @param DateComparator[] $comparators An array of DateComparator instances + * @param \Iterator $iterator + * @param DateComparator[] $comparators */ public function __construct(\Iterator $iterator, array $comparators) { diff --git a/src/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php b/src/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php index f54569eb20970..4a9a31b33bfba 100644 --- a/src/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php @@ -15,15 +15,20 @@ * DepthRangeFilterIterator limits the directory depth. * * @author Fabien Potencier + * + * @template TKey + * @template TValue + * + * @extends \FilterIterator */ class DepthRangeFilterIterator extends \FilterIterator { private $minDepth = 0; /** - * @param \RecursiveIteratorIterator $iterator The Iterator to filter - * @param int $minDepth The min depth - * @param int $maxDepth The max depth + * @param \RecursiveIteratorIterator<\RecursiveIterator> $iterator The Iterator to filter + * @param int $minDepth The min depth + * @param int $maxDepth The max depth */ public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth = 0, int $maxDepth = \PHP_INT_MAX) { diff --git a/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php b/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php index 8c791722df86c..d9e182c17af99 100644 --- a/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php @@ -15,6 +15,9 @@ * ExcludeDirectoryFilterIterator filters out directories. * * @author Fabien Potencier + * + * @extends \FilterIterator + * @implements \RecursiveIterator */ class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator { diff --git a/src/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php b/src/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php index 097aec8d674b5..793ae3509aae7 100644 --- a/src/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php @@ -15,6 +15,8 @@ * FileTypeFilterIterator only keeps files, directories, or both. * * @author Fabien Potencier + * + * @extends \FilterIterator */ class FileTypeFilterIterator extends \FilterIterator { diff --git a/src/Symfony/Component/Finder/Iterator/FilecontentFilterIterator.php b/src/Symfony/Component/Finder/Iterator/FilecontentFilterIterator.php index 8b2d6c554139d..79f8c29d3fd44 100644 --- a/src/Symfony/Component/Finder/Iterator/FilecontentFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/FilecontentFilterIterator.php @@ -16,6 +16,8 @@ * * @author Fabien Potencier * @author Włodzimierz Gajda + * + * @extends MultiplePcreFilterIterator */ class FilecontentFilterIterator extends MultiplePcreFilterIterator { diff --git a/src/Symfony/Component/Finder/Iterator/FilenameFilterIterator.php b/src/Symfony/Component/Finder/Iterator/FilenameFilterIterator.php index 8d2edaf073331..77b3b241937c6 100644 --- a/src/Symfony/Component/Finder/Iterator/FilenameFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/FilenameFilterIterator.php @@ -17,6 +17,8 @@ * FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string). * * @author Fabien Potencier + * + * @extends MultiplePcreFilterIterator */ class FilenameFilterIterator extends MultiplePcreFilterIterator { diff --git a/src/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php b/src/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php index 78a34abef8877..990517243d2c4 100644 --- a/src/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php @@ -15,6 +15,11 @@ * MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings). * * @author Fabien Potencier + * + * @template-covariant TKey + * @template-covariant TValue + * + * @extends \FilterIterator */ abstract class MultiplePcreFilterIterator extends \FilterIterator { diff --git a/src/Symfony/Component/Finder/Iterator/PathFilterIterator.php b/src/Symfony/Component/Finder/Iterator/PathFilterIterator.php index 28f50502087eb..7974c4ee31ef8 100644 --- a/src/Symfony/Component/Finder/Iterator/PathFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/PathFilterIterator.php @@ -16,6 +16,8 @@ * * @author Fabien Potencier * @author Włodzimierz Gajda + * + * @extends MultiplePcreFilterIterator */ class PathFilterIterator extends MultiplePcreFilterIterator { diff --git a/src/Symfony/Component/Finder/Iterator/SizeRangeFilterIterator.php b/src/Symfony/Component/Finder/Iterator/SizeRangeFilterIterator.php index e18fbc2bc02cf..575bf29b7e4ac 100644 --- a/src/Symfony/Component/Finder/Iterator/SizeRangeFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/SizeRangeFilterIterator.php @@ -17,14 +17,16 @@ * SizeRangeFilterIterator filters out files that are not in the given size range. * * @author Fabien Potencier + * + * @extends \FilterIterator */ class SizeRangeFilterIterator extends \FilterIterator { private $comparators = []; /** - * @param \Iterator $iterator The Iterator to filter - * @param NumberComparator[] $comparators An array of NumberComparator instances + * @param \Iterator $iterator + * @param NumberComparator[] $comparators */ public function __construct(\Iterator $iterator, array $comparators) { diff --git a/src/Symfony/Component/Finder/Iterator/SortableIterator.php b/src/Symfony/Component/Finder/Iterator/SortableIterator.php index 04ca8ebf28d1e..9afde5c25079f 100644 --- a/src/Symfony/Component/Finder/Iterator/SortableIterator.php +++ b/src/Symfony/Component/Finder/Iterator/SortableIterator.php @@ -15,6 +15,8 @@ * SortableIterator applies a sort on a given Iterator. * * @author Fabien Potencier + * + * @implements \IteratorAggregate */ class SortableIterator implements \IteratorAggregate { @@ -30,7 +32,8 @@ class SortableIterator implements \IteratorAggregate private $sort; /** - * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) + * @param \Traversable $iterator + * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) * * @throws \InvalidArgumentException */ @@ -79,7 +82,7 @@ public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = } /** - * @return \Traversable + * @return \Traversable */ #[\ReturnTypeWillChange] public function getIterator() diff --git a/src/Symfony/Component/Form/Button.php b/src/Symfony/Component/Form/Button.php index 54dd2695b55ca..10fc9521c95aa 100644 --- a/src/Symfony/Component/Form/Button.php +++ b/src/Symfony/Component/Form/Button.php @@ -18,6 +18,8 @@ * A form button. * * @author Bernhard Schussek + * + * @implements \IteratorAggregate */ class Button implements \IteratorAggregate, FormInterface { @@ -64,7 +66,7 @@ public function offsetExists($offset) * * @param mixed $offset * - * @return mixed + * @return FormInterface * * @throws BadMethodCallException */ diff --git a/src/Symfony/Component/Form/ButtonBuilder.php b/src/Symfony/Component/Form/ButtonBuilder.php index 597c7dfa63c8c..c85bcc0d9e344 100644 --- a/src/Symfony/Component/Form/ButtonBuilder.php +++ b/src/Symfony/Component/Form/ButtonBuilder.php @@ -19,6 +19,8 @@ * A builder for {@link Button} instances. * * @author Bernhard Schussek + * + * @implements \IteratorAggregate */ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface { diff --git a/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php b/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php index 5ad89c6b1f82e..46b7d19e71cd1 100644 --- a/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php +++ b/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php @@ -15,6 +15,8 @@ * Represents a group of choices in templates. * * @author Bernhard Schussek + * + * @implements \IteratorAggregate */ class ChoiceGroupView implements \IteratorAggregate { @@ -24,7 +26,7 @@ class ChoiceGroupView implements \IteratorAggregate /** * Creates a new choice group view. * - * @param ChoiceGroupView[]|ChoiceView[] $choices the choice views in the group + * @param array $choices the choice views in the group */ public function __construct(string $label, array $choices = []) { @@ -35,7 +37,7 @@ public function __construct(string $label, array $choices = []) /** * {@inheritdoc} * - * @return \Traversable + * @return \Traversable */ #[\ReturnTypeWillChange] public function getIterator() diff --git a/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php b/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php index c1300abb0e060..1d76cb7bd3169 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php +++ b/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php @@ -24,6 +24,9 @@ */ class FormValidator extends ConstraintValidator { + /** + * @var \SplObjectStorage> + */ private $resolvedGroups; /** diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php index db82aa961eb64..64ef514d47d14 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php @@ -21,7 +21,7 @@ class ViolationPath implements \IteratorAggregate, PropertyPathInterface { /** - * @var array + * @var string[] */ private $elements = []; diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index 431f469e764ee..1f02ea869321d 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -66,6 +66,8 @@ * * @author Fabien Potencier * @author Bernhard Schussek + * + * @implements \IteratorAggregate */ class Form implements \IteratorAggregate, FormInterface, ClearableErrorsInterface { @@ -82,7 +84,7 @@ class Form implements \IteratorAggregate, FormInterface, ClearableErrorsInterfac /** * A map of FormInterface instances. * - * @var FormInterface[]|OrderedHashMap + * @var OrderedHashMap */ private $children; @@ -1021,7 +1023,7 @@ public function offsetUnset($name) /** * Returns the iterator for this group. * - * @return \Traversable + * @return \Traversable */ #[\ReturnTypeWillChange] public function getIterator() diff --git a/src/Symfony/Component/Form/FormBuilder.php b/src/Symfony/Component/Form/FormBuilder.php index f15a1506599e8..37fca950a77cb 100644 --- a/src/Symfony/Component/Form/FormBuilder.php +++ b/src/Symfony/Component/Form/FormBuilder.php @@ -21,6 +21,8 @@ * A builder for creating {@link Form} instances. * * @author Bernhard Schussek + * + * @implements \IteratorAggregate */ class FormBuilder extends FormConfigBuilder implements \IteratorAggregate, FormBuilderInterface { @@ -214,7 +216,7 @@ public function getForm() /** * {@inheritdoc} * - * @return FormBuilderInterface[]|\Traversable + * @return \Traversable */ #[\ReturnTypeWillChange] public function getIterator() diff --git a/src/Symfony/Component/Form/FormErrorIterator.php b/src/Symfony/Component/Form/FormErrorIterator.php index cb049ec8bcee2..2b688904eaff2 100644 --- a/src/Symfony/Component/Form/FormErrorIterator.php +++ b/src/Symfony/Component/Form/FormErrorIterator.php @@ -28,6 +28,10 @@ * flatten the recursive structure into a flat list of errors. * * @author Bernhard Schussek + * + * @implements \ArrayAccess + * @implements \RecursiveIterator + * @implements \SeekableIterator */ class FormErrorIterator implements \RecursiveIterator, \SeekableIterator, \ArrayAccess, \Countable { @@ -40,8 +44,7 @@ class FormErrorIterator implements \RecursiveIterator, \SeekableIterator, \Array private $errors; /** - * @param FormError[]|self[] $errors An array of form errors and instances - * of FormErrorIterator + * @param array $errors * * @throws InvalidArgumentException If the errors are invalid */ diff --git a/src/Symfony/Component/Form/FormInterface.php b/src/Symfony/Component/Form/FormInterface.php index 4dfbf0c18fdc2..6cc6b4ed7a544 100644 --- a/src/Symfony/Component/Form/FormInterface.php +++ b/src/Symfony/Component/Form/FormInterface.php @@ -17,6 +17,9 @@ * A form group bundling multiple forms in a hierarchical structure. * * @author Bernhard Schussek + * + * @extends \ArrayAccess + * @extends \Traversable */ interface FormInterface extends \ArrayAccess, \Traversable, \Countable { diff --git a/src/Symfony/Component/Form/FormView.php b/src/Symfony/Component/Form/FormView.php index 1913aa60a91ab..f3f3ba63e1713 100644 --- a/src/Symfony/Component/Form/FormView.php +++ b/src/Symfony/Component/Form/FormView.php @@ -15,6 +15,9 @@ /** * @author Bernhard Schussek + * + * @implements \ArrayAccess + * @implements \IteratorAggregate */ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable { diff --git a/src/Symfony/Component/Form/Util/OrderedHashMap.php b/src/Symfony/Component/Form/Util/OrderedHashMap.php index b60a7ce4b0959..3af50c3c95861 100644 --- a/src/Symfony/Component/Form/Util/OrderedHashMap.php +++ b/src/Symfony/Component/Form/Util/OrderedHashMap.php @@ -63,13 +63,19 @@ * } * * @author Bernhard Schussek + * + * @template TKey of array-key + * @template TValue + * + * @implements \ArrayAccess + * @implements \IteratorAggregate */ class OrderedHashMap implements \ArrayAccess, \IteratorAggregate, \Countable { /** * The elements of the map, indexed by their keys. * - * @var array + * @var array */ private $elements = []; @@ -90,7 +96,7 @@ class OrderedHashMap implements \ArrayAccess, \IteratorAggregate, \Countable /** * Creates a new map. * - * @param array $elements The elements to insert initially + * @param array $elements The elements to insert initially */ public function __construct(array $elements = []) { @@ -167,7 +173,7 @@ public function offsetUnset($key) } /** - * @return \Traversable + * @return \Traversable */ #[\ReturnTypeWillChange] public function getIterator() diff --git a/src/Symfony/Component/Form/Util/OrderedHashMapIterator.php b/src/Symfony/Component/Form/Util/OrderedHashMapIterator.php index 7282262a8e095..b28a892d0884e 100644 --- a/src/Symfony/Component/Form/Util/OrderedHashMapIterator.php +++ b/src/Symfony/Component/Form/Util/OrderedHashMapIterator.php @@ -17,6 +17,11 @@ * @author Bernhard Schussek * * @internal + * + * @template TKey + * @template TValue + * + * @implements \Iterator */ class OrderedHashMapIterator implements \Iterator { @@ -56,15 +61,15 @@ class OrderedHashMapIterator implements \Iterator private $current; /** - * @param array $elements The elements of the map, indexed by their - * keys - * @param array $orderedKeys The keys of the map in the order in which - * they should be iterated - * @param array $managedCursors An array from which to reference the - * iterator's cursor as long as it is alive. - * This array is managed by the corresponding - * {@link OrderedHashMap} instance to support - * recognizing the deletion of elements. + * @param array $elements The elements of the map, indexed by their + * keys + * @param array $orderedKeys The keys of the map in the order in which + * they should be iterated + * @param array $managedCursors An array from which to reference the + * iterator's cursor as long as it is alive. + * This array is managed by the corresponding + * {@link OrderedHashMap} instance to support + * recognizing the deletion of elements. */ public function __construct(array &$elements, array &$orderedKeys, array &$managedCursors) { diff --git a/src/Symfony/Component/HttpClient/HttplugClient.php b/src/Symfony/Component/HttpClient/HttplugClient.php index df0cca1ce9622..8f3a8ee3f0631 100644 --- a/src/Symfony/Component/HttpClient/HttplugClient.php +++ b/src/Symfony/Component/HttpClient/HttplugClient.php @@ -61,7 +61,12 @@ final class HttplugClient implements HttplugInterface, HttpAsyncClient, RequestF private $client; private $responseFactory; private $streamFactory; + + /** + * @var \SplObjectStorage|null + */ private $promisePool; + private $waitLoop; public function __construct(HttpClientInterface $client = null, ResponseFactoryInterface $responseFactory = null, StreamFactoryInterface $streamFactory = null) diff --git a/src/Symfony/Component/HttpClient/Internal/HttplugWaitLoop.php b/src/Symfony/Component/HttpClient/Internal/HttplugWaitLoop.php index dc3ea7fbb4504..48af4cbb0dc05 100644 --- a/src/Symfony/Component/HttpClient/Internal/HttplugWaitLoop.php +++ b/src/Symfony/Component/HttpClient/Internal/HttplugWaitLoop.php @@ -12,6 +12,8 @@ namespace Symfony\Component\HttpClient\Internal; use Http\Client\Exception\NetworkException; +use Http\Promise\Promise; +use Psr\Http\Message\RequestInterface as Psr7RequestInterface; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface as Psr7ResponseInterface; use Psr\Http\Message\StreamFactoryInterface; @@ -33,6 +35,9 @@ final class HttplugWaitLoop private $responseFactory; private $streamFactory; + /** + * @param \SplObjectStorage|null $promisePool + */ public function __construct(HttpClientInterface $client, ?\SplObjectStorage $promisePool, ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory) { $this->client = $client; diff --git a/src/Symfony/Component/HttpClient/Response/AsyncResponse.php b/src/Symfony/Component/HttpClient/Response/AsyncResponse.php index 3d07cba9b9b43..c164fadb93ea9 100644 --- a/src/Symfony/Component/HttpClient/Response/AsyncResponse.php +++ b/src/Symfony/Component/HttpClient/Response/AsyncResponse.php @@ -311,6 +311,9 @@ public static function stream(iterable $responses, float $timeout = null, string } } + /** + * @param \SplObjectStorage|null $asyncMap + */ private static function passthru(HttpClientInterface $client, self $r, ChunkInterface $chunk, \SplObjectStorage $asyncMap = null): \Generator { $r->stream = null; @@ -332,6 +335,9 @@ private static function passthru(HttpClientInterface $client, self $r, ChunkInte yield from self::passthruStream($response, $r, null, $asyncMap); } + /** + * @param \SplObjectStorage|null $asyncMap + */ private static function passthruStream(ResponseInterface $response, self $r, ?ChunkInterface $chunk, ?\SplObjectStorage $asyncMap): \Generator { while (true) { diff --git a/src/Symfony/Component/HttpClient/Response/TransportResponseTrait.php b/src/Symfony/Component/HttpClient/Response/TransportResponseTrait.php index 105b375d35615..ee5e611611347 100644 --- a/src/Symfony/Component/HttpClient/Response/TransportResponseTrait.php +++ b/src/Symfony/Component/HttpClient/Response/TransportResponseTrait.php @@ -146,6 +146,8 @@ private function doDestruct() /** * Implements an event loop based on a buffer activity queue. * + * @param iterable $responses + * * @internal */ public static function stream(iterable $responses, float $timeout = null): \Generator diff --git a/src/Symfony/Component/HttpFoundation/HeaderBag.php b/src/Symfony/Component/HttpFoundation/HeaderBag.php index 366c54a4c30a5..2f5110287deff 100644 --- a/src/Symfony/Component/HttpFoundation/HeaderBag.php +++ b/src/Symfony/Component/HttpFoundation/HeaderBag.php @@ -15,12 +15,17 @@ * HeaderBag is a container for HTTP headers. * * @author Fabien Potencier + * + * @implements \IteratorAggregate> */ class HeaderBag implements \IteratorAggregate, \Countable { protected const UPPER = '_ABCDEFGHIJKLMNOPQRSTUVWXYZ'; protected const LOWER = '-abcdefghijklmnopqrstuvwxyz'; + /** + * @var array> + */ protected $headers = []; protected $cacheControl = []; @@ -60,7 +65,7 @@ public function __toString() * * @param string|null $key The name of the headers to return or null to get them all * - * @return array + * @return array>|array */ public function all(string $key = null) { @@ -74,7 +79,7 @@ public function all(string $key = null) /** * Returns the parameter keys. * - * @return array + * @return string[] */ public function keys() { @@ -250,7 +255,7 @@ public function removeCacheControlDirective(string $key) /** * Returns an iterator for headers. * - * @return \ArrayIterator + * @return \ArrayIterator> */ #[\ReturnTypeWillChange] public function getIterator() diff --git a/src/Symfony/Component/HttpFoundation/ParameterBag.php b/src/Symfony/Component/HttpFoundation/ParameterBag.php index fa544a61f63c3..7d051abe78a8b 100644 --- a/src/Symfony/Component/HttpFoundation/ParameterBag.php +++ b/src/Symfony/Component/HttpFoundation/ParameterBag.php @@ -17,6 +17,8 @@ * ParameterBag is a container for key/value pairs. * * @author Fabien Potencier + * + * @implements \IteratorAggregate */ class ParameterBag implements \IteratorAggregate, \Countable { @@ -205,7 +207,7 @@ public function filter(string $key, $default = null, int $filter = \FILTER_DEFAU /** * Returns an iterator for parameters. * - * @return \ArrayIterator + * @return \ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() diff --git a/src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php b/src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php index 2c3fd1182a4bd..f4f051c7a6ebd 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php +++ b/src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php @@ -13,6 +13,8 @@ /** * This class relates to session attribute storage. + * + * @implements \IteratorAggregate */ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Countable { @@ -129,7 +131,7 @@ public function clear() /** * Returns an iterator for attributes. * - * @return \ArrayIterator + * @return \ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() diff --git a/src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php b/src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php index f98fdf52260ac..cb50696814b89 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php +++ b/src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php @@ -46,7 +46,7 @@ public function set(string $name, $value); /** * Returns attributes. * - * @return array + * @return array */ public function all(); diff --git a/src/Symfony/Component/HttpFoundation/Session/Session.php b/src/Symfony/Component/HttpFoundation/Session/Session.php index 1737ef63dbb90..022e3986fe187 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Session.php +++ b/src/Symfony/Component/HttpFoundation/Session/Session.php @@ -26,6 +26,8 @@ class_exists(SessionBagProxy::class); /** * @author Fabien Potencier * @author Drak + * + * @implements \IteratorAggregate */ class Session implements SessionInterface, \IteratorAggregate, \Countable { @@ -126,7 +128,7 @@ public function isStarted() /** * Returns an iterator for attributes. * - * @return \ArrayIterator + * @return \ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() diff --git a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php index 93d7d10ae8980..6bb0b1808d80f 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php @@ -31,6 +31,9 @@ */ class RequestDataCollector extends DataCollector implements EventSubscriberInterface, LateDataCollectorInterface { + /** + * @var \SplObjectStorage + */ private $controllers; private $sessionUsages = []; private $requestStack; diff --git a/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php index e2bcc2f78da44..372ede0378d3a 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php @@ -22,7 +22,7 @@ class RouterDataCollector extends DataCollector { /** - * @var \SplObjectStorage + * @var \SplObjectStorage */ protected $controllers; diff --git a/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php b/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php index c2733b2856356..85525249c9ce4 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php @@ -12,12 +12,14 @@ namespace Symfony\Component\HttpKernel\EventListener; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestMatcherInterface; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpKernel\Event\ExceptionEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent; use Symfony\Component\HttpKernel\Event\TerminateEvent; use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\Profiler\Profile; use Symfony\Component\HttpKernel\Profiler\Profiler; /** @@ -34,9 +36,11 @@ class ProfilerListener implements EventSubscriberInterface protected $onlyException; protected $onlyMainRequests; protected $exception; + /** @var \SplObjectStorage */ protected $profiles; protected $requestStack; protected $collectParameter; + /** @var \SplObjectStorage */ protected $parents; /** diff --git a/src/Symfony/Component/HttpKernel/HttpCache/Store.php b/src/Symfony/Component/HttpKernel/HttpCache/Store.php index 7a09b90d35a01..c777391385efc 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/Store.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/Store.php @@ -25,11 +25,9 @@ class Store implements StoreInterface { protected $root; + /** @var \SplObjectStorage */ private $keyCache; - - /** - * @var array - */ + /** @var array */ private $locks = []; /** diff --git a/src/Symfony/Component/HttpKernel/KernelInterface.php b/src/Symfony/Component/HttpKernel/KernelInterface.php index d123f00aa119d..016c5f610cb13 100644 --- a/src/Symfony/Component/HttpKernel/KernelInterface.php +++ b/src/Symfony/Component/HttpKernel/KernelInterface.php @@ -31,7 +31,7 @@ interface KernelInterface extends HttpKernelInterface /** * Returns an array of bundles to register. * - * @return iterable|BundleInterface[] + * @return iterable */ public function registerBundles(); diff --git a/src/Symfony/Component/Ldap/Adapter/CollectionInterface.php b/src/Symfony/Component/Ldap/Adapter/CollectionInterface.php index 2db4d2bd4a297..8a42c28797215 100644 --- a/src/Symfony/Component/Ldap/Adapter/CollectionInterface.php +++ b/src/Symfony/Component/Ldap/Adapter/CollectionInterface.php @@ -15,11 +15,14 @@ /** * @author Charles Sarrazin + * + * @extends \ArrayAccess + * @extends \IteratorAggregate */ interface CollectionInterface extends \Countable, \IteratorAggregate, \ArrayAccess { /** - * @return Entry[] + * @return array */ public function toArray(); } diff --git a/src/Symfony/Component/Ldap/Adapter/ExtLdap/Collection.php b/src/Symfony/Component/Ldap/Adapter/ExtLdap/Collection.php index 8724a60d4aa60..9ca75514c37d0 100644 --- a/src/Symfony/Component/Ldap/Adapter/ExtLdap/Collection.php +++ b/src/Symfony/Component/Ldap/Adapter/ExtLdap/Collection.php @@ -63,7 +63,7 @@ public function count() } /** - * @return \Traversable + * @return \Traversable */ #[\ReturnTypeWillChange] public function getIterator() @@ -101,7 +101,7 @@ public function offsetExists($offset) } /** - * @return mixed + * @return Entry|null */ #[\ReturnTypeWillChange] public function offsetGet($offset) diff --git a/src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php b/src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php index 6f0bdd4f61b74..41b35dd52ac9a 100644 --- a/src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php +++ b/src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php @@ -140,7 +140,7 @@ private function getConnectionResource() } /** - * @param iterable|UpdateOperation[] $operations An array or iterable of UpdateOperation instances + * @param iterable $operations An array or iterable of UpdateOperation instances * * @throws UpdateOperationException in case of an error */ diff --git a/src/Symfony/Component/Ldap/Adapter/QueryInterface.php b/src/Symfony/Component/Ldap/Adapter/QueryInterface.php index 23cf3e7b631e7..b2d4a4ce4b779 100644 --- a/src/Symfony/Component/Ldap/Adapter/QueryInterface.php +++ b/src/Symfony/Component/Ldap/Adapter/QueryInterface.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Ldap\Adapter; -use Symfony\Component\Ldap\Entry; use Symfony\Component\Ldap\Exception\LdapException; use Symfony\Component\Ldap\Exception\NotBoundException; @@ -33,7 +32,7 @@ interface QueryInterface /** * Executes a query and returns the list of Ldap entries. * - * @return CollectionInterface|Entry[] + * @return CollectionInterface * * @throws NotBoundException * @throws LdapException diff --git a/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php b/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php index bfdd7d5342ff5..3d6cbb97265be 100644 --- a/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php +++ b/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Ldap\Tests\Adapter\ExtLdap; +use Symfony\Component\Ldap\Adapter\CollectionInterface; use Symfony\Component\Ldap\Adapter\ExtLdap\Adapter; use Symfony\Component\Ldap\Adapter\ExtLdap\Collection; use Symfony\Component\Ldap\Adapter\ExtLdap\UpdateOperation; @@ -160,10 +161,7 @@ public function testLdapUnboundUpdate() $em->update(new Entry('')); } - /** - * @return Collection|Entry[] - */ - private function executeSearchQuery($expectedResults = 1) + private function executeSearchQuery($expectedResults = 1): CollectionInterface { $results = $this ->adapter diff --git a/src/Symfony/Component/Mailer/Transport/RoundRobinTransport.php b/src/Symfony/Component/Mailer/Transport/RoundRobinTransport.php index 469673563b9a1..2f351389fa1f2 100644 --- a/src/Symfony/Component/Mailer/Transport/RoundRobinTransport.php +++ b/src/Symfony/Component/Mailer/Transport/RoundRobinTransport.php @@ -24,6 +24,9 @@ */ class RoundRobinTransport implements TransportInterface { + /** + * @var \SplObjectStorage + */ private $deadTransports; private $transports = []; private $retryPeriod; diff --git a/src/Symfony/Component/Messenger/Handler/HandlersLocatorInterface.php b/src/Symfony/Component/Messenger/Handler/HandlersLocatorInterface.php index 92646e3029894..c0ac07f300874 100644 --- a/src/Symfony/Component/Messenger/Handler/HandlersLocatorInterface.php +++ b/src/Symfony/Component/Messenger/Handler/HandlersLocatorInterface.php @@ -23,7 +23,7 @@ interface HandlersLocatorInterface /** * Returns the handlers for the given message name. * - * @return iterable|HandlerDescriptor[] Indexed by handler alias if available + * @return iterable */ public function getHandlers(Envelope $envelope): iterable; } diff --git a/src/Symfony/Component/Messenger/Middleware/StackMiddleware.php b/src/Symfony/Component/Messenger/Middleware/StackMiddleware.php index 6119529aeed36..30c181f9fec3b 100644 --- a/src/Symfony/Component/Messenger/Middleware/StackMiddleware.php +++ b/src/Symfony/Component/Messenger/Middleware/StackMiddleware.php @@ -67,6 +67,7 @@ public function handle(Envelope $envelope, StackInterface $stack): Envelope */ class MiddlewareStack { + /** @var \Iterator */ public $iterator; public $stack = []; diff --git a/src/Symfony/Component/Messenger/Transport/Sender/SendersLocator.php b/src/Symfony/Component/Messenger/Transport/Sender/SendersLocator.php index 23fb2fec1fc71..9d0a1e3b7b3b6 100644 --- a/src/Symfony/Component/Messenger/Transport/Sender/SendersLocator.php +++ b/src/Symfony/Component/Messenger/Transport/Sender/SendersLocator.php @@ -27,8 +27,8 @@ class SendersLocator implements SendersLocatorInterface private $sendersLocator; /** - * @param string[][] $sendersMap An array, keyed by "type", set to an array of sender aliases - * @param ContainerInterface $sendersLocator Locator of senders, keyed by sender alias + * @param array> $sendersMap An array, keyed by "type", set to an array of sender aliases + * @param ContainerInterface $sendersLocator Locator of senders, keyed by sender alias */ public function __construct(array $sendersMap, ContainerInterface $sendersLocator) { diff --git a/src/Symfony/Component/Messenger/Transport/Sender/SendersLocatorInterface.php b/src/Symfony/Component/Messenger/Transport/Sender/SendersLocatorInterface.php index 916f780d74df9..feab1f4184f89 100644 --- a/src/Symfony/Component/Messenger/Transport/Sender/SendersLocatorInterface.php +++ b/src/Symfony/Component/Messenger/Transport/Sender/SendersLocatorInterface.php @@ -24,7 +24,7 @@ interface SendersLocatorInterface /** * Gets the senders for the given message name. * - * @return iterable|SenderInterface[] Indexed by sender alias if available + * @return iterable Indexed by sender alias if available */ public function getSenders(Envelope $envelope): iterable; } diff --git a/src/Symfony/Component/Notifier/Bridge/Telegram/Reply/Markup/InlineKeyboardMarkup.php b/src/Symfony/Component/Notifier/Bridge/Telegram/Reply/Markup/InlineKeyboardMarkup.php index 64f249da0ef63..f5a0e0dc38b3c 100644 --- a/src/Symfony/Component/Notifier/Bridge/Telegram/Reply/Markup/InlineKeyboardMarkup.php +++ b/src/Symfony/Component/Notifier/Bridge/Telegram/Reply/Markup/InlineKeyboardMarkup.php @@ -26,7 +26,7 @@ public function __construct() } /** - * @param array|InlineKeyboardButton[] $buttons + * @param InlineKeyboardButton[] $buttons * * @return $this */ diff --git a/src/Symfony/Component/Notifier/Bridge/Telegram/Reply/Markup/ReplyKeyboardMarkup.php b/src/Symfony/Component/Notifier/Bridge/Telegram/Reply/Markup/ReplyKeyboardMarkup.php index 53286433227df..478833cf386c6 100644 --- a/src/Symfony/Component/Notifier/Bridge/Telegram/Reply/Markup/ReplyKeyboardMarkup.php +++ b/src/Symfony/Component/Notifier/Bridge/Telegram/Reply/Markup/ReplyKeyboardMarkup.php @@ -26,7 +26,7 @@ public function __construct() } /** - * @param array|KeyboardButton[] $buttons + * @param KeyboardButton[] $buttons * * @return $this */ diff --git a/src/Symfony/Component/Notifier/Transport/RoundRobinTransport.php b/src/Symfony/Component/Notifier/Transport/RoundRobinTransport.php index 4ee63c35bbe75..597c7d836138c 100644 --- a/src/Symfony/Component/Notifier/Transport/RoundRobinTransport.php +++ b/src/Symfony/Component/Notifier/Transport/RoundRobinTransport.php @@ -24,6 +24,9 @@ */ class RoundRobinTransport implements TransportInterface { + /** + * @var \SplObjectStorage + */ private $deadTransports; private $transports = []; private $retryPeriod; diff --git a/src/Symfony/Component/Process/InputStream.php b/src/Symfony/Component/Process/InputStream.php index 4f8f71331aafc..240665f32a024 100644 --- a/src/Symfony/Component/Process/InputStream.php +++ b/src/Symfony/Component/Process/InputStream.php @@ -17,6 +17,8 @@ * Provides a way to continuously write to the input of a Process until the InputStream is closed. * * @author Nicolas Grekas + * + * @implements \IteratorAggregate */ class InputStream implements \IteratorAggregate { @@ -67,7 +69,7 @@ public function isClosed() } /** - * @return \Traversable + * @return \Traversable */ #[\ReturnTypeWillChange] public function getIterator() diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index aa9b1c7ae52b8..c68688285f9d0 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -27,6 +27,8 @@ * * @author Fabien Potencier * @author Romain Neutron + * + * @implements \IteratorAggregate */ class Process implements \IteratorAggregate { @@ -618,7 +620,7 @@ public function getIncrementalOutput() * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started * - * @return \Generator + * @return \Generator */ #[\ReturnTypeWillChange] public function getIterator(int $flags = 0) diff --git a/src/Symfony/Component/PropertyAccess/PropertyPath.php b/src/Symfony/Component/PropertyAccess/PropertyPath.php index 0c1c4346a0f89..faae716b6a0c6 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyPath.php +++ b/src/Symfony/Component/PropertyAccess/PropertyPath.php @@ -19,6 +19,8 @@ * Default implementation of {@link PropertyPathInterface}. * * @author Bernhard Schussek + * + * @implements \IteratorAggregate */ class PropertyPath implements \IteratorAggregate, PropertyPathInterface { @@ -30,7 +32,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface /** * The elements of the property path. * - * @var array + * @var string[] */ private $elements = []; diff --git a/src/Symfony/Component/PropertyAccess/PropertyPathInterface.php b/src/Symfony/Component/PropertyAccess/PropertyPathInterface.php index 2e9b8e2859442..1716ae2c1511b 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyPathInterface.php +++ b/src/Symfony/Component/PropertyAccess/PropertyPathInterface.php @@ -15,6 +15,8 @@ * A sequence of property names or array indices. * * @author Bernhard Schussek + * + * @extends \Traversable */ interface PropertyPathInterface extends \Traversable { @@ -47,7 +49,7 @@ public function getParent(); /** * Returns the elements of the property path as array. * - * @return array + * @return string[] */ public function getElements(); diff --git a/src/Symfony/Component/PropertyAccess/PropertyPathIteratorInterface.php b/src/Symfony/Component/PropertyAccess/PropertyPathIteratorInterface.php index 79b1bbfe828e4..0397f9c177a07 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyPathIteratorInterface.php +++ b/src/Symfony/Component/PropertyAccess/PropertyPathIteratorInterface.php @@ -13,8 +13,10 @@ /** * @author Bernhard Schussek + * + * @extends \SeekableIterator */ -interface PropertyPathIteratorInterface extends \Iterator, \SeekableIterator +interface PropertyPathIteratorInterface extends \SeekableIterator { /** * Returns whether the current element in the property path is an array diff --git a/src/Symfony/Component/PropertyInfo/Extractor/ConstructorExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/ConstructorExtractor.php index f8ea6de18529d..fb32634fb02d6 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/ConstructorExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/ConstructorExtractor.php @@ -20,11 +20,10 @@ */ final class ConstructorExtractor implements PropertyTypeExtractorInterface { - /** @var iterable|ConstructorArgumentTypeExtractorInterface[] */ private $extractors; /** - * @param iterable|ConstructorArgumentTypeExtractorInterface[] $extractors + * @param iterable $extractors */ public function __construct(iterable $extractors = []) { diff --git a/src/Symfony/Component/PropertyInfo/PropertyInfoExtractor.php b/src/Symfony/Component/PropertyInfo/PropertyInfoExtractor.php index cca073f26e6d0..dd2cc9f3eff04 100644 --- a/src/Symfony/Component/PropertyInfo/PropertyInfoExtractor.php +++ b/src/Symfony/Component/PropertyInfo/PropertyInfoExtractor.php @@ -27,11 +27,11 @@ class PropertyInfoExtractor implements PropertyInfoExtractorInterface, PropertyI private $initializableExtractors; /** - * @param iterable|PropertyListExtractorInterface[] $listExtractors - * @param iterable|PropertyTypeExtractorInterface[] $typeExtractors - * @param iterable|PropertyDescriptionExtractorInterface[] $descriptionExtractors - * @param iterable|PropertyAccessExtractorInterface[] $accessExtractors - * @param iterable|PropertyInitializableExtractorInterface[] $initializableExtractors + * @param iterable $listExtractors + * @param iterable $typeExtractors + * @param iterable $descriptionExtractors + * @param iterable $accessExtractors + * @param iterable $initializableExtractors */ public function __construct(iterable $listExtractors = [], iterable $typeExtractors = [], iterable $descriptionExtractors = [], iterable $accessExtractors = [], iterable $initializableExtractors = []) { @@ -101,6 +101,9 @@ public function isInitializable(string $class, string $property, array $context /** * Iterates over registered extractors and return the first value found. * + * @param iterable $extractors + * @param list $arguments + * * @return mixed */ private function extract(iterable $extractors, string $method, array $arguments) diff --git a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php index 65467ce8c915c..ad5af5c942351 100644 --- a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php +++ b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php @@ -367,7 +367,7 @@ abstract protected function configureRoute(Route $route, \ReflectionClass $class /** * @param \ReflectionClass|\ReflectionMethod $reflection * - * @return iterable|RouteAnnotation[] + * @return iterable */ private function getAnnotations(object $reflection): iterable { diff --git a/src/Symfony/Component/Routing/RouteCollection.php b/src/Symfony/Component/Routing/RouteCollection.php index 4834c99470dbf..5d41c7e637204 100644 --- a/src/Symfony/Component/Routing/RouteCollection.php +++ b/src/Symfony/Component/Routing/RouteCollection.php @@ -22,6 +22,8 @@ * * @author Fabien Potencier * @author Tobias Schultze + * + * @implements \IteratorAggregate */ class RouteCollection implements \IteratorAggregate, \Countable { @@ -94,7 +96,7 @@ public function add(string $name, Route $route/*, int $priority = 0*/) /** * Returns all routes in this collection. * - * @return Route[] + * @return array */ public function all() { diff --git a/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php b/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php index 754464aaabf9c..35ea7f4ffd0e8 100644 --- a/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php +++ b/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php @@ -47,8 +47,8 @@ class AuthenticationProviderManager implements AuthenticationManagerInterface private $eventDispatcher; /** - * @param iterable|AuthenticationProviderInterface[] $providers An iterable with AuthenticationProviderInterface instances as values - * @param bool $eraseCredentials Whether to erase credentials after authentication or not + * @param iterable $providers An iterable with AuthenticationProviderInterface instances as values + * @param bool $eraseCredentials Whether to erase credentials after authentication or not * * @throws \InvalidArgumentException */ diff --git a/src/Symfony/Component/Security/Core/Authorization/TraceableAccessDecisionManager.php b/src/Symfony/Component/Security/Core/Authorization/TraceableAccessDecisionManager.php index 0854ab91e8912..f91a3df20de20 100644 --- a/src/Symfony/Component/Security/Core/Authorization/TraceableAccessDecisionManager.php +++ b/src/Symfony/Component/Security/Core/Authorization/TraceableAccessDecisionManager.php @@ -98,7 +98,7 @@ public function getStrategy(): string } /** - * @return iterable|VoterInterface[] + * @return iterable */ public function getVoters(): iterable { diff --git a/src/Symfony/Component/Security/Core/User/ChainUserProvider.php b/src/Symfony/Component/Security/Core/User/ChainUserProvider.php index ae7762672cccd..bcea41d0db860 100644 --- a/src/Symfony/Component/Security/Core/User/ChainUserProvider.php +++ b/src/Symfony/Component/Security/Core/User/ChainUserProvider.php @@ -27,7 +27,7 @@ class ChainUserProvider implements UserProviderInterface, PasswordUpgraderInterf private $providers; /** - * @param iterable|UserProviderInterface[] $providers + * @param iterable $providers */ public function __construct(iterable $providers) { @@ -35,7 +35,7 @@ public function __construct(iterable $providers) } /** - * @return array + * @return UserProviderInterface[] */ public function getProviders() { diff --git a/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php b/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php index 7eba97b10747d..81fb20f6b7e38 100644 --- a/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php +++ b/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php @@ -51,8 +51,8 @@ class GuardAuthenticationListener extends AbstractListener private $hideUserNotFoundExceptions; /** - * @param string $providerKey The provider (i.e. firewall) key - * @param iterable|AuthenticatorInterface[] $guardAuthenticators The authenticators, with keys that match what's passed to GuardAuthenticationProvider + * @param string $providerKey The provider (i.e. firewall) key + * @param iterable $guardAuthenticators The authenticators, with keys that match what's passed to GuardAuthenticationProvider */ public function __construct(GuardAuthenticatorHandler $guardHandler, AuthenticationManagerInterface $authenticationManager, string $providerKey, iterable $guardAuthenticators, LoggerInterface $logger = null, bool $hideUserNotFoundExceptions = true) { diff --git a/src/Symfony/Component/Security/Guard/Provider/GuardAuthenticationProvider.php b/src/Symfony/Component/Security/Guard/Provider/GuardAuthenticationProvider.php index 7425147c4852a..000c1020641df 100644 --- a/src/Symfony/Component/Security/Guard/Provider/GuardAuthenticationProvider.php +++ b/src/Symfony/Component/Security/Guard/Provider/GuardAuthenticationProvider.php @@ -41,9 +41,6 @@ */ class GuardAuthenticationProvider implements AuthenticationProviderInterface { - /** - * @var AuthenticatorInterface[] - */ private $guardAuthenticators; private $userProvider; private $providerKey; @@ -51,9 +48,9 @@ class GuardAuthenticationProvider implements AuthenticationProviderInterface private $passwordHasher; /** - * @param iterable|AuthenticatorInterface[] $guardAuthenticators The authenticators, with keys that match what's passed to GuardAuthenticationListener - * @param string $providerKey The provider (i.e. firewall) key - * @param UserPasswordHasherInterface $passwordHasher + * @param iterable $guardAuthenticators The authenticators, with keys that match what's passed to GuardAuthenticationListener + * @param string $providerKey The provider (i.e. firewall) key + * @param UserPasswordHasherInterface $passwordHasher */ public function __construct(iterable $guardAuthenticators, UserProviderInterface $userProvider, string $providerKey, UserCheckerInterface $userChecker, $passwordHasher = null) { diff --git a/src/Symfony/Component/Security/Http/Firewall.php b/src/Symfony/Component/Security/Http/Firewall.php index 49b2b9a0d4eac..be758a63ca44e 100644 --- a/src/Symfony/Component/Security/Http/Firewall.php +++ b/src/Symfony/Component/Security/Http/Firewall.php @@ -12,9 +12,11 @@ namespace Symfony\Component\Security\Http; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Event\FinishRequestEvent; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\Security\Http\Firewall\ExceptionListener; use Symfony\Component\Security\Http\Firewall\FirewallListenerInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; @@ -32,6 +34,10 @@ class Firewall implements EventSubscriberInterface { private $map; private $dispatcher; + + /** + * @var \SplObjectStorage + */ private $exceptionListeners; public function __construct(FirewallMapInterface $map, EventDispatcherInterface $dispatcher) diff --git a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php index daff53cddb714..59fdd75fdef62 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php @@ -58,7 +58,7 @@ class ContextListener extends AbstractListener private $sessionTrackerEnabler; /** - * @param iterable|UserProviderInterface[] $userProviders + * @param iterable $userProviders */ public function __construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null, callable $sessionTrackerEnabler = null) { diff --git a/src/Symfony/Component/Security/Http/FirewallMapInterface.php b/src/Symfony/Component/Security/Http/FirewallMapInterface.php index 6704940153b72..133de2b67067d 100644 --- a/src/Symfony/Component/Security/Http/FirewallMapInterface.php +++ b/src/Symfony/Component/Security/Http/FirewallMapInterface.php @@ -12,6 +12,8 @@ namespace Symfony\Component\Security\Http; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Firewall\ExceptionListener; +use Symfony\Component\Security\Http\Firewall\LogoutListener; /** * This interface must be implemented by firewall maps. @@ -33,7 +35,7 @@ interface FirewallMapInterface * If there is no logout listener, the third element of the outer array * must be null. * - * @return array of the format [[AuthenticationListener], ExceptionListener, LogoutListener] + * @return array{list, ExceptionListener, LogoutListener} */ public function getListeners(Request $request); } diff --git a/src/Symfony/Component/Validator/ConstraintViolationList.php b/src/Symfony/Component/Validator/ConstraintViolationList.php index 4cf0d34e9fc09..6ed9666d5ce6c 100644 --- a/src/Symfony/Component/Validator/ConstraintViolationList.php +++ b/src/Symfony/Component/Validator/ConstraintViolationList.php @@ -15,6 +15,8 @@ * Default implementation of {@ConstraintViolationListInterface}. * * @author Bernhard Schussek + * + * @implements \IteratorAggregate */ class ConstraintViolationList implements \IteratorAggregate, ConstraintViolationListInterface { @@ -116,7 +118,7 @@ public function remove(int $offset) /** * {@inheritdoc} * - * @return \ArrayIterator|ConstraintViolationInterface[] + * @return \ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() @@ -145,7 +147,7 @@ public function offsetExists($offset) /** * {@inheritdoc} * - * @return mixed + * @return ConstraintViolationInterface */ #[\ReturnTypeWillChange] public function offsetGet($offset) diff --git a/src/Symfony/Component/Validator/ConstraintViolationListInterface.php b/src/Symfony/Component/Validator/ConstraintViolationListInterface.php index 7f3d6b02bf2f3..f994668caa6ea 100644 --- a/src/Symfony/Component/Validator/ConstraintViolationListInterface.php +++ b/src/Symfony/Component/Validator/ConstraintViolationListInterface.php @@ -15,6 +15,9 @@ * A list of constraint violations. * * @author Bernhard Schussek + * + * @extends \ArrayAccess + * @extends \Traversable */ interface ConstraintViolationListInterface extends \Traversable, \Countable, \ArrayAccess { diff --git a/src/Symfony/Component/Validator/Constraints/GroupSequence.php b/src/Symfony/Component/Validator/Constraints/GroupSequence.php index 4ed082b9c1537..522c5fdf59d11 100644 --- a/src/Symfony/Component/Validator/Constraints/GroupSequence.php +++ b/src/Symfony/Component/Validator/Constraints/GroupSequence.php @@ -57,7 +57,7 @@ class GroupSequence /** * The groups in the sequence. * - * @var array + * @var array */ public $groups; diff --git a/src/Symfony/Component/Validator/Context/ExecutionContext.php b/src/Symfony/Component/Validator/Context/ExecutionContext.php index 9800572b0a23a..c640da36320a7 100644 --- a/src/Symfony/Component/Validator/Context/ExecutionContext.php +++ b/src/Symfony/Component/Validator/Context/ExecutionContext.php @@ -128,6 +128,10 @@ class ExecutionContext implements ExecutionContextInterface * @var bool[] */ private $initializedObjects; + + /** + * @var \SplObjectStorage + */ private $cachedObjectsRefs; /** diff --git a/src/Symfony/Component/Workflow/Metadata/InMemoryMetadataStore.php b/src/Symfony/Component/Workflow/Metadata/InMemoryMetadataStore.php index a1553885b34dd..8fdc9e7729321 100644 --- a/src/Symfony/Component/Workflow/Metadata/InMemoryMetadataStore.php +++ b/src/Symfony/Component/Workflow/Metadata/InMemoryMetadataStore.php @@ -24,6 +24,9 @@ final class InMemoryMetadataStore implements MetadataStoreInterface private $placesMetadata; private $transitionsMetadata; + /** + * @param \SplObjectStorage|null $transitionsMetadata + */ public function __construct(array $workflowMetadata = [], array $placesMetadata = [], \SplObjectStorage $transitionsMetadata = null) { $this->workflowMetadata = $workflowMetadata; diff --git a/src/Symfony/Component/Workflow/TransitionBlockerList.php b/src/Symfony/Component/Workflow/TransitionBlockerList.php index 6c443e6ca8d10..b87222c241430 100644 --- a/src/Symfony/Component/Workflow/TransitionBlockerList.php +++ b/src/Symfony/Component/Workflow/TransitionBlockerList.php @@ -15,6 +15,8 @@ * A list of transition blockers. * * @author Grégoire Pineau + * + * @implements \IteratorAggregate */ final class TransitionBlockerList implements \IteratorAggregate, \Countable { @@ -58,11 +60,6 @@ public function isEmpty(): bool return !$this->blockers; } - /** - * {@inheritdoc} - * - * @return \Traversable - */ public function getIterator(): \Traversable { return new \ArrayIterator($this->blockers); diff --git a/src/Symfony/Contracts/HttpClient/HttpClientInterface.php b/src/Symfony/Contracts/HttpClient/HttpClientInterface.php index ea793ba3943a8..158c1a7d066c8 100644 --- a/src/Symfony/Contracts/HttpClient/HttpClientInterface.php +++ b/src/Symfony/Contracts/HttpClient/HttpClientInterface.php @@ -88,8 +88,8 @@ public function request(string $method, string $url, array $options = []): Respo /** * Yields responses chunk by chunk as they complete. * - * @param ResponseInterface|ResponseInterface[]|iterable $responses One or more responses created by the current HTTP client - * @param float|null $timeout The idle timeout before yielding timeout chunks + * @param ResponseInterface|iterable $responses One or more responses created by the current HTTP client + * @param float|null $timeout The idle timeout before yielding timeout chunks */ public function stream($responses, float $timeout = null): ResponseStreamInterface; } diff --git a/src/Symfony/Contracts/HttpClient/ResponseStreamInterface.php b/src/Symfony/Contracts/HttpClient/ResponseStreamInterface.php index febe5d1425547..fa3e5db6c8d04 100644 --- a/src/Symfony/Contracts/HttpClient/ResponseStreamInterface.php +++ b/src/Symfony/Contracts/HttpClient/ResponseStreamInterface.php @@ -15,6 +15,8 @@ * Yields response chunks, returned by HttpClientInterface::stream(). * * @author Nicolas Grekas + * + * @extends \Iterator */ interface ResponseStreamInterface extends \Iterator {