8000 [4.4] Add missing `@return` annotations · symfony/symfony@3c578b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c578b1

Browse files
[4.4] Add missing @return annotations
1 parent a0d0c22 commit 3c578b1

File tree

37 files changed

+157
-1
lines changed

37 files changed

+157
-1
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
@@ -318,6 +318,9 @@ public function commit()
318318
return $this->invalidateTags([]);
319319
}
320320

321+
/**
322+
* @return array
323+
*/
321324
public function __sleep()
322325
{
323326
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
@@ -48,6 +48,8 @@ public function reset()
4848

4949
/**
5050
* {@inheritdoc}
51+
*
52+
* @return mixed
5153
*/
5254
protected function doFetch($id)
5355
{

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ public function saveDeferred(CacheItemInterface $item)
115115
return true;
116116
}
117117

118+
/**
119+
* @return array
120+
*/
118121
public function __sleep()
119122
{
120123
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
@@ -34,6 +34,9 @@ public function __call($method, $args)
3434
throw new \BadMethodCallException(sprintf('Call to undefined method "%s::%s()".', static::class, $method));
3535
}
3636

37+
/**
38+
* @return array
39+
*/
3740
public function __sleep()
3841
{
3942
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
@@ -346,6 +346,8 @@ public function offsetGet($name)
346346
* @param string $name The field name
347347
* @param string|array $value The value of the field
348348
*
349+
* @return void
350+
*
349351
* @throws \InvalidArgumentException if the field does not exist
350352
*/
351353
public function offsetSet($name, $value)
@@ -357,6 +359,8 @@ public function offsetSet($name, $value)
357359
* Removes a field from the form.
358360
*
359361
* @param string $name The field name
362+
*
363+
* @return void
360364
*/
361365
public function offsetUnset($name)
362366
{

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
@@ -133,6 +133,8 @@ public function offsetGet($key)
133133
*
134134
* @param string $key Array key to set
135135
* @param mixed $value Value
136+
*
137+
* @return void
136138
*/
137139
public function offsetSet($key, $value)
138140
{
@@ -143,6 +145,8 @@ public function offsetSet($key, $value)
143145
* ArrayAccess for unset argument.
144146
*
145147
* @param string $key Array key
148+
*
149+
* @return void
146150
*/
147151
public function offsetUnset($key)
148152
{

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
@@ -983,6 +983,8 @@ public function offsetGet($name)
983983
* @param string $name Ignored. The name of the child is used
984984
* @param FormInterface $child The child to be added
985985
*
986+
* @return void
987+
*
986988
* @throws AlreadySubmittedException if the form has already been submitted
987989
* @throws LogicException when trying to add a child to a non-compound form
988990
*
@@ -998,6 +1000,8 @@ public function offsetSet($name, $child)
9981000
*
9991001
* @param string $name The name of the child to remove
10001002
*
1003+
* @return void
1004+
*
10011005
* @throws AlreadySubmittedException if the form has already been submitted
10021006
*/
10031007
public function offsetUnset($name)
@@ -1008,7 +1012,7 @@ public function offsetUnset($name)
10081012
/**
10091013
* Returns the iterator for this group.
10101014
*
1011-
* @return \Traversable|FormInterface[]
1015+
* @return \Traversable<FormInterface>
10121016
*/
10131017
public function getIterator()
10141018
{

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
@@ -115,6 +115,9 @@ public function didThrow(): bool
115115
return $this->didThrow;
116116
}
117117

118+
/**
119+
* @return array
120+
*/
118121
public function __sleep()
119122
{
120123
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
@@ -362,6 +362,9 @@ public function reset()
362362
}
363363
}
364364

365+
/**
366+
* @return array
367+
*/
365368
public function __sleep()
366369
{
367370
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/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.');

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

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

5050
/**
5151
* {@inheritdoc}
52+
*
53+
* @return mixed
5254
*/
5355
public function offsetGet($key)
5456
{
@@ -61,6 +63,8 @@ public function offsetGet($key)
6163

6264
/**
6365
* {@inheritdoc}
66+
*
67+
* @return void
6468
*/
6569
public function offsetSet($key, $value)
6670
{
@@ -76,6 +80,8 @@ public function offsetSet($key, $value)
7680

7781
/**
7882
* {@inheritdoc}
83+
*
84+
* @return void
7985
*/
8086
public function offsetUnset($key)
8187
{

0 commit comments

Comments
 (0)
0