Merge "Several tweaks to the install.php script"
[lhc/web/wiklou.git] / includes / parser / LinkHolderArray.php
index 0e7c76f..dc0f933 100644 (file)
  * @ingroup Parser
  */
 class LinkHolderArray {
-       var $internals = array(), $interwikis = array();
-       var $size = 0;
-       var $parent;
+       /** @var array */
+       public $internals = array();
+
+       /** @var array */
+       public $interwikis = array();
+
+       /** @var int */
+       protected $size = 0;
+
+       /** @var Parser */
+       protected $parent;
+
+       /** @var int */
        protected $tempIdOffset;
 
        function __construct( $parent ) {
@@ -49,8 +59,8 @@ class LinkHolderArray {
         * serializing at present.
         *
         * Compact the titles, only serialize the text form.
-         * @return array
-         */
+        * @return array
+        */
        function __sleep() {
                foreach ( $this->internals as &$nsLinks ) {
                        foreach ( $nsLinks as &$entry ) {
@@ -88,7 +98,7 @@ class LinkHolderArray {
 
        /**
         * Merge another LinkHolderArray into this one
-        * @param $other LinkHolderArray
+        * @param LinkHolderArray $other
         */
        function merge( $other ) {
                foreach ( $other->internals as $ns => $entries ) {
@@ -110,9 +120,9 @@ class LinkHolderArray {
         * converted for use in the destination link holder. The resulting array of
         * strings will be returned.
         *
-        * @param $other LinkHolderArray
-        * @param array $texts of strings
-        * @return Array
+        * @param LinkHolderArray $other
+        * @param array $texts Array of strings
+        * @return array
         */
        function mergeForeign( $other, $texts ) {
                $this->tempIdOffset = $idOffset = $this->parent->nextLinkID();
@@ -208,8 +218,8 @@ class LinkHolderArray {
         * parsing of interwiki links, and secondly to allow all existence checks and
         * article length checks (for stub links) to be bundled into a single query.
         *
-        * @param $nt Title
-        * @param $text String
+        * @param Title $nt
+        * @param string $text
         * @param array $query [optional]
         * @param string $trail [optional]
         * @param string $prefix [optional]
@@ -253,7 +263,7 @@ class LinkHolderArray {
        /**
         * Replace <!--LINK--> link placeholders with actual links, in the buffer
         *
-        * @return array of link CSS classes, indexed by PDBK.
+        * @return array Array of link CSS classes, indexed by PDBK.
         */
        function replace( &$text ) {
                wfProfileIn( __METHOD__ );
@@ -267,6 +277,7 @@ class LinkHolderArray {
 
        /**
         * Replace internal links
+        * @param string $text
         */
        protected function replaceInternal( &$text ) {
                if ( !$this->internals ) {
@@ -333,7 +344,8 @@ class LinkHolderArray {
 
                        $res = $dbr->select(
                                'page',
-                               array( 'page_id', 'page_namespace', 'page_title', 'page_is_redirect', 'page_len', 'page_latest' ),
+                               array( 'page_id', 'page_namespace', 'page_title',
+                                       'page_is_redirect', 'page_len', 'page_latest' ),
                                $dbr->makeList( $where, LIST_OR ),
                                __METHOD__
                        );
@@ -418,6 +430,7 @@ class LinkHolderArray {
 
        /**
         * Replace interwiki links
+        * @param string $text
         */
        protected function replaceInterwiki( &$text ) {
                if ( empty( $this->interwikis ) ) {
@@ -443,6 +456,7 @@ class LinkHolderArray {
 
        /**
         * Modify $this->internals and $colours according to language variant linking rules
+        * @param array $colours
         */
        protected function doVariants( &$colours ) {
                global $wgContLang;
@@ -534,7 +548,8 @@ class LinkHolderArray {
                        // construct query
                        $dbr = wfGetDB( DB_SLAVE );
                        $varRes = $dbr->select( 'page',
-                               array( 'page_id', 'page_namespace', 'page_title', 'page_is_redirect', 'page_len', 'page_latest' ),
+                               array( 'page_id', 'page_namespace', 'page_title',
+                                       'page_is_redirect', 'page_len', 'page_latest' ),
                                $linkBatch->constructSet( 'page', $dbr ),
                                __METHOD__
                        );
@@ -606,8 +621,8 @@ class LinkHolderArray {
         * Replace <!--LINK--> link placeholders with plain text of links
         * (not HTML-formatted).
         *
-        * @param $text String
-        * @return String
+        * @param string $text
+        * @return string
         */
        function replaceText( $text ) {
                wfProfileIn( __METHOD__ );
@@ -624,7 +639,7 @@ class LinkHolderArray {
        /**
         * Callback for replaceText()
         *
-        * @param $matches Array
+        * @param array $matches
         * @return string
         * @private
         */