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

Commit dc26b98

Browse files
derrabusnicolas-grekas
authored andcommitted
Fix inconsistent return points.
1 parent ddadb0a commit dc26b98

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

WebServerConfig.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function getDisplayAddress()
117117
return gethostbyname($localHostname).':'.$this->port;
118118
}
119119

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

@@ -126,14 +126,16 @@ private function findFrontController($documentRoot, $env)
126126
return $fileName;
127127
}
128128
}
129+
130+
return null;
129131
}
130132

131-
private function getFrontControllerFileNames($env)
133+
private function getFrontControllerFileNames(string $env): array
132134
{
133135
return ['app_'.$env.'.php', 'app.php', 'index_'.$env.'.php', 'index.php'];
134136
}
135137

136-
private function findBestPort()
138+
private function findBestPort(): int
137139
{
138140
$port = 8000;
139141
while (false !== $fp = @fsockopen($this->hostname, $port, $errno, $errstr, 1)) {

0 commit comments

Comments
 (0)