Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1d91718

Browse filesBrowse files
committed
minor #43903 Fix more generic types (derrabus)
This PR was merged into the 5.4 branch. Discussion ---------- Fix more generic types | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A Some changes I wanted to push to #42471, but then it got merged already. 😇 Commits ------- c54d61e Fix more generic types
2 parents 7acf15e + c54d61e commit 1d91718
Copy full SHA for 1d91718

35 files changed

+95
-65
lines changed

‎src/Symfony/Bridge/Doctrine/SchemaListener/MessengerTransportDoctrineSchemaSubscriber.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/SchemaListener/MessengerTransportDoctrineSchemaSubscriber.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class MessengerTransportDoctrineSchemaSubscriber implements EventSubscribe
3131
private $transports;
3232

3333
/**
34-
* @param iterable<int, TransportInterface> $transports
34+
* @param iterable<mixed, TransportInterface> $transports
3535
*/
3636
public function __construct(iterable $transports)
3737
{

‎src/Symfony/Bridge/Doctrine/SchemaListener/PdoCacheAdapterDoctrineSchemaSubscriber.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/SchemaListener/PdoCacheAdapterDoctrineSchemaSubscriber.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class PdoCacheAdapterDoctrineSchemaSubscriber implements EventSubscriber
3030
private $pdoAdapters;
3131

3232
/**
33-
* @param iterable<int, PdoAdapter> $pdoAdapters
33+
* @param iterable<mixed, PdoAdapter> $pdoAdapters
3434
*/
3535
public function __construct(iterable $pdoAdapters)
3636
{

‎src/Symfony/Bridge/Doctrine/SchemaListener/RememberMeTokenProviderDoctrineSchemaSubscriber.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/SchemaListener/RememberMeTokenProviderDoctrineSchemaSubscriber.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class RememberMeTokenProviderDoctrineSchemaSubscriber implements EventSubs
2828
private $rememberMeHandlers;
2929

3030
/**
31-
* @param iterable<int, RememberMeHandlerInterface> $rememberMeHandlers
31+
* @param iterable<mixed, RememberMeHandlerInterface> $rememberMeHandlers
3232
*/
3333
public function __construct(iterable $rememberMeHandlers)
3434
{

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class MainConfiguration implements ConfigurationInterface
4242
private $userProviderFactories;
4343

4444
/**
45-
* @param array<int, SecurityFactoryInterface|AuthenticatorFactoryInterface> $factories
45+
* @param array<array-key, SecurityFactoryInterface|AuthenticatorFactoryInterface> $factories
4646
*/
4747
public function __construct(array $factories, array $userProviderFactories)
4848
{
@@ -220,7 +220,7 @@ private function addAccessControlSection(ArrayNodeDefinition $rootNode)
220220
}
221221

222222
/**
223-
* @param array<int, SecurityFactoryInterface|AuthenticatorFactoryInterface> $factories
223+
* @param array<array-key, SecurityFactoryInterface|AuthenticatorFactoryInterface> $factories
224224
*/
225225
private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $factories)
226226
{

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ class SecurityExtension extends Extension implements PrependExtensionInterface
6363
private $requestMatchers = [];
6464
private $expressions = [];
6565
private $contextListeners = [];
66-
/** @var array<array{0: int, 1: AuthenticatorFactoryInterface|SecurityFactoryInterface}> */
66+
/** @var list<array{int, AuthenticatorFactoryInterface|SecurityFactoryInterface}> */
6767
private $factories = [];
68-
/** @var (AuthenticatorFactoryInterface|SecurityFactoryInterface)[] */
68+
/** @var list<AuthenticatorFactoryInterface|SecurityFactoryInterface> */
6969
private $sortedFactories = [];
7070
private $userProviderFactories = [];
7171
private $statelessFirewallKeys = [];

‎src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class FirewallContext
2727
private $logoutListener;
2828
private $config;
2929

30+
/**
31+
* @param iterable<mixed, callable> $listeners
32+
*/
3033
public function __construct(iterable $listeners, ExceptionListener $exceptionListener = null, LogoutListener $logoutListener = null, FirewallConfig $config = null)
3134
{
3235
$this->listeners = $listeners;
@@ -40,6 +43,9 @@ public function getConfig()
4043
return $this->config;
4144
}
4245

46+
/**
47+
* @return iterable<mixed, callable>
48+
*/
4349
public function getListeners(): iterable
4450
{
4551
return $this->listeners;

‎src/Symfony/Component/Config/ResourceCheckerConfigCache.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/ResourceCheckerConfigCache.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ class ResourceCheckerConfigCache implements ConfigCacheInterface
2929
private $file;
3030

3131
/**
32-
* @var iterable<int, ResourceCheckerInterface>
32+
* @var iterable<mixed, ResourceCheckerInterface>
3333
*/
3434
private $resourceCheckers;
3535

3636
/**
37-
* @param string $file The absolute cache path
38-
* @param iterable<int, ResourceCheckerInterface> $resourceCheckers The ResourceCheckers to use for the freshness check
37+
* @param string $file The absolute cache path
38+
* @param iterable<mixed, ResourceCheckerInterface> $resourceCheckers The ResourceCheckers to use for the freshness check
3939
*/
4040
public function __construct(string $file, iterable $resourceCheckers = [])
4141
{

‎src/Symfony/Component/Console/Helper/HelperSet.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Helper/HelperSet.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
*/
2424
class HelperSet implements \IteratorAggregate
2525
{
26-
/**
27-
* @var Helper[]
28-
*/
26+
/** @var array<string, Helper> */
2927
private $helpers = [];
3028
private $command;
3129

‎src/Symfony/Component/DomCrawler/Crawler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Crawler.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Crawler implements \Countable, \IteratorAggregate
6262
private $document;
6363

6464
/**
65-
* @var \DOMNode[]
65+
* @var list<\DOMNode>
6666
*/
6767
private $nodes = [];
6868

‎src/Symfony/Component/EventDispatcher/GenericEvent.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/GenericEvent.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public function offsetExists($key)
172172
/**
173173
* IteratorAggregate for iterating over the object like an array.
174174
*
175-
* @return \ArrayIterator
175+
* @return \ArrayIterator<string, mixed>
176176
*/
177177
#[\ReturnTypeWillChange]
178178
public function getIterator()

‎src/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
*
1717
* @author Fabien Potencier <fabien@symfony.com>
1818
*
19-
* @template TKey
20-
* @template TValue
19+
* @template-covariant TKey
20+
* @template-covariant TValue
2121
*
2222
* @extends \FilterIterator<TKey, TValue>
2323
*/

‎src/Symfony/Component/Form/Button.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Button.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(FormConfigInterface $config)
4949
/**
5050
* Unsupported method.
5151
*
52-
* @param mixed $offset
52+
* @param string $offset
5353
*
5454
* @return bool
5555
*/
@@ -64,7 +64,7 @@ public function offsetExists($offset)
6464
*
6565
* This method should not be invoked.
6666
*
67-
* @param mixed $offset
67+
* @param string $offset
6868
*
6969
* @return FormInterface
7070
*
@@ -81,8 +81,8 @@ public function offsetGet($offset)
8181
*
8282
* This method should not be invoked.
8383
*
84-
* @param mixed $offset
85-
* @param mixed $value
84+
* @param string $offset
85+
* @param FormInterface $value
8686
*
8787
* @return void
8888
*
@@ -99,7 +99,7 @@ public function offsetSet($offset, $value)
9999
*
100100
* This method should not be invoked.
101101
*
102-
* @param mixed $offset
102+
* @param string $offset
103103
*
104104
* @return void
105105
*

‎src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717

1818
/**
1919
* @author Bernhard Schussek <bschussek@gmail.com>
20+
*
21+
* @implements \IteratorAggregate<int, string>
2022
*/
2123
class ViolationPath implements \IteratorAggregate, PropertyPathInterface
2224
{
2325
/**
24-
* @var string[]
26+
* @var list<string>
2527
*/
2628
private $elements = [];
2729

‎src/Symfony/Component/Form/FormBuilderInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/FormBuilderInterface.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* @author Bernhard Schussek <bschussek@gmail.com>
1616
*
17-
* @extends \Traversable<string, self>
17+
* @extends \Traversable<string, FormBuilderInterface>
1818
*/
1919
interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuilderInterface
2020
{

‎src/Symfony/Component/Form/FormErrorIterator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/FormErrorIterator.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class FormErrorIterator implements \RecursiveIterator, \SeekableIterator, \Array
4444
private $errors;
4545

4646
/**
47-
* @param array<int, FormError|self> $errors
47+
* @param list<FormError|self> $errors
4848
*
4949
* @throws InvalidArgumentException If the errors are invalid
5050
*/

‎src/Symfony/Component/Form/Util/OrderedHashMap.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Util/OrderedHashMap.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ class OrderedHashMap implements \ArrayAccess, \IteratorAggregate, \Countable
8282
/**
8383
* The keys of the map in the order in which they were inserted or changed.
8484
*
85-
* @var array
85+
* @var list<TKey>
8686
*/
8787
private $orderedKeys = [];
8888

8989
/**
9090
* References to the cursors of all open iterators.
9191
*
92-
* @var array
92+
* @var array<int, int>
9393
*/
9494
private $managedCursors = [];
9595

@@ -116,7 +116,7 @@ public function offsetExists($key)
116116
/**
117117
* {@inheritdoc}
118118
*
119-
* @return mixed
119+
* @return TValue
120120
*/
121121
#[\ReturnTypeWillChange]
122122
public function offsetGet($key)

‎src/Symfony/Component/Form/Util/OrderedHashMapIterator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Util/OrderedHashMapIterator.php
+12-12Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,54 +18,54 @@
1818
*
1919
* @internal
2020
*
21-
* @template TKey
22-
* @template TValue
21+
* @template-covariant TKey of array-key
22+
* @template-covariant TValue
2323
*
2424
* @implements \Iterator<TKey, TValue>
2525
*/
2626
class OrderedHashMapIterator implements \Iterator
2727
{
2828
/**
29-
* @var array
29+
* @var array<TKey, TValue>
3030
*/
3131
private $elements;
3232

3333
/**
34-
* @var array
34+
* @var list<TKey>
3535
*/
3636
private $orderedKeys;
3737

3838
/**
3939
* @var int
4040
*/
41-
private $cursor;
41+
private $cursor = 0;
4242

4343
/**
4444
* @var int
4545
*/
4646
private $cursorId;
4747

4848
/**
49-
* @var array
49+
* @var array<int, int>
5050
*/
5151
private $managedCursors;
5252

5353
/**
54-
* @var string|int|null
54+
* @var TKey|null
5555
*/
5656
private $key;
5757

5858
/**
59-
* @var mixed
59+
* @var TValue|null
6060
*/
6161
private $current;
6262

6363
/**
6464
* @param array<TKey, TValue> $elements The elements of the map, indexed by their
6565
* keys
66-
* @param array $orderedKeys The keys of the map in the order in which
66+
* @param list<TKey> $orderedKeys The keys of the map in the order in which
6767
* they should be iterated
68-
* @param array $managedCursors An array from which to reference the
68+
* @param array<int, int> $managedCursors An array from which to reference the
6969
* iterator's cursor as long as it is alive.
7070
* This array is managed by the corresponding
7171
* {@link OrderedHashMap} instance to support
@@ -105,7 +105,7 @@ public function __destruct()
105105
/**
106106
* {@inheritdoc}
107107
*
108-
* @return mixed
108+
* @return TValue|null
109109
*/
110110
#[\ReturnTypeWillChange]
111111
public function current()
@@ -132,7 +132,7 @@ public function next(): void
132132
/**
133133
* {@inheritdoc}
134134
*
135-
* @return mixed
135+
* @return TKey|null
136136
*/
137137
#[\ReturnTypeWillChange]
138138
public function key()

‎src/Symfony/Component/HttpFoundation/HeaderBag.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/HeaderBag.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
*
1717
* @author Fabien Potencier <fabien@symfony.com>
1818
*
19-
* @implements \IteratorAggregate<string, array<int, string|null>>
19+
* @implements \IteratorAggregate<string, list<string|null>>
2020
*/
2121
class HeaderBag implements \IteratorAggregate, \Countable
2222
{
2323
protected const UPPER = '_ABCDEFGHIJKLMNOPQRSTUVWXYZ';
2424
protected const LOWER = '-abcdefghijklmnopqrstuvwxyz';
2525

2626
/**
27-
* @var array<string, array<int, string|null>>
27+
* @var array<string, list<string|null>>
2828
*/
2929
protected $headers = [];
3030
protected $cacheControl = [];
@@ -255,7 +255,7 @@ public function removeCacheControlDirective(string $key)
255255
/**
256256
* Returns an iterator for headers.
257257
*
258-
* @return \ArrayIterator<string, array<int, string|null>>
258+
* @return \ArrayIterator<string, list<string|null>>
259259
*/
260260
#[\ReturnTypeWillChange]
261261
public function getIterator()

‎src/Symfony/Component/HttpKernel/Kernel.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Kernel.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class_exists(ConfigCache::class);
5858
abstract class Kernel implements KernelInterface, RebootableInterface, TerminableInterface
5959
{
6060
/**
61-
* @var BundleInterface[]
61+
* @var array<string, BundleInterface>
6262
*/
6363
protected $bundles = [];
6464

‎src/Symfony/Component/HttpKernel/KernelInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/KernelInterface.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface KernelInterface extends HttpKernelInterface
3131
/**
3232
* Returns an array of bundles to register.
3333
*
34-
* @return iterable<BundleInterface>
34+
* @return iterable<mixed, BundleInterface>
3535
*/
3636
public function registerBundles();
3737

@@ -55,7 +55,7 @@ public function shutdown();
5555
/**
5656
* Gets the registered bundle instances.
5757
*
58-
* @return BundleInterface[]
58+
* @return array<string, BundleInterface>
5959
*/
6060
public function getBundles();
6161

‎src/Symfony/Component/Intl/Data/Bundle/Reader/BufferedBundleReader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Intl/Data/Bundle/Reader/BufferedBundleReader.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
class BufferedBundleReader implements BundleReaderInterface
2222
{
2323
private $reader;
24+
/** @var RingBuffer<string, mixed> */
2425
private $buffer;
2526

2627
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.