diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2018-08-09 11:33:19 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2018-08-09 14:42:23 +0100 |
| commit | 0db594cc55dac0dd10e4bbed704b0097703ab74a (patch) | |
| tree | 7dba840670895b5547fff7366cad83ec5c89007b /app/Stats.php | |
| parent | b0b72ea46df4d8654cf8b9a04f9cc009b0af8be3 (diff) | |
| download | webtrees-0db594cc55dac0dd10e4bbed704b0097703ab74a.tar.gz webtrees-0db594cc55dac0dd10e4bbed704b0097703ab74a.tar.bz2 webtrees-0db594cc55dac0dd10e4bbed704b0097703ab74a.zip | |
Incorrect static call to function
Diffstat (limited to 'app/Stats.php')
| -rw-r--r-- | app/Stats.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/Stats.php b/app/Stats.php index 53809b03ef..81a02f571d 100644 --- a/app/Stats.php +++ b/app/Stats.php @@ -7022,8 +7022,11 @@ class Stats */ public function totalGedcomFavorites() { - if (Module::getModuleByName('gedcom_favorites')) { - return count(FamilyTreeFavoritesModule::getFavorites($this->tree, Auth::user())); + /** @var FamilyTreeFavoritesModule|null $module */ + $module = Module::getModuleByName('gedcom_favorites'); + + if ($module !== null) { + return count($module->getFavorites($this->tree)); } else { return 0; } @@ -7036,8 +7039,11 @@ class Stats */ public function totalUserFavorites() { - if (Module::getModuleByName('user_favorites')) { - return count(UserFavoritesModule::getFavorites($this->tree, Auth::user())); + /** @var UserFavoritesModule|null $module */ + $module = Module::getModuleByName('user_favorites'); + + if ($module !== null) { + return count($module->getFavorites($this->tree, Auth::user())); } else { return 0; } |
