8000 Merge branch '5.3' into 5.4 · symfony/symfony@babdf51 · GitHub
[go: up one dir, main page]

Skip to content

Commit babdf51

Browse files
Merge branch '5.3' into 5.4
* 5.3: [Cache] Add missing return type [5.2] Add missing `@return` annotations [4.4] Add missing `@return` annotations Handle lock with long key #42227 update phpdoc to recommend createIndex over ensureIndex
2 parents cbe1f81 + 2a4e95d commit babdf51

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+199
-4
lines changed

src/Symfony/Bridge/Monolog/Handler/ElasticsearchLogstashHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ private function sendToElasticsearch(array $records)
129129
$this->wait(false);
130130
}
131131

132+
/**
133+
* @return array
134+
*/
132135
public function __sleep()
133136
{
134137
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);

src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ public function commit()
313313
return $this->invalidateTags([]);
314314
}
315315

316+
/**
317+
* @return array
318+
*/
316319
public function __sleep()
317320
{
318321
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);

src/Symfony/Component/Cache/DoctrineProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public function reset()
5252

5353
/**
5454
* {@inheritdoc}
55+
*
56+
* @return mixed
5557
*/
5658
protected function doFetch($id)
5759
{

src/Symfony/Component/Cache/Traits/AbstractAdapterTrait.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ public function reset()
315315
$this->ids = [];
316316
}
317317

318+
/**
319+
* @return array
320+
*/
318321
public function __sleep()
319322
{
320323
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);

src/Symfony/Component/DependencyInjection/Loader/Configurator/AbstractConfigurator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public function __call(string $method, array $args)
4141
throw new \BadMethodCallException(sprintf('Call to undefined method "%s::%s()".', static::class, $method));
4242
}
4343

44+
/**
45+
* @return array
46+
*/
4447
public function __sleep()
4548
{
4649
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);

src/Symfony/Component/DomCrawler/Form.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ public function offsetGet($name)
340340
* @param string $name The field name
341341
* @param string|array $value The value of the field
342342
*
343+
* @return void
344+
*
343345
* @throws \InvalidArgumentException if the field does not exist
344346
*/
345347
public function offsetSet($name, $value)
@@ -351,6 +353,8 @@ public function offsetSet($name, $value)
351353
* Removes a field from the form.
352354
*
353355
* @param string $name The field name
356+
*
357+
* @return void
354358
*/
355359
public function offsetUnset($name)
356360
{

src/Symfony/Component/ErrorHandler/BufferingLogger.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public function cleanLogs(): array
3535
return $logs;
3636
}
3737

38+
/**
39+
* @return array
40+
*/
3841
public function __sleep()
3942
{
4043
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);

src/Symfony/Component/EventDispatcher/GenericEvent.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ public function offsetGet($key)
128128
*
129129
* @param string $key Array key to set
130130
* @param mixed $value Value
131+
*
132+
* @return void
131133
*/
132134
public function offsetSet($key, $value)
133135
{
@@ -138,6 +140,8 @@ public function offsetSet($key, $value)
138140
* ArrayAccess for unset argument.
139141
*
140142
* @param string $key Array key
143+
*
144+
* @return void
141145
*/
142146
public function offsetUnset($key)
143147
{

src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public function hasChildren()
7676
return $this->isRecursive && $this->iterator->hasChildren();
7777
}
7878

79+
/**
80+
* @return self
81+
*/
7982
public function getChildren()
8083
{
8184
$children = new self($this->iterator->getChildren(), []);

src/Symfony/Component/Form/Button.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public function offsetExists($offset)
6363
*
6464
* @param mixed $offset
6565
*
66+
* @return mixed
67+
*
6668
* @throws BadMethodCallException
6769
*/
6870
public function offsetGet($offset)
@@ -78,6 +80,8 @@ public function offsetGet($offset)
7880
* @param mixed $offset
7981
* @param mixed $value
8082
*
83+
* @return void
84+
*
8185
* @throws BadMethodCallException
8286
*/
8387
public function offsetSet($offset, $value)
@@ -92,6 +96,8 @@ public function offsetSet($offset, $value)
9296
*
9397
* @param mixed $offset
9498
*
99+
* @return void
100+
*
95101
* @throws BadMethodCallException
96102
*/
97103
public function offsetUnset($offset)

src/Symfony/Component/Form/Form.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,8 @@ public function offsetGet($name)
990990
* @param string $name Ignored. The name of the child is used
991991
* @param FormInterface $child The child to be added
992992
*
993+
* @return void
994+
*
993995
* @throws AlreadySubmittedException if the form has already been submitted
994996
* @throws LogicException when trying to add a child to a non-compound form
995997
*
@@ -1005,6 +1007,8 @@ public function offsetSet($name, $child)
10051007
*
10061008
* @param string $name The name of the child to remove
10071009
*
1010+
* @return void
1011+
*
10081012
* @throws AlreadySubmittedException if the form has already been submitted
10091013
*/
10101014
public function offsetUnset($name)
@@ -1015,7 +1019,7 @@ public function offsetUnset($name)
10151019
/**
10161020
* Returns the iterator for this group.
10171021
*
1018-
* @return \Traversable|FormInterface[]
1022+
* @return \Traversable<FormInterface>
10191023
*/
10201024
public function getIterator()
10211025
{

src/Symfony/Component/Form/FormErrorIterator.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ public function offsetGet($position)
170170
/**
171171
* Unsupported method.
172172
*
173+
* @return void
174+
*
173175
* @throws BadMethodCallException
174176
*/
175177
public function offsetSet($position, $value)
@@ -180,6 +182,8 @@ public function offsetSet($position, $value)
180182
/**
181183
* Unsupported method.
182184
*
185+
* @return void
186+
*
183187
* @throws BadMethodCallException
184188
*/
185189
public function offsetUnset($position)
@@ -200,6 +204,8 @@ public function hasChildren()
200204

201205
/**
202206
* Alias of {@link current()}.
207+
*
208+
* @return self
203209
*/
204210
public function getChildren()
205211
{
@@ -233,6 +239,8 @@ public function count()
233239
*
234240
* @param int $position The new position
235241
*
242+
* @return void
243+
*
236244
* @throws OutOfBoundsException If the position is invalid
237245
*/
238246
public function seek($position)

src/Symfony/Component/Form/FormView.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ public function offsetExists($name)
128128
/**
129129
* Implements \ArrayAccess.
130130
*
131+
* @return void
132+
*
131133
* @throws BadMethodCallException always as setting a child by name is not allowed
132134
*/
133135
public function offsetSet($name, $value)
@@ -139,6 +141,8 @@ public function offsetSet($name, $value)
139141
* Removes a child (implements \ArrayAccess).
140142
*
141143
* @param string $name The child name
144+
*
145+
* @return void
142146
*/
143147
public function offsetUnset($name)
144148
{

src/Symfony/Component/Form/Util/InheritDataAwareIterator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class InheritDataAwareIterator extends \IteratorIterator implements \RecursiveIt
2727
{
2828
/**
2929
* {@inheritdoc}
30+
*
31+
* @return static
3032
*/
3133
public function getChildren()
3234
{

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ public function offsetExists($key)
108108

109109
/**
110110
* {@inheritdoc}
111+
*
112+
* @return mixed
111113
*/
112114
public function offsetGet($key)
113115
{
@@ -120,6 +122,8 @@ public function offsetGet($key)
120122

121123
/**
122124
* {@inheritdoc}
125+
*
126+
* @return void
123127
*/
124128
public function offsetSet($key, $value)
125129
{
@@ -141,6 +145,8 @@ public function offsetSet($key, $value)
141145

142146
/**
143147
* {@inheritdoc}
148+
*
149+
* @return void
144150
*/
145151
public function offsetUnset($key)
146152
{

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public function __construct(array &$elements, array &$orderedKeys, array &$manag
7676
$this->managedCursors[$this->cursorId] = &$this->cursor;
7777
}
7878

79+
/**
80+
* @return array
81+
*/
7982
public function __sleep()
8083
{
8184
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
@@ -99,6 +102,8 @@ public function __destruct()
99102

100103
/**
101104
* {@inheritdoc}
105+
*
106+
* @return mixed
102107
*/
103108
public function current()
104109
{
@@ -107,6 +112,8 @@ public function current()
107112

108113
/**
109114
* {@inheritdoc}
115+
*
116+
* @return void
110117
*/
111118
public function next()
112119
{
@@ -123,6 +130,8 @@ public function next()
123130

124131
/**
125132
* {@inheritdoc}
133+
*
134+
* @return mixed
126135
*/
127136
public function key()
128137
{
@@ -145,6 +154,8 @@ public function valid(): bool
145154

146155
/**
147156
* {@inheritdoc}
157+
*
158+
* @return void
148159
*/
149160
public function rewind()
150161
{

src/Symfony/Component/HttpClient/Chunk/ErrorChunk.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ public function didThrow(bool $didThrow = null): bool
120120
return $this->didThrow;
121121
}
122122

123+
/**
124+
* @return array
125+
*/
123126
public function __sleep()
124127
{
125128
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);

src/Symfony/Component/HttpClient/CurlHttpClient.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@ public function reset()
345345
$this->multi->reset();
346346
}
347347

348+
/**
349+
* @return array
350+
*/
348351
public function __sleep()
349352
{
350353
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);

src/Symfony/Component/HttpClient/HttplugClient.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ public function createUri($uri): UriInterface
218218
throw new \LogicException(sprintf('You cannot use "%s()" as the "nyholm/psr7" package is not installed. Try running "composer require nyholm/psr7".', __METHOD__));
219219
}
220220

221+
/**
222+
* @return array
223+
*/
221224
public function __sleep()
222225
{
223226
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);

src/Symfony/Component/HttpClient/Internal/CurlClientState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function reset()
6868
}
6969
}
7070

71-
public function __sleep()
71+
public function __sleep(): array
7272
{
7373
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
7474
}

src/Symfony/Component/HttpClient/Response/AmpResponse.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ public function getInfo(string $type = null)
142142
return null !== $type ? $this->info[$type] ?? null : $this->info;
143143
}
144144

145+
/**
146+
* @return array
147+
*/
145148
public function __sleep()
146149
{
147150
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);

src/Symfony/Component/HttpClient/Response/CommonResponseTrait.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ public function toStream(bool $throw = true)
127127
return $stream;
128128
}
129129

130+
/**
131+
* @return array
132+
*/
130133
public function __sleep()
131134
{
132135
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);

src/Symfony/Component/HttpClient/Response/TraceableResponse.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ public function __construct(HttpClientInterface $client, ResponseInterface $resp
4444
$this->event = $event;
4545
}
4646

47+
/**
48+
* @return array
49+
*/
4750
public function __sleep()
4851
{
4952
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);

src/Symfony/Component/HttpFoundation/File/Stream.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class Stream extends File
2020
{
2121
/**
2222
* {@inheritdoc}
23+
*
24+
* @return int|false
2325
*/
2426
public function getSize()
2527
{

src/Symfony/Component/Intl/Data/Util/ArrayAccessibleResourceBundle.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,25 @@ public function offsetExists($offset): bool
4444
return null !== $this->bundleImpl->get($offset);
4545
}
4646

47+
/**
48+
* @return mixed
49+
*/
4750
public function offsetGet($offset)
4851
{
4952
return $this->get($offset);
5053
}
5154

55+
/**
56+
* @return void
57+
*/
5258
public function offsetSet($offset, $value)
5359
{
5460
throw new BadMethodCallException('Resource bundles cannot be modified.');
5561
}
5662

63+
/**
64+
* @return void
65+
*/
5766
public function offsetUnset($offset)
5867
{
5968
throw new BadMethodCallException('Resource bundles cannot be modified.');

0 commit comments

Comments
 (0)
0