Pastakhov has submitted this change and it was merged.

Change subject: rename classes constants for more comfortable reading (v 1.2.0)
......................................................................


rename classes constants for more comfortable reading (v 1.2.0)

Change-Id: Iac079850447babb966441d58f99259bd5a3c1575
---
M PhpTagsWiki.php
M includes/WikiW.php
M includes/WikiWCache.php
M includes/WikiWStats.php
M includes/WikiWTitle.php
5 files changed, 35 insertions(+), 35 deletions(-)

Approvals:
  Pastakhov: Verified; Looks good to me, approved



diff --git a/PhpTagsWiki.php b/PhpTagsWiki.php
index 2b95aff..6b3f190 100644
--- a/PhpTagsWiki.php
+++ b/PhpTagsWiki.php
@@ -33,7 +33,7 @@
        );
 }
 
-define( 'PHPTAGS_WIKI_VERSION' , '1.1.1' );
+define( 'PHPTAGS_WIKI_VERSION' , '1.2.0' );
 
 // Register this extension on Special:Version
 $wgExtensionCredits['phptags'][] = array(
diff --git a/includes/WikiW.php b/includes/WikiW.php
index 26a041b..42f4a80 100644
--- a/includes/WikiW.php
+++ b/includes/WikiW.php
@@ -8,11 +8,11 @@
  */
 class WikiW extends \PhpTags\GenericObject {
 
-       public static function c_CONTENTLANGUAGE() {
+       public static function c_CONTENT_LANGUAGE() {
                return $GLOBALS['wgLanguageCode'];
        }
 
-       public static function c_CURRENTVERSION() {
+       public static function c_CURRENT_VERSION() {
                static $value = false;
                if ( $value === false ) {
                        $value = \SpecialVersion::getVersion();
@@ -20,7 +20,7 @@
                return $value;
        }
 
-       public static function c_SCRIPTPATH() {
+       public static function c_SCRIPT_PATH() {
                return $GLOBALS['wgScriptPath'];
        }
 
@@ -28,17 +28,17 @@
                return $GLOBALS['wgServer'];
        }
 
-       public static function c_SERVERNAME() {
+       public static function c_SERVER_NAME() {
                global $wgServer;
                $serverParts = \wfParseUrl( $wgServer );
                return $serverParts && isset( $serverParts['host'] ) ? 
$serverParts['host'] : $wgServer;
        }
 
-       public static function c_SITENAME() {
+       public static function c_SITE_NAME() {
                return $GLOBALS['wgSitename'];
        }
 
-       public static function c_STYLEPATH() {
+       public static function c_STYLE_PATH() {
                return $GLOBALS['wgStylePath'];
        }
 
diff --git a/includes/WikiWCache.php b/includes/WikiWCache.php
index 35b971f..79535d8 100644
--- a/includes/WikiWCache.php
+++ b/includes/WikiWCache.php
@@ -2,7 +2,7 @@
 namespace PhpTagsObjects;
 
 /**
- * Description of WikiWCache
+ * The WikiWCache class manages the cache of page rendering.
  *
  * @author pastakhov
  */
@@ -43,18 +43,18 @@
                $wgOut->enableClientCache( false );
        }
 
-       public static function c_CACHEEXPIRY() {
+       public static function c_CACHE_EXPIRY() {
                return self::getParser()->getOutput()->getCacheExpiry();
        }
 
-       public static function c_CACHETIMESTRING() {
+       public static function c_CACHE_TIME_STRING() {
                return self::getParser()->getOutput()->getCacheTime();
        }
 
-       public static function c_CACHETIME() {
+       public static function c_CACHE_TIME() {
                return \PhpTags\Hooks::getObjectWithValue(
                                'DateTime',
-                               new \DateTime( self::c_CACHETIMESTRING() )
+                               new \DateTime( self::c_CACHE_TIME_STRING() )
                        );
        }
 
diff --git a/includes/WikiWStats.php b/includes/WikiWStats.php
index 29666f2..8526cb0 100644
--- a/includes/WikiWStats.php
+++ b/includes/WikiWStats.php
@@ -2,7 +2,7 @@
 namespace PhpTagsObjects;
 
 /**
- * Description of WikiWStats
+ * Static accessor class for site_stats and related things
  *
  * @author pastakhov
  */
@@ -15,7 +15,7 @@
         *
         */
 
-       public static function c_ACTIVEUSERS() {
+       public static function c_ACTIVE_USERS() {
                static $value = false;
                if ( $value === false ) {
                        $value = (int)\SiteStats::activeUsers();
diff --git a/includes/WikiWTitle.php b/includes/WikiWTitle.php
index 19a72d6..97889bd 100644
--- a/includes/WikiWTitle.php
+++ b/includes/WikiWTitle.php
@@ -13,7 +13,7 @@
        }
 
        public function toString() {
-               return (string)  self::c_FULLNAME( $this->name );
+               return (string)  self::c_FULL_NAME( $this->name );
        }
 
        public function m___construct( $name, $namespace = null ) {
@@ -37,14 +37,14 @@
                return false;
        }
 
-       public static function c_NSTEXT( $objectName, $title = null ) {
+       public static function c_NS_TEXT( $objectName, $title = null ) {
                if ( false === $title instanceof \Title ) {
                        $title = 
\PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_PARSER]->getTitle();
                }
                return $title->getNsText();
        }
 
-       public static function c_NSNUMBER( $objectName, $title = null ) {
+       public static function c_NS_NUMBER( $objectName, $title = null ) {
                if ( false === $title instanceof \Title ) {
                        $title = 
\PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_PARSER]->getTitle();
                }
@@ -58,56 +58,56 @@
                return $title->getText();
        }
 
-       public static function c_FULLNAME( $objectName, $title = null ) {
+       public static function c_FULL_NAME( $objectName, $title = null ) {
                if ( false === $title instanceof \Title ) {
                        $title = 
\PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_PARSER]->getTitle();
                }
                return $title->getPrefixedText();
        }
 
-       public static function c_BASENAME( $objectName, $title = null ) {
+       public static function c_BASE_NAME( $objectName, $title = null ) {
                if ( false === $title instanceof \Title ) {
                        $title = 
\PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_PARSER]->getTitle();
                }
                return $title->getBaseText();
        }
 
-       public static function c_SUBPAGENAME( $objectName, $title = null ) {
+       public static function c_SUBPAGE_NAME( $objectName, $title = null ) {
                if ( false === $title instanceof \Title ) {
                        $title = 
\PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_PARSER]->getTitle();
                }
                return $title->getSubpageText();
        }
 
-       public static function c_SUBJECTNSTEXT( $objectName, $title = null ) {
+       public static function c_SUBJECT_NS_TEXT( $objectName, $title = null ) {
                if ( false === $title instanceof \Title ) {
                        $title = 
\PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_PARSER]->getTitle();
                }
                return $title->getSubjectNsText();
        }
 
-       public static function c_TALKNSTEXT( $objectName, $title = null ) {
+       public static function c_TALK_NS_TEXT( $objectName, $title = null ) {
                if ( false === $title instanceof \Title ) {
                        $title = 
\PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_PARSER]->getTitle();
                }
                return $title->getTalkNsText();
        }
 
-       public static function c_ISCONTENTPAGE( $objectName, $title = null ) {
+       public static function c_IS_CONTENT_PAGE( $objectName, $title = null ) {
                if ( false === $title instanceof \Title ) {
                        $title = 
\PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_PARSER]->getTitle();
                }
                return $title->isContentPage();
        }
 
-       public static function c_ISMOVABLE( $objectName, $title = null ) {
+       public static function c_IS_MOVABLE( $objectName, $title = null ) {
                if ( false === $title instanceof \Title ) {
                        $title = 
\PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_PARSER]->getTitle();
                }
                return $title->isMovable();
        }
 
-       public static function c_ISMAINPAGE( $objectName, $title = null ) {
+       public static function c_IS_MAIN_PAGE( $objectName, $title = null ) {
                if ( false === $title instanceof \Title ) {
                        $title = 
\PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_PARSER]->getTitle();
                }
@@ -115,11 +115,11 @@
        }
 
        public function p_nsText() {
-               return self::c_NSTEXT( $this->name, $this->value );
+               return self::c_NS_TEXT( $this->name, $this->value );
        }
 
        public function p_nsNumber() {
-               return self::c_NSNUMBER( $this->name, $this->value );
+               return self::c_NS_NUMBER( $this->name, $this->value );
        }
 
        public function p_name() {
@@ -127,35 +127,35 @@
        }
 
        public function p_fullName() {
-               return self::c_FULLNAME( $this->name, $this->value );
+               return self::c_FULL_NAME( $this->name, $this->value );
        }
 
        public function p_baseName() {
-               return self::c_BASENAME( $this->name, $this->value );
+               return self::c_BASE_NAME( $this->name, $this->value );
        }
 
        public function p_subpageName() {
-               return self::c_SUBPAGENAME( $this->name, $this->value );
+               return self::c_SUBPAGE_NAME( $this->name, $this->value );
        }
 
        public function p_subjectNsText() {
-               return self::c_SUBJECTNSTEXT( $this->name, $this->value );
+               return self::c_SUBJECT_NS_TEXT( $this->name, $this->value );
        }
 
        public function p_talkNsText() {
-               return self::c_TALKNSTEXT( $this->name, $this->value );
+               return self::c_TALK_NS_TEXT( $this->name, $this->value );
        }
 
        public function p_isContentPage() {
-               return self::c_ISCONTENTPAGE( $this->name, $this->value );
+               return self::c_IS_CONTENT_PAGE( $this->name, $this->value );
        }
 
        public function p_isMovable() {
-               return self::c_ISMOVABLE( $this->name, $this->value );
+               return self::c_IS_MOVABLE( $this->name, $this->value );
        }
 
        public function p_isMainPage() {
-               return self::c_ISMAINPAGE( $this->name, $this->value );
+               return self::c_IS_MAIN_PAGE( $this->name, $this->value );
        }
 
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iac079850447babb966441d58f99259bd5a3c1575
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhpTagsWiki
Gerrit-Branch: master
Gerrit-Owner: Pastakhov <[email protected]>
Gerrit-Reviewer: Pastakhov <[email protected]>

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

Reply via email to