Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
Fix inconsistent return points.
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored and nicolas-grekas committed Aug 20, 2019
1 parent ddadb0a commit dc26b98
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions WebServerConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function getDisplayAddress()
return gethostbyname($localHostname).':'.$this->port;
}

private function findFrontController($documentRoot, $env)
private function findFrontController(string $documentRoot, string $env): ?string
{
$fileNames = $this->getFrontControllerFileNames($env);

Expand All @@ -126,14 +126,16 @@ private function findFrontController($documentRoot, $env)
return $fileName;
}
}

return null;
}

private function getFrontControllerFileNames($env)
private function getFrontControllerFileNames(string $env): array
{
return ['app_'.$env.'.php', 'app.php', 'index_'.$env.'.php', 'index.php'];
}

private function findBestPort()
private function findBestPort(): int
{
$port = 8000;
while (false !== $fp = @fsockopen($this->hostname, $port, $errno, $errstr, 1)) {
Expand Down

0 comments on commit dc26b98

Please sign in to comment.