8000 minor #33007 Fix some return type annotations (derrabus) · symfony/symfony@f8a3517 · GitHub
[go: up one dir, main page]

Skip to content

Commit f8a3517

Browse files
minor #33007 Fix some return type annotations (derrabus)
This PR was merged into the 3.4 branch. Discussion ---------- Fix some return type annotations | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A This PR fixed some incorrect return type declarations I discovered while working on #32993. Commits ------- 0a78dc0 Fix some return type annotations.
2 parents b27c999 + 0a78dc0 commit f8a3517

File tree

7 files changed

+20
-30
lines changed

7 files changed

+20
-30
lines changed

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ protected function describeContainerParameter($parameter, array $options = [])
179179

180180
/**
181181
* Writes data as json.
182-
*
183-
* @return array|string
184182
*/
185183
private function writeData(array $data, array $options)
186184
{

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ protected function describeContainerParameter($parameter, array $options = [])
132132

133133
/**
134134
* Writes DOM document.
135-
*
136-
* @return \DOMDocument|string
137135
*/
138136
private function writeDocument(\DOMDocument $dom)
139137
{

src/Symfony/Component/Console/Descriptor/JsonDescriptor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ protected function describeApplication(Application $application, array $options
9292

9393
/**
9494
* Writes data as json.
95-
*
96-
* @return array|string
9795
*/
9896
private function writeData(array $data, array $options)
9997
{

src/Symfony/Component/Console/Descriptor/XmlDescriptor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent)
179179

180180
/**
181181
* Writes DOM document.
182-
*
183-
* @return \DOMDocument|string
184182
*/
185183
private function writeDocument(\DOMDocument $dom)
186184
{

src/Symfony/Component/DomCrawler/Crawler.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ public function addNode(\DOMNode $node)
334334
*
335335
* @param int $position The position
336336
*
337-
* @return self
337+
* @return static
338338
*/
339339
public function eq($position)
340340
{
@@ -377,7 +377,7 @@ public function each(\Closure $closure)
377377
* @param int $offset
378378
* @param int $length
379379
*
380-
* @return self
380+
* @return static
381381
*/
382382
public function slice($offset = 0, $length = null)
383383
{
@@ -391,7 +391,7 @@ public function slice($offset = 0, $length = null)
391391
*
392392
* @param \Closure $closure An anonymous function
393393
*
394-
* @return self
394+
* @return static
395395
*/
396396
public function reduce(\Closure $closure)
397397
{
@@ -408,7 +408,7 @@ public function reduce(\Closure $closure)
408408
/**
409409
* Returns the first node of the current selection.
410410
*
411-
* @return self
411+
* @return static
412412
*/
413413
public function first()
414414
{
@@ -418,7 +418,7 @@ public function first()
418418
/**
419419
* Returns the last node of the current selection.
420420
*
421-
* @return self
421+
* @return static
422422
*/
423423
public function last()
424424
{
@@ -428,7 +428,7 @@ public function last()
428428
/**
429429
* Returns the siblings nodes of the current selection.
430430
*
431-
* @return self
431+
* @return static
432432
*
433433
* @throws \InvalidArgumentException When current node is empty
434434
*/
@@ -444,7 +444,7 @@ public function siblings()
444444
/**
445445
* Returns the next siblings nodes of the current selection.
446446
*
447-
* @return self
447+
* @return static
448448
*
449449
* @throws \InvalidArgumentException When current node is empty
450450
*/
@@ -460,7 +460,7 @@ public function nextAll()
460460
/**
461461
* Returns the previous sibling nodes of the current selection.
462462
*
463-
* @return self
463+
* @return static
464464
*
465465
* @throws \InvalidArgumentException
466466
*/
@@ -476,7 +476,7 @@ public function previousAll()
476476
/**
477477
* Returns the parents nodes of the current selection.
478478
*
479-
* @return self
479+
* @return static
480480
*
481481
* @throws \InvalidArgumentException When current node is empty
482482
*/
@@ -501,7 +501,7 @@ public function parents()
501501
/**
502502
* Returns the children nodes of the current selection.
503503
*
504-
* @return self
504+
* @return static
505505
*
506506
* @throws \InvalidArgumentException When current node is empty
507507
*/
@@ -664,7 +664,7 @@ public function extract($attributes)
664664
*
665665
* @param string $xpath An XPath expression
666666
*
667-
* @return self
667+
* @return static
668668
*/
669669
public function filterXPath($xpath)
670670
{
@@ -685,7 +685,7 @@ public function filterXPath($xpath)
685685
*
686686
* @param string $selector A CSS selector
687687
*
688-
* @return self
688+
* @return static
689689
*
690690
* @throws \RuntimeException if the CssSelector Component is not available
691691
*/
@@ -706,7 +706,7 @@ public function filter($selector)
706706
*
707707
* @param string $value The link text
708708
*
709-
* @return self
709+
* @return static
710710
*/
711711
public function selectLink($value)
712712
{
@@ -721,7 +721,7 @@ public function selectLink($value)
721721
*
722722
* @param string $value The image alt
723723
*
724-
* @return self A new instance of Crawler with the filtered list of nodes
724+
* @return static A new instance of Crawler with the filtered list of nodes
725725
*/
726726
public function selectImage($value)
727727
{
@@ -735,7 +735,7 @@ public function selectImage($value)
735735
*
736736
* @param string $value The button text
737737
*
738-
* @return self
738+
* @return static
739739
*/
740740
public function selectButton($value)
741741
{
@@ -937,7 +937,7 @@ public static function xpathLiteral($s)
937937
*
938938
* @param string $xpath
939939
*
940-
* @return self
940+
* @return static
941941
*/
942942
private function filterRelativeXPath($xpath)
943943
{

src/Symfony/Component/Form/NativeRequestHandler.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private static function getRequestMethod()
192192
* This method is identical to {@link \Symfony\Component\HttpFoundation\FileBag::fixPhpFilesArray}
193193
* and should be kept as such in order to port fixes quickly and easily.
194194
*
195-
* @return array
195+
* @return mixed
196196
*/
197197
private static function fixPhpFilesArray($data)
198198
{
@@ -228,9 +228,7 @@ private static function fixPhpFilesArray($data)
228228
/**
229229
* Sets empty uploaded files to NULL in the given uploaded files array.
230230
*
231-
* @param mixed $data The file upload data
232-
*
233-
* @return array|null Returns the stripped upload data
231+
* @return mixed Returns the stripped upload data
234232
*/
235233
private static function stripEmptyFiles($data)
236234
{

src/Symfony/Component/HttpKernel/HttpCache/Store.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,13 @@ private function doPurge($url)
350350
*
351351
* @param string $key The store key
352352
*
353-
* @return string The data associated with the key
353+
* @return string|null The data associated with the key
354354
*/
355355
private function load($key)
356356
{
357357
$path = $this->getPath($key);
358358

359-
return file_exists($path) ? file_get_contents($path) : false;
359+
return file_exists($path) ? file_get_contents($path) : null;
360360
}
361361

362362
/**

0 commit comments

Comments
 (0)
0