summaryrefslogtreecommitdiff
path: root/app/Statistics.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-01-31 14:28:26 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-01-31 19:45:07 +0000
commite5a6b4d4f6f6e7ff2fba7ae2cf27546ae68a79cc (patch)
tree6d3095048a00ab3941129f8f5231d4b9483776d2 /app/Statistics.php
parent3c04ac885329c9488ff9db0a765e872bf41b9781 (diff)
downloadwebtrees-e5a6b4d4f6f6e7ff2fba7ae2cf27546ae68a79cc.tar.gz
webtrees-e5a6b4d4f6f6e7ff2fba7ae2cf27546ae68a79cc.tar.bz2
webtrees-e5a6b4d4f6f6e7ff2fba7ae2cf27546ae68a79cc.zip
Refactor class User - use NULL-object pattern for guests and temporary users, create UserService
Diffstat (limited to 'app/Statistics.php')
-rw-r--r--app/Statistics.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/Statistics.php b/app/Statistics.php
index b599116410..401d0fd8e9 100644
--- a/app/Statistics.php
+++ b/app/Statistics.php
@@ -20,6 +20,7 @@ namespace Fisharebest\Webtrees;
use Fisharebest\Webtrees\Module\ModuleBlockInterface;
use Fisharebest\Webtrees\Module\ModuleInterface;
use Fisharebest\Webtrees\Services\ModuleService;
+use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\Statistics\Repository\BrowserRepository;
use Fisharebest\Webtrees\Statistics\Repository\ContactRepository;
use Fisharebest\Webtrees\Statistics\Repository\EventRepository;
@@ -194,10 +195,12 @@ class Statistics implements
*
* @param ModuleService $module_service
* @param Tree $tree Generate statistics for this tree
+ * @param UserService $user_service
*/
public function __construct(
ModuleService $module_service,
- Tree $tree
+ Tree $tree,
+ UserService $user_service
) {
$this->tree = $tree;
$this->gedcomRepository = new GedcomRepository($tree);
@@ -206,15 +209,15 @@ class Statistics implements
$this->familyDatesRepository = new FamilyDatesRepository($tree);
$this->mediaRepository = new MediaRepository($tree);
$this->eventRepository = new EventRepository($tree);
- $this->userRepository = new UserRepository($tree);
+ $this->userRepository = new UserRepository($tree, $user_service);
$this->serverRepository = new ServerRepository();
$this->browserRepository = new BrowserRepository();
- $this->hitCountRepository = new HitCountRepository($tree);
- $this->latestUserRepository = new LatestUserRepository();
+ $this->hitCountRepository = new HitCountRepository($tree, $user_service);
+ $this->latestUserRepository = new LatestUserRepository($user_service);
$this->favoritesRepository = new FavoritesRepository($tree, $module_service);
$this->newsRepository = new NewsRepository($tree);
$this->messageRepository = new MessageRepository();
- $this->contactRepository = new ContactRepository($tree);
+ $this->contactRepository = new ContactRepository($tree, $user_service);
$this->placeRepository = new PlaceRepository($tree);
$this->module_service = $module_service;
}