Merge "Add to/tweak mediawiki and jqueryMsg JS tests, fix comment"
[lhc/web/wiklou.git] / includes / media / XMP.php
index 5fd4cb0..081433b 100644 (file)
@@ -236,7 +236,7 @@ class XMPReader {
         * Also catches any errors during processing, writes them to
         * debug log, blanks result array and returns false.
         *
-        * @param $content String: XMP data
+        * @param string $content XMP data
         * @param $allOfIt Boolean: If this is all the data (true) or if its split up (false). Default true
         * @param $reset Boolean: does xml parser need to be reset. Default false
         * @throws MWException
@@ -310,7 +310,7 @@ class XMPReader {
         *
         * @todo In serious need of testing
         * @see http://www.adobe.ge/devnet/xmp/pdfs/XMPSpecificationPart3.pdf XMP spec part 3 page 20
-        * @param String $content XMPExtended block minus the namespace signature
+        * @param string $content XMPExtended block minus the namespace signature
         * @return Boolean If it succeeded.
         */
        public function parseExtended( $content ) {
@@ -377,7 +377,7 @@ class XMPReader {
         * and are processing the 0/10 bit.
         *
         * @param $parser XMLParser reference to the xml parser
-        * @param $data String Character data
+        * @param string $data Character data
         * @throws MWException on invalid data
         */
        function char( $parser, $data ) {
@@ -412,9 +412,9 @@ class XMPReader {
         * Check to see if this is the element we started to ignore,
         * in which case we get out of MODE_IGNORE
         *
-        * @param $elm String Namespace of element followed by a space and then tag name of element.
+        * @param string $elm Namespace of element followed by a space and then tag name of element.
         */
-       private function endElementModeIgnore ( $elm ) {
+       private function endElementModeIgnore( $elm ) {
                if ( $this->curItem[0] === $elm ) {
                        array_shift( $this->curItem );
                        array_shift( $this->mode );
@@ -434,9 +434,9 @@ class XMPReader {
         * Or it could be if we hit the end element of a property
         * of a compound data structure (like a member of an array).
         *
-        * @param $elm String namespace, space, and tag name.
+        * @param string $elm namespace, space, and tag name.
         */
-       private function endElementModeSimple ( $elm ) {
+       private function endElementModeSimple( $elm ) {
                if ( $this->charContent !== false ) {
                        if ( $this->processingArray ) {
                                // if we're processing an array, use the original element
@@ -469,7 +469,7 @@ class XMPReader {
         *
         * This method is called when we hit the "</exif:ISOSpeedRatings>" tag.
         *
-        * @param $elm String namespace . space . tag name.
+        * @param string $elm namespace . space . tag name.
         * @throws MWException
         */
        private function endElementNested( $elm ) {
@@ -536,7 +536,7 @@ class XMPReader {
         * (For comparison, we call endElementModeSimple when we
         * hit the "</rdf:li>")
         *
-        * @param $elm String namespace . ' ' . element name
+        * @param string $elm namespace . ' ' . element name
         * @throws MWException
         */
        private function endElementModeLi( $elm ) {
@@ -576,7 +576,7 @@ class XMPReader {
         * Qualifiers aren't all that common, and we don't do anything
         * with them.
         *
-        * @param $elm String namespace and element
+        * @param string $elm namespace and element
         */
        private function endElementModeQDesc( $elm ) {
 
@@ -600,7 +600,7 @@ class XMPReader {
         * xmp and have no meaning.
         *
         * @param $parser XMLParser
-        * @param $elm String namespace . ' ' . element name
+        * @param string $elm namespace . ' ' . element name
         * @throws MWException
         */
        function endElement( $parser, $elm ) {
@@ -682,7 +682,7 @@ class XMPReader {
         * in which case we add it to the item stack, so we can ignore things
         * that are nested, correctly.
         *
-        * @param $elm String namespace . ' ' . tag name
+        * @param string $elm namespace . ' ' . tag name
         */
        private function startElementModeIgnore( $elm ) {
                if ( $elm === $this->curItem[0] ) {
@@ -695,7 +695,7 @@ class XMPReader {
         *  Start element in MODE_BAG (unordered array)
         * this should always be <rdf:Bag>
         *
-        * @param $elm String namespace . ' ' . tag
+        * @param string $elm namespace . ' ' . tag
         * @throws MWException if we have an element that's not <rdf:Bag>
         */
        private function startElementModeBag( $elm ) {
@@ -711,7 +711,7 @@ class XMPReader {
         * Start element in MODE_SEQ (ordered array)
         * this should always be <rdf:Seq>
         *
-        * @param $elm String namespace . ' ' . tag
+        * @param string $elm namespace . ' ' . tag
         * @throws MWException if we have an element that's not <rdf:Seq>
         */
        private function startElementModeSeq( $elm ) {
@@ -739,7 +739,7 @@ class XMPReader {
         * which are really only used for thumbnails, which
         * we don't care about.
         *
-        * @param $elm String namespace . ' ' . tag
+        * @param string $elm namespace . ' ' . tag
         * @throws MWException if we have an element that's not <rdf:Alt>
         */
        private function startElementModeLang( $elm ) {
@@ -765,8 +765,8 @@ class XMPReader {
         *
         * This method is called when processing the <rdf:Description> element
         *
-        * @param $elm String namespace and tag names separated by space.
-        * @param $attribs Array Attributes of the element.
+        * @param string $elm namespace and tag names separated by space.
+        * @param array $attribs Attributes of the element.
         * @throws MWException
         */
        private function startElementModeSimple( $elm, $attribs ) {
@@ -804,7 +804,7 @@ class XMPReader {
         *   </exif:DigitalZoomRatio>
         * Called when processing the <rdf:value> or <foo:someQualifier>.
         *
-        * @param $elm String namespace and tag name separated by a space.
+        * @param string $elm namespace and tag name separated by a space.
         *
         */
        private function startElementModeQDesc( $elm ) {
@@ -824,9 +824,9 @@ class XMPReader {
         *
         * This is generally where most properties start.
         *
-        * @param $ns String Namespace
-        * @param $tag String tag name (without namespace prefix)
-        * @param $attribs Array array of attributes
+        * @param string $ns Namespace
+        * @param string $tag tag name (without namespace prefix)
+        * @param array $attribs array of attributes
         * @throws MWException
         */
        private function startElementModeInitial( $ns, $tag, $attribs ) {
@@ -885,9 +885,9 @@ class XMPReader {
         * <exif:Flash rdf:parseType='Resource'> <exif:Fired>True</exif:Fired>
         *  <exif:Mode>1</exif:Mode></exif:Flash>
         *
-        * @param $ns String namespace
-        * @param $tag String tag name (no ns)
-        * @param $attribs Array array of attribs w/ values.
+        * @param string $ns namespace
+        * @param string $tag tag name (no ns)
+        * @param array $attribs array of attribs w/ values.
         * @throws MWException
         */
        private function startElementModeStruct( $ns, $tag, $attribs ) {
@@ -933,8 +933,8 @@ class XMPReader {
         *   </rdf:Seq> </exif:ISOSpeedRatings>
         * This method is called when we hit the <rdf:li> element.
         *
-        * @param $elm String: namespace . ' ' . tagname
-        * @param $attribs Array: Attributes. (needed for BAGSTRUCTS)
+        * @param string $elm namespace . ' ' . tagname
+        * @param array $attribs Attributes. (needed for BAGSTRUCTS)
         * @throws MWException if gets a tag other than <rdf:li>
         */
        private function startElementModeLi( $elm, $attribs ) {
@@ -985,23 +985,23 @@ class XMPReader {
         *
         * This method is called when we hit the <rdf:li> element.
         *
-        * @param $elm String namespace . ' ' . tag
-        * @param $attribs array array of elements (most importantly xml:lang)
+        * @param string $elm namespace . ' ' . tag
+        * @param array $attribs array of elements (most importantly xml:lang)
         * @throws MWException if gets a tag other than <rdf:li> or if no xml:lang
         */
        private function startElementModeLiLang( $elm, $attribs ) {
                if ( $elm !== self::NS_RDF . ' li' ) {
                        throw new MWException( __METHOD__ . " <rdf:li> expected but got $elm." );
                }
-               if ( !isset( $attribs[ self::NS_XML . ' lang'] )
-                       || !preg_match( '/^[-A-Za-z0-9]{2,}$/D', $attribs[ self::NS_XML . ' lang' ] ) )
+               if ( !isset( $attribs[self::NS_XML . ' lang'] )
+                       || !preg_match( '/^[-A-Za-z0-9]{2,}$/D', $attribs[self::NS_XML . ' lang'] ) )
                {
                        throw new MWException( __METHOD__
                                . " <rdf:li> did not contain, or has invalid xml:lang attribute in lang alternative" );
                }
 
                // Lang is case-insensitive.
-               $this->itemLang = strtolower( $attribs[ self::NS_XML . ' lang' ] );
+               $this->itemLang = strtolower( $attribs[self::NS_XML . ' lang'] );
 
                // need to add curItem[0] on again since one is for the specific item
                // and one is for the entire group.
@@ -1016,8 +1016,8 @@ class XMPReader {
         * Also does some initial set up for the wrapper element
         *
         * @param $parser XMLParser
-        * @param $elm String namespace "<space>" element
-        * @param $attribs Array attribute name => value
+        * @param string $elm namespace "<space>" element
+        * @param array $attribs attribute name => value
         * @throws MWException
         */
        function startElement( $parser, $elm, $attribs ) {
@@ -1107,7 +1107,7 @@ class XMPReader {
         * <rdf:Description rdf:about="" xmlns:exif="http://ns.adobe.com/exif/1.0/" exif:DigitalZoomRatio="0/10">
         * @endcode
         *
-        * @param $attribs Array attribute=>value array.
+        * @param array $attribs attribute=>value array.
         * @throws MWException
         */
        private function doAttribs( $attribs ) {
@@ -1156,9 +1156,9 @@ class XMPReader {
         * $this->processingArray to determine what name to
         * save the value under. (in addition to $tag).
         *
-        * @param $ns String namespace of tag this is for
-        * @param $tag String tag name
-        * @param $val String value to save
+        * @param string $ns namespace of tag this is for
+        * @param string $tag tag name
+        * @param string $val value to save
         */
        private function saveValue( $ns, $tag, $val ) {