From 11e2a09b459c0c44c6b5fdcf9c3a807827d21514 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Wed, 17 Jul 2024 14:47:18 -0400 Subject: [PATCH 1/4] Clarify difference between `default()` and `getDefaultSite()` methods. --- src/Sites/Sites.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sites/Sites.php b/src/Sites/Sites.php index 40c6ac6665..0c422c6189 100644 --- a/src/Sites/Sites.php +++ b/src/Sites/Sites.php @@ -129,10 +129,10 @@ protected function getSavedSites() { return File::exists($sitesPath = $this->path()) ? YAML::file($sitesPath)->parse() - : $this->getDefaultSite(); + : $this->getDefaultSiteConfig(); } - protected function getDefaultSite() + protected function getDefaultSiteConfig() { return [ 'default' => [ From a5fd60e9d9f2731013e8810e30e0267f176db325 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Wed, 17 Jul 2024 14:48:22 -0400 Subject: [PATCH 2/4] Small nit. --- src/Sites/Sites.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sites/Sites.php b/src/Sites/Sites.php index 0c422c6189..4ff30796ae 100644 --- a/src/Sites/Sites.php +++ b/src/Sites/Sites.php @@ -149,6 +149,7 @@ public function save() $newSites = $this->getNewSites(); $deletedSites = $this->getDeletedSites(); + // Save sites to store $this->saveToStore(); // Dispatch our tracked `SiteCreated` and `SiteDeleted` events @@ -161,7 +162,6 @@ public function save() protected function saveToStore() { - // Save to file File::put($this->path(), YAML::dump($this->config())); } From cccbf50ef92d13cf66f585bd84c483f261c22269 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Wed, 17 Jul 2024 14:52:21 -0400 Subject: [PATCH 3/4] Actually this. --- src/Sites/Sites.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sites/Sites.php b/src/Sites/Sites.php index 4ff30796ae..3e50a4f441 100644 --- a/src/Sites/Sites.php +++ b/src/Sites/Sites.php @@ -129,10 +129,10 @@ protected function getSavedSites() { return File::exists($sitesPath = $this->path()) ? YAML::file($sitesPath)->parse() - : $this->getDefaultSiteConfig(); + : $this->getDefaultConfig(); } - protected function getDefaultSiteConfig() + protected function getDefaultConfig() { return [ 'default' => [ From 00ed624c56db0cbc3310ab1ca5bd9f7323d8e52d Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Wed, 17 Jul 2024 15:04:48 -0400 Subject: [PATCH 4/4] ~Actually this.~ Actually this. --- src/Sites/Sites.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sites/Sites.php b/src/Sites/Sites.php index 3e50a4f441..717ed3ad7f 100644 --- a/src/Sites/Sites.php +++ b/src/Sites/Sites.php @@ -129,10 +129,10 @@ protected function getSavedSites() { return File::exists($sitesPath = $this->path()) ? YAML::file($sitesPath)->parse() - : $this->getDefaultConfig(); + : $this->getFallbackConfig(); } - protected function getDefaultConfig() + protected function getFallbackConfig() { return [ 'default' => [