Swap isset by null check in ApiSetNotificationTimestamp/ApiPurge
authorUmherirrender <umherirrender_de.wp@web.de>
Thu, 5 Apr 2018 10:39:24 +0000 (12:39 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Thu, 5 Apr 2018 10:39:24 +0000 (12:39 +0200)
Change-Id: I1ebcbacf476a716d23b183dcbf379555ee1519dd

includes/api/ApiPurge.php
includes/api/ApiSetNotificationTimestamp.php

index b7cfc2c..bb0be68 100644 (file)
@@ -26,7 +26,7 @@ use MediaWiki\MediaWikiServices;
  * @ingroup API
  */
 class ApiPurge extends ApiBase {
-       private $mPageSet;
+       private $mPageSet = null;
 
        /**
         * Purges the cache of a page
@@ -132,7 +132,7 @@ class ApiPurge extends ApiBase {
         * @return ApiPageSet
         */
        private function getPageSet() {
-               if ( !isset( $this->mPageSet ) ) {
+               if ( $this->mPageSet === null ) {
                        $this->mPageSet = new ApiPageSet( $this );
                }
 
index 5e7a633..f7dc4a7 100644 (file)
@@ -30,7 +30,7 @@ use MediaWiki\MediaWikiServices;
  */
 class ApiSetNotificationTimestamp extends ApiBase {
 
-       private $mPageSet;
+       private $mPageSet = null;
 
        public function execute() {
                $user = $this->getUser();
@@ -187,7 +187,7 @@ class ApiSetNotificationTimestamp extends ApiBase {
         * @return ApiPageSet
         */
        private function getPageSet() {
-               if ( !isset( $this->mPageSet ) ) {
+               if ( $this->mPageSet === null ) {
                        $this->mPageSet = new ApiPageSet( $this );
                }