Krinkle has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/84490


Change subject: doc: Clean up documentation for StringUtils classes
......................................................................

doc: Clean up documentation for StringUtils classes

Change-Id: Ie016c1d1686c9dce7944864e77e6c3bdf001d8c3
---
M includes/StringUtils.php
1 file changed, 27 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/90/84490/1

diff --git a/includes/StringUtils.php b/includes/StringUtils.php
index 48cde0e..c11d46e 100644
--- a/includes/StringUtils.php
+++ b/includes/StringUtils.php
@@ -217,8 +217,8 @@
        /**
         * More or less "markup-safe" explode()
         * Ignores any instances of the separator inside <...>
-        * @param $separator String
-        * @param $text String
+        * @param string $separator
+        * @param string $text
         * @return array
         */
        static function explodeMarkup( $separator, $text ) {
@@ -244,8 +244,8 @@
         * Escape a string to make it suitable for inclusion in a preg_replace()
         * replacement parameter.
         *
-        * @param $string String
-        * @return String
+        * @param string $string
+        * @return string
         */
        static function escapeRegexReplacement( $string ) {
                $string = str_replace( '\\', '\\\\', $string );
@@ -256,8 +256,8 @@
        /**
         * Workalike for explode() with limited memory usage.
         * Returns an Iterator
-        * @param $separator
-        * @param $subject
+        * @param string $separator
+        * @param string $subject
         * @return ArrayIterator|ExplodeIterator
         */
        static function explode( $separator, $subject ) {
@@ -290,14 +290,14 @@
        var $r;
 
        /**
-        * @param $r string
+        * @param string $r
         */
        function __construct( $r ) {
                $this->r = $r;
        }
 
        /**
-        * @param $matches array
+        * @param array $matches
         * @return string
         */
        function replace( $matches ) {
@@ -318,7 +318,7 @@
        /**
         * @param $from
         * @param $to
-        * @param $index int
+        * @param int $index
         */
        function __construct( $from, $to, $index = 0 ) {
                $this->from = $from;
@@ -327,7 +327,7 @@
        }
 
        /**
-        * @param $matches array
+        * @param array $matches
         * @return mixed
         */
        function replace( $matches ) {
@@ -343,7 +343,7 @@
 
        /**
         * @param $table
-        * @param $index int
+        * @param int $index
         */
        function __construct( $table, $index = 0 ) {
                $this->table = $table;
@@ -351,7 +351,7 @@
        }
 
        /**
-        * @param $matches array
+        * @param array $matches
         * @return mixed
         */
        function replace( $matches ) {
@@ -389,6 +389,7 @@
 
        /**
         * Set the whole replacement array at once
+        * @param array $data
         */
        function setArray( $data ) {
                $this->data = $data;
@@ -404,8 +405,8 @@
 
        /**
         * Set an element of the replacement array
-        * @param $from string
-        * @param $to string
+        * @param string $from
+        * @param string $to
         */
        function setPair( $from, $to ) {
                $this->data[$from] = $to;
@@ -413,7 +414,7 @@
        }
 
        /**
-        * @param $data array
+        * @param array $data
         */
        function mergeArray( $data ) {
                $this->data = array_merge( $this->data, $data );
@@ -421,7 +422,7 @@
        }
 
        /**
-        * @param $other
+        * @param ReplacementArray $other
         */
        function merge( $other ) {
                $this->data = array_merge( $this->data, $other->data );
@@ -429,7 +430,7 @@
        }
 
        /**
-        * @param $from string
+        * @param string $from
         */
        function removePair( $from ) {
                unset( $this->data[$from] );
@@ -437,7 +438,7 @@
        }
 
        /**
-        * @param $data array
+        * @param array $data
         */
        function removeArray( $data ) {
                foreach ( $data as $from => $to ) {
@@ -447,7 +448,7 @@
        }
 
        /**
-        * @param $subject string
+        * @param string $subject
         * @return string
         */
        function replace( $subject ) {
@@ -495,14 +496,14 @@
        /**
         * Construct a DelimIterator
         * @param $delim string
-        * @param $s string
+        * @param $subject string
         */
-       function __construct( $delim, $s ) {
-               $this->subject = $s;
+       function __construct( $delim, $subject ) {
+               $this->subject = $subject;
                $this->delim = $delim;
 
                // Micro-optimisation (theoretical)
-               $this->subjectLength = strlen( $s );
+               $this->subjectLength = strlen( $subject );
                $this->delimLength = strlen( $delim );
 
                $this->rewind();
@@ -530,6 +531,9 @@
                return $this->current;
        }
 
+       /**
+        * @return int|bool Current position or boolean false if invalid
+        */
        function key() {
                return $this->curPos;
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie016c1d1686c9dce7944864e77e6c3bdf001d8c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <krinklem...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to