summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-02-24 17:05:47 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-02-24 17:05:47 +0000
commit1c7a6874f7f5ce8e5488fa5894465312f1c19931 (patch)
tree9beeff642bfc23876f2c3e5772a1b1dd606b328a
parent580a4d1174de7a61a3939c1a257e48eec7c2f575 (diff)
downloadwebtrees-1c7a6874f7f5ce8e5488fa5894465312f1c19931.tar.gz
webtrees-1c7a6874f7f5ce8e5488fa5894465312f1c19931.tar.bz2
webtrees-1c7a6874f7f5ce8e5488fa5894465312f1c19931.zip
Collection / array
-rw-r--r--app/Fact.php7
-rw-r--r--app/Module/MediaTabModule.php2
-rw-r--r--app/Module/NotesTabModule.php2
-rw-r--r--app/Module/SourcesTabModule.php2
-rw-r--r--app/Services/CalendarService.php2
5 files changed, 8 insertions, 7 deletions
diff --git a/app/Fact.php b/app/Fact.php
index 3532ddf29d..5ab1e75a90 100644
--- a/app/Fact.php
+++ b/app/Fact.php
@@ -20,6 +20,7 @@ namespace Fisharebest\Webtrees;
use Closure;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
use Fisharebest\Webtrees\Services\GedcomService;
+use Illuminate\Support\Collection;
use InvalidArgumentException;
/**
@@ -690,9 +691,9 @@ class Fact
*
* @param Fact[] $unsorted
*
- * @return Fact[]
+ * @return Collection|Fact[]
*/
- public static function sortFacts($unsorted): array
+ public static function sortFacts($unsorted): Collection
{
$dated = [];
$nondated = [];
@@ -739,7 +740,7 @@ class Fact
$j++;
}
- return $sorted;
+ return new Collection($sorted);
}
/**
diff --git a/app/Module/MediaTabModule.php b/app/Module/MediaTabModule.php
index 638be5777d..9dbc6d5c9d 100644
--- a/app/Module/MediaTabModule.php
+++ b/app/Module/MediaTabModule.php
@@ -126,7 +126,7 @@ class MediaTabModule extends AbstractModule implements ModuleTabInterface
$this->facts[] = $fact;
}
}
- $this->facts = Fact::sortFacts($this->facts);
+ $this->facts = Fact::sortFacts($this->facts)->all();
}
return $this->facts;
diff --git a/app/Module/NotesTabModule.php b/app/Module/NotesTabModule.php
index f4a960092f..492328e7ec 100644
--- a/app/Module/NotesTabModule.php
+++ b/app/Module/NotesTabModule.php
@@ -125,7 +125,7 @@ class NotesTabModule extends AbstractModule implements ModuleTabInterface
$this->facts[] = $fact;
}
}
- $this->facts = Fact::sortFacts($this->facts);
+ $this->facts = Fact::sortFacts($this->facts)->all();
}
return $this->facts;
diff --git a/app/Module/SourcesTabModule.php b/app/Module/SourcesTabModule.php
index 1c55a20b3a..f122a279f8 100644
--- a/app/Module/SourcesTabModule.php
+++ b/app/Module/SourcesTabModule.php
@@ -125,7 +125,7 @@ class SourcesTabModule extends AbstractModule implements ModuleTabInterface
$this->facts[] = $fact;
}
}
- $this->facts = Fact::sortFacts($this->facts);
+ $this->facts = Fact::sortFacts($this->facts)->all();
}
return $this->facts;
diff --git a/app/Services/CalendarService.php b/app/Services/CalendarService.php
index fc68c39e6f..645f10215e 100644
--- a/app/Services/CalendarService.php
+++ b/app/Services/CalendarService.php
@@ -196,7 +196,7 @@ class CalendarService
switch ($sort_by) {
case 'anniv':
- $facts = Fact::sortFacts($facts);
+ $facts = Fact::sortFacts($facts)->all();
break;
case 'alpha':