Skip to content

Commit

Permalink
minor #33007 Fix some return type annotations (derrabus)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nicolas-grekas committed Aug 7, 2019
2 parents b27c999 + 0a78dc0 commit f8a3517
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 30 deletions.
Expand Up @@ -179,8 +179,6 @@ protected function describeContainerParameter($parameter, array $options = [])

/**
* Writes data as json.
*
* @return array|string
*/
private function writeData(array $data, array $options)
{
Expand Down
Expand Up @@ -132,8 +132,6 @@ protected function describeContainerParameter($parameter, array $options = [])

/**
* Writes DOM document.
*
* @return \DOMDocument|string
*/
private function writeDocument(\DOMDocument $dom)
{
Expand Down
2 changes: 0 additions & 2 deletions src/Symfony/Component/Console/Descriptor/JsonDescriptor.php
Expand Up @@ -92,8 +92,6 @@ protected function describeApplication(Application $application, array $options

/**
* Writes data as json.
*
* @return array|string
*/
private function writeData(array $data, array $options)
{
Expand Down
2 changes: 0 additions & 2 deletions src/Symfony/Component/Console/Descriptor/XmlDescriptor.php
Expand Up @@ -179,8 +179,6 @@ private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent)

/**
* Writes DOM document.
*
* @return \DOMDocument|string
*/
private function writeDocument(\DOMDocument $dom)
{
Expand Down
32 changes: 16 additions & 16 deletions src/Symfony/Component/DomCrawler/Crawler.php
Expand Up @@ -334,7 +334,7 @@ public function addNode(\DOMNode $node)
*
* @param int $position The position
*
* @return self
* @return static
*/
public function eq($position)
{
Expand Down Expand Up @@ -377,7 +377,7 @@ public function each(\Closure $closure)
* @param int $offset
* @param int $length
*
* @return self
* @return static
*/
public function slice($offset = 0, $length = null)
{
Expand All @@ -391,7 +391,7 @@ public function slice($offset = 0, $length = null)
*
* @param \Closure $closure An anonymous function
*
* @return self
* @return static
*/
public function reduce(\Closure $closure)
{
Expand All @@ -408,7 +408,7 @@ public function reduce(\Closure $closure)
/**
* Returns the first node of the current selection.
*
* @return self
* @return static
*/
public function first()
{
Expand All @@ -418,7 +418,7 @@ public function first()
/**
* Returns the last node of the current selection.
*
* @return self
* @return static
*/
public function last()
{
Expand All @@ -428,7 +428,7 @@ public function last()
/**
* Returns the siblings nodes of the current selection.
*
* @return self
* @return static
*
* @throws \InvalidArgumentException When current node is empty
*/
Expand All @@ -444,7 +444,7 @@ public function siblings()
/**
* Returns the next siblings nodes of the current selection.
*
* @return self
* @return static
*
* @throws \InvalidArgumentException When current node is empty
*/
Expand All @@ -460,7 +460,7 @@ public function nextAll()
/**
* Returns the previous sibling nodes of the current selection.
*
* @return self
* @return static
*
* @throws \InvalidArgumentException
*/
Expand All @@ -476,7 +476,7 @@ public function previousAll()
/**
* Returns the parents nodes of the current selection.
*
* @return self
* @return static
*
* @throws \InvalidArgumentException When current node is empty
*/
Expand All @@ -501,7 +501,7 @@ public function parents()
/**
* Returns the children nodes of the current selection.
*
* @return self
* @return static
*
* @throws \InvalidArgumentException When current node is empty
*/
Expand Down Expand Up @@ -664,7 +664,7 @@ public function extract($attributes)
*
* @param string $xpath An XPath expression
*
* @return self
* @return static
*/
public function filterXPath($xpath)
{
Expand All @@ -685,7 +685,7 @@ public function filterXPath($xpath)
*
* @param string $selector A CSS selector
*
* @return self
* @return static
*
* @throws \RuntimeException if the CssSelector Component is not available
*/
Expand All @@ -706,7 +706,7 @@ public function filter($selector)
*
* @param string $value The link text
*
* @return self
* @return static
*/
public function selectLink($value)
{
Expand All @@ -721,7 +721,7 @@ public function selectLink($value)
*
* @param string $value The image alt
*
* @return self A new instance of Crawler with the filtered list of nodes
* @return static A new instance of Crawler with the filtered list of nodes
*/
public function selectImage($value)
{
Expand All @@ -735,7 +735,7 @@ public function selectImage($value)
*
* @param string $value The button text
*
* @return self
* @return static
*/
public function selectButton($value)
{
Expand Down Expand Up @@ -937,7 +937,7 @@ public static function xpathLiteral($s)
*
* @param string $xpath
*
* @return self
* @return static
*/
private function filterRelativeXPath($xpath)
{
Expand Down
6 changes: 2 additions & 4 deletions src/Symfony/Component/Form/NativeRequestHandler.php
Expand Up @@ -192,7 +192,7 @@ private static function getRequestMethod()
* This method is identical to {@link \Symfony\Component\HttpFoundation\FileBag::fixPhpFilesArray}
* and should be kept as such in order to port fixes quickly and easily.
*
* @return array
* @return mixed
*/
private static function fixPhpFilesArray($data)
{
Expand Down Expand Up @@ -228,9 +228,7 @@ private static function fixPhpFilesArray($data)
/**
* Sets empty uploaded files to NULL in the given uploaded files array.
*
* @param mixed $data The file upload data
*
* @return array|null Returns the stripped upload data
* @return mixed Returns the stripped upload data
*/
private static function stripEmptyFiles($data)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/HttpKernel/HttpCache/Store.php
Expand Up @@ -350,13 +350,13 @@ private function doPurge($url)
*
* @param string $key The store key
*
* @return string The data associated with the key
* @return string|null The data associated with the key
*/
private function load($key)
{
$path = $this->getPath($key);

return file_exists($path) ? file_get_contents($path) : false;
return file_exists($path) ? file_get_contents($path) : null;
}

/**
Expand Down

0 comments on commit f8a3517

Please sign in to comment.