Minor documentation tweaks
authorReedy <reedy@wikimedia.org>
Mon, 9 Jul 2012 21:59:06 +0000 (22:59 +0100)
committerReedy <reedy@wikimedia.org>
Tue, 10 Jul 2012 13:38:12 +0000 (14:38 +0100)
Explicitly define array variable, rather than possible conditional assignment if no iteration takes place

Patch set 2: Fix accidental revert of Ib7c7c0f3ed9382beea5fb0a9b2aa1809f75a8e1c

Change-Id: Ic1cdec163e2cf9cb5d160209596962fc985d22bd

includes/media/FormatMetadata.php

index 9342374..0ae9a05 100644 (file)
@@ -309,7 +309,7 @@ class FormatMetadata {
                                                'redeye'   => ( $val & bindec( '01000000' ) ) >> 6,
 //                                             'reserved' => ($val & bindec( '10000000' )) >> 7,
                                        );
-
+                                       $flashMsgs = array();
                                        # We do not need to handle unknown values since all are used.
                                        foreach ( $flashDecode as $subTag => $subValue ) {
                                                # We do not need any message for zeroed values.
@@ -939,8 +939,9 @@ class FormatMetadata {
         * @param $lang String lang code of item or false
         * @param $default Boolean if it is default value.
         * @param $noHtml Boolean If to avoid html (for back-compat)
-        * @return language item (Note: despite how this looks,
-        *      this is treated as wikitext not html).
+        * @throws MWException
+        * @return string language item (Note: despite how this looks,
+        * this is treated as wikitext not html).
         */
        private static function langItem( $value, $lang, $default = false, $noHtml = false ) {
                if ( $lang === false && $default === false) {
@@ -1019,10 +1020,8 @@ class FormatMetadata {
         * Format a number, convert numbers from fractions into floating point
         * numbers, joins arrays of numbers with commas.
         *
-        * @private
-        *
         * @param $num Mixed: the value to format
-        * @param $round float|int digits to round to or false.
+        * @param $round float|int|bool digits to round to or false.
         * @return mixed A floating point number or whatever we were fed
         */
        static function formatNum( $num, $round = false ) {
@@ -1113,7 +1112,7 @@ class FormatMetadata {
         * a string, not an int.
         *
         * @param $val String: The 8 digit news code.
-        * @return srting The human readable form
+        * @return string The human readable form
         */
        static private function convertNewsCode( $val ) {
                if ( !preg_match( '/^\d{8}$/D', $val ) ) {
@@ -1185,7 +1184,7 @@ class FormatMetadata {
         * Format a coordinate value, convert numbers from floating point
         * into degree minute second representation.
         *
-        * @param $coord Array: degrees, minutes and seconds
+        * @param $coord int degrees, minutes and seconds
         * @param $type String: latitude or longitude (for if its a NWS or E)
         * @return mixed A floating point number or whatever we were fed
         */
@@ -1195,17 +1194,14 @@ class FormatMetadata {
                        $nCoord = -$coord;
                        if ( $type === 'latitude' ) {
                                $ref = 'S';
-                       }
-                       elseif ( $type === 'longitude' ) {
+                       } elseif ( $type === 'longitude' ) {
                                $ref = 'W';
                        }
-               }
-               else {
+               } else {
                        $nCoord = $coord;
                        if ( $type === 'latitude' ) {
                                $ref = 'N';
-                       }
-                       elseif ( $type === 'longitude' ) {
+                       } elseif ( $type === 'longitude' ) {
                                $ref = 'E';
                        }
                }
@@ -1354,12 +1350,19 @@ class FormatMetadata {
 **/
 class FormatExif {
        var $meta;
-       function FormatExif ( $meta ) {
+
+       /**
+        * @param $meta array
+        */
+       function FormatExif( $meta ) {
                wfDeprecated(__METHOD__);
                $this->meta = $meta;
        }
 
-       function getFormattedData ( ) {
+       /**
+        * @return array
+        */
+       function getFormattedData() {
                return FormatMetadata::getFormattedData( $this->meta );
        }
 }