Skip to content

Commit

Permalink
Fix return statements
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Aug 13, 2019
1 parent 1000881 commit 27f2b78
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions File/MimeType/FileBinaryMimeTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function guess($path)
}

if (!self::isSupported()) {
return;
return null;
}

ob_start();
Expand All @@ -84,14 +84,14 @@ public function guess($path)
if ($return > 0) {
ob_end_clean();

return;
return null;
}

$type = trim(ob_get_clean());

if (!preg_match('#^([a-z0-9\-]+/[a-z0-9\-\.]+)#i', $type, $match)) {
// it's not a type, but an error message
return;
return null;
}

return $match[1];
Expand Down
4 changes: 2 additions & 2 deletions File/MimeType/FileinfoMimeTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ public function guess($path)
}

if (!self::isSupported()) {
return;
return null;
}

if (!$finfo = new \finfo(FILEINFO_MIME_TYPE, $this->magicFile)) {
return;
return null;
}

return $finfo->file($path);
Expand Down
2 changes: 1 addition & 1 deletion File/MimeType/MimeTypeGuesserInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface MimeTypeGuesserInterface
*
* @param string $path The path to the file
*
* @return string The mime type or NULL, if none could be guessed
* @return string|null The mime type or NULL, if none could be guessed
*
* @throws FileNotFoundException If the file does not exist
* @throws AccessDeniedException If the file could not be read
Expand Down
6 changes: 3 additions & 3 deletions RequestStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function push(Request $request)
public function pop()
{
if (!$this->requests) {
return;
return null;
}

return array_pop($this->requests);
Expand All @@ -73,7 +73,7 @@ public function getCurrentRequest()
public function getMasterRequest()
{
if (!$this->requests) {
return;
return null;
}

return $this->requests[0];
Expand All @@ -95,7 +95,7 @@ public function getParentRequest()
$pos = \count($this->requests) - 2;

if (!isset($this->requests[$pos])) {
return;
return null;
}

return $this->requests[$pos];
Expand Down

0 comments on commit 27f2b78

Please sign in to comment.