From 449e60e3c01dfccf0c7d0ec84eaa35f38f6feaac Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Tue, 6 Feb 2018 21:16:40 +0100 Subject: [PATCH] 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: Ia7bc4ae1864d8c3fc2ad0b0ae55ec3137e8eaa12 --- WikiEditorHooks.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WikiEditorHooks.php b/WikiEditorHooks.php index 2fbcbb58..bba8f097 100644 --- a/WikiEditorHooks.php +++ b/WikiEditorHooks.php @@ -257,10 +257,10 @@ class WikiEditorHooks { * @return string */ private static function getEditingStatsId() { - if ( self::$statsId ) { - return self::$statsId; + if ( !self::$statsId ) { + self::$statsId = MWCryptRand::generateHex( 32 ); } - return self::$statsId = MWCryptRand::generateHex( 32 ); + return self::$statsId; } /**