EBernhardson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/168697

Change subject: Hygiene: Don't reach through objects
......................................................................

Hygiene: Don't reach through objects

Just take the object you want in the first place.

Change-Id: I8282dcc5a51ecc343af95881c97775c857969491
---
M includes/Model/PostRevision.php
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/97/168697/1

diff --git a/includes/Model/PostRevision.php b/includes/Model/PostRevision.php
index fde46fb..cff357d 100644
--- a/includes/Model/PostRevision.php
+++ b/includes/Model/PostRevision.php
@@ -2,10 +2,11 @@
 
 namespace Flow\Model;
 
-use Flow\Container;
-use User;
-use Flow\Exception\DataModelException;
 use Flow\Collection\PostCollection;
+use Flow\Container;
+use Flow\Exception\DataModelException;
+use Flow\Repository\TreeRepository;
+use User;
 
 class PostRevision extends AbstractRevision {
        const MAX_TOPIC_LENGTH = 260;
@@ -290,8 +291,9 @@
         */
        public function getDepth() {
                if ( $this->depth === null ) {
-                       $rootLoader = Container::get( 'loader.root_post' );
-                       $rootPath = $rootLoader->getTreeRepo()->findRootPath( 
$this->getCollectionId() );
+                       /** @var TreeRepository $treeRepo */
+                       $treeRepo = Container::get( 'repository.tree' );
+                       $rootPath = $treeRepo->findRootPath( 
$this->getCollectionId() );
                        $this->setDepth( count( $rootPath ) - 1 );
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/168697
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8282dcc5a51ecc343af95881c97775c857969491
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to