Split assignment and return statement

Doing it in two lines makes it easier to read
This makes also clear that this is not a broken condition

Change-Id: I9771b6457789b7dc572f2d73d1fae8c361f9a1e6
This commit is contained in:
Umherirrender 2018-02-05 20:56:54 +01:00 committed by Reedy
parent a670a703b4
commit dc7d27a795
2 changed files with 14 additions and 7 deletions

View file

@ -39,7 +39,8 @@ class EchoCachedList implements EchoContainmentList {
$cacheKey = $this->getCacheKey();
$fetched = $this->cache->get( $cacheKey );
if ( is_array( $fetched ) ) {
return $this->result = $fetched;
$this->result = $fetched;
return $this->result;
}
$result = $this->nestedList->getValues();
@ -52,7 +53,8 @@ class EchoCachedList implements EchoContainmentList {
}
$this->cache->set( $cacheKey, $result, $this->timeout );
return $this->result = $result;
$this->result = $result;
return $this->result;
}
/**

View file

@ -517,15 +517,18 @@ class EchoEvent extends EchoAbstractEntity implements Bundleable {
$titleCache = EchoTitleLocalCache::create();
$title = $titleCache->get( $this->pageId );
if ( $title ) {
return $this->title = $title;
$this->title = $title;
return $this->title;
}
return $this->title = Title::newFromID( $this->pageId, $fromMaster ? Title::GAID_FOR_UPDATE : 0 );
$this->title = Title::newFromID( $this->pageId, $fromMaster ? Title::GAID_FOR_UPDATE : 0 );
return $this->title;
} elseif ( isset( $this->extra['page_title'], $this->extra['page_namespace'] ) ) {
return $this->title = Title::makeTitleSafe(
$this->title = Title::makeTitleSafe(
$this->extra['page_namespace'],
$this->extra['page_title']
);
return $this->title;
}
return null;
@ -541,10 +544,12 @@ class EchoEvent extends EchoAbstractEntity implements Bundleable {
$revisionCache = EchoRevisionLocalCache::create();
$revision = $revisionCache->get( $this->extra['revid'] );
if ( $revision ) {
return $this->revision = $revision;
$this->revision = $revision;
return $this->revision;
}
return $this->revision = Revision::newFromId( $this->extra['revid'] );
$this->revision = Revision::newFromId( $this->extra['revid'] );
return $this->revision;
}
return null;