Skip to content

Commit

Permalink
[5.x] Clarify difference between default() and `getFallbackConfig()…
Browse files Browse the repository at this point in the history
…` site methods (#10470)
  • Loading branch information
jesseleite authored Jul 17, 2024
1 parent 9fbe4f5 commit 2e908b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Sites/Sites.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ protected function getSavedSites()
{
return File::exists($sitesPath = $this->path())
? YAML::file($sitesPath)->parse()
: $this->getDefaultSite();
: $this->getFallbackConfig();
}

protected function getDefaultSite()
protected function getFallbackConfig()
{
return [
'default' => [
Expand All @@ -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
Expand All @@ -161,7 +162,6 @@ public function save()

protected function saveToStore()
{
// Save to file
File::put($this->path(), YAML::dump($this->config()));
}

Expand Down

0 comments on commit 2e908b6

Please sign in to comment.