Skip to content

Commit

Permalink
Prevent errors in lower php version due to type hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
mtolhuys committed Jul 31, 2019
1 parent 2d78dbc commit 90bb2d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/Commands/EnvScan.php
Expand Up @@ -51,22 +51,22 @@ public function handle()

$this->scanner->scan();

$this->showOutput();
}

private function showOutput(): void
{
foreach ($this->scanner->warnings as $warning) {
$this->warn("Warning: <fg=red>{$warning->invocation}</fg=red> found in {$warning->location}");
}

if ($this->option('all')) {
if (empty($this->scanner->results['rows'])) {
$this->line('Nothing there...');
if (empty($this->scanner->results['rows'])) {
$this->line('Nothing there...');

return;
}

return;
}
$this->showResult();
}

private function showResult()
{
if ($this->option('all')) {
$this->table([
"Locations ({$this->scanner->results['locations']})",
"Defined ({$this->scanner->results['defined']})",
Expand Down
8 changes: 4 additions & 4 deletions src/LaravelEnvScanner.php
Expand Up @@ -203,7 +203,7 @@ private function searchMultiLine(array $lines, int $number)
*
* @param array $matches
*/
private function setInvocation(array $matches): void
private function setInvocation(array $matches)
{
$this->invocation = str_replace(' ', '', str_replace(
' ', '', $matches[0]
Expand All @@ -216,7 +216,7 @@ private function setInvocation(array $matches): void
*
* @param array $matches
*/
private function setParameters(array $matches): void
private function setParameters(array $matches)
{
$parameters = empty($matches[1][0]) ? $matches[2][0] : $matches[1][0];
$parameters = explode(',', str_replace(["'", '"', ' ',], '', $parameters));
Expand All @@ -232,7 +232,7 @@ private function setParameters(array $matches): void
*
* @param int $linenumber
*/
private function setLocation(int $linenumber): void
private function setLocation(int $linenumber)
{
$this->location = "{$this->file}:$linenumber";
}
Expand Down Expand Up @@ -265,7 +265,7 @@ private function alreadyProcessed(): bool
return in_array($this->parameters->variable, $this->processed['variables'], true);
}

private function storeResult(): void
private function storeResult()
{
$resultData = [
'location' => $this->location,
Expand Down

0 comments on commit 90bb2d9

Please sign in to comment.