Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / includes / libs / IP.php
index 06589d2..da525e7 100644 (file)
@@ -425,7 +425,7 @@ class IP {
                        $ip = self::sanitizeIP( $ip );
                        $n = ip2long( $ip );
                        if ( $n < 0 ) {
-                               $n += pow( 2, 32 );
+                               $n += 2 ** 32;
                                # On 32-bit platforms (and on Windows), 2^32 does not fit into an int,
                                # so $n becomes a float. We convert it to string instead.
                                if ( is_float( $n ) ) {
@@ -467,7 +467,7 @@ class IP {
         * to an integer network and a number of bits
         *
         * @param string $range IP with CIDR prefix
-        * @return array(int or string, int)
+        * @return array [int or string, int]
         */
        public static function parseCIDR( $range ) {
                if ( self::isIPv6( $range ) ) {
@@ -487,7 +487,7 @@ class IP {
                        }
                        # Convert to unsigned
                        if ( $network < 0 ) {
-                               $network += pow( 2, 32 );
+                               $network += 2 ** 32;
                        }
                } else {
                        $network = false;
@@ -523,7 +523,7 @@ class IP {
                                $start = $end = false;
                        } else {
                                $start = sprintf( '%08X', $network );
-                               $end = sprintf( '%08X', $network + pow( 2, ( 32 - $bits ) ) - 1 );
+                               $end = sprintf( '%08X', $network + 2 ** ( 32 - $bits ) - 1 );
                        }
                // Explicit range
                } elseif ( strpos( $range, '-' ) !== false ) {
@@ -557,7 +557,7 @@ class IP {
         *
         * @param string $range
         *
-        * @return array(string, int)
+        * @return array [string, int]
         */
        private static function parseCIDR6( $range ) {
                # Explode into <expanded IP,range>
@@ -598,7 +598,7 @@ class IP {
         *
         * @param string $range
         *
-        * @return array(string, string)
+        * @return array [string, string]
         */
        private static function parseRange6( $range ) {
                # Expand any IPv6 IP