From: withoutaname Date: Wed, 23 Jul 2014 04:13:47 +0000 (-0700) Subject: Shorten ternary expressions in RawAction.php X-Git-Tag: 1.31.0-rc.0~14641^2 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=db635855f2e3c75ed455b7b549359f94c47752b4;p=lhc%2Fweb%2Fwiklou.git Shorten ternary expressions in RawAction.php Change-Id: Idc9e74344989bf1394e05ebaf23cfd9a8fb38e1a --- diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php index 4baf7b9c4a..37e6e667e8 100644 --- a/includes/actions/RawAction.php +++ b/includes/actions/RawAction.php @@ -205,10 +205,11 @@ class RawAction extends FormlessAction { switch ( $this->getRequest()->getText( 'direction' ) ) { case 'next': # output next revision, or nothing if there isn't one + $nextid = 0; if ( $oldid ) { - $oldid = $this->getTitle()->getNextRevisionID( $oldid ); + $nextid = $this->getTitle()->getNextRevisionID( $oldid ); } - $oldid = $oldid ? $oldid : -1; + $oldid = $nextid ?: -1; break; case 'prev': # output previous revision, or nothing if there isn't one @@ -216,8 +217,8 @@ class RawAction extends FormlessAction { # get the current revision so we can get the penultimate one $oldid = $this->page->getLatest(); } - $prev = $this->getTitle()->getPreviousRevisionID( $oldid ); - $oldid = $prev ? $prev : -1; + $previd = $this->getTitle()->getPreviousRevisionID( $oldid ); + $oldid = $previd ?: -1; break; case 'cur': $oldid = 0;