Skip to content

Commit

Permalink
Fix namespace collision on Laravel 8.10
Browse files Browse the repository at this point in the history
PHP Fatal error:  Access level to LarsJanssen\UnderConstruction\Commands\SetCodeCommand::newLine() must be public (as in class Illuminate\Console\Command) in /.../vendor/larsjanssen6/underconstruction/src/Commands/SetCodeCommand.php on line 97

   Symfony\Component\ErrorHandler\Error\FatalError 

  Access level to LarsJanssen\UnderConstruction\Commands\SetCodeCommand::newLine() must be public (as in class Illuminate\Console\Command)
  • Loading branch information
Alex Patrick authored Oct 18, 2020
1 parent e3c8a0a commit b47e779
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Commands/SetCodeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ protected function setHashInEnvironmentFile($hash)

if (preg_match($regex, $envContent)) {
$hash = str_replace(['\\', '$'], ['', '\$'], $hash);
$envContent = preg_replace($regex, $this->newLine($hash), $envContent);
$envContent = preg_replace($regex, $this->displayHash($hash), $envContent);
} else {
$envContent .= "\n".$this->newLine($hash)."\n";
$envContent .= "\n".$this->displayHash($hash)."\n";
}

$this->filesystem->put($envPath, $envContent);
Expand All @@ -94,7 +94,7 @@ protected function setHashInEnvironmentFile($hash)
* @param $hash
* @return string
*/
private function newLine($hash)
private function displayHash($hash)
{
return "UNDER_CONSTRUCTION_HASH=$hash";
}
Expand Down

0 comments on commit b47e779

Please sign in to comment.