Skip to content

Commit

Permalink
Simplify variable assignment using null coalescing operator (#4000)
Browse files Browse the repository at this point in the history
  • Loading branch information
datlechin authored Jun 22, 2024
1 parent f3c8921 commit 19196c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function run(InputInterface $input, ?Task $task = null): ComposerOutput
{
$this->application->resetComposer();

$this->output = $this->output ?? new BufferedOutput();
$this->output ??= new BufferedOutput();

// This hack is necessary so that relative path repositories are resolved properly.
$currDir = getcwd();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private function loadExtensions(): Collection

private function getMigrator(): Migrator
{
return $this->migrator = $this->migrator ?? new Migrator(
return $this->migrator ??= new Migrator(
new DatabaseMigrationRepository($this->database, 'migrations'),
$this->database,
new \Illuminate\Filesystem\Filesystem
Expand Down

0 comments on commit 19196c2

Please sign in to comment.