From 19196c219cac433c1f4175cdb268684da6338b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ng=C3=B4=20Qu=E1=BB=91c=20=C4=90=E1=BA=A1t?= Date: Sat, 22 Jun 2024 16:53:00 +0700 Subject: [PATCH] Simplify variable assignment using null coalescing operator (#4000) --- extensions/package-manager/src/Composer/ComposerAdapter.php | 2 +- framework/core/src/Install/Steps/EnableBundledExtensions.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/package-manager/src/Composer/ComposerAdapter.php b/extensions/package-manager/src/Composer/ComposerAdapter.php index 9d88995ef9..16deb8bb7a 100644 --- a/extensions/package-manager/src/Composer/ComposerAdapter.php +++ b/extensions/package-manager/src/Composer/ComposerAdapter.php @@ -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(); diff --git a/framework/core/src/Install/Steps/EnableBundledExtensions.php b/framework/core/src/Install/Steps/EnableBundledExtensions.php index 2029347b79..1730b2964b 100644 --- a/framework/core/src/Install/Steps/EnableBundledExtensions.php +++ b/framework/core/src/Install/Steps/EnableBundledExtensions.php @@ -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