Merge "fix some spacing"
[lhc/web/wiklou.git] / includes / media / XMPValidate.php
index deb4448..9834e12 100644 (file)
  */
 
 /**
-* This contains some static methods for
-* validating XMP properties. See XMPInfo and XMPReader classes.
-*
-* Each of these functions take the same parameters
-* * an info array which is a subset of the XMPInfo::items array
-* * A value (passed as reference) to validate. This can be either a
-     simple value or an array
-* * A boolean to determine if this is validating a simple or complex values
-*
-* It should be noted that when an array is being validated, typically the validation
-* function is called once for each value, and then once at the end for the entire array.
-*
-* These validation functions can also be used to modify the data. See the gps and flash one's
-* for example.
-*
-* @see http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart1.pdf starting at pg 28
-* @see http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart2.pdf starting at pg 11
-*/
+ * This contains some static methods for
+ * validating XMP properties. See XMPInfo and XMPReader classes.
+ *
+ * Each of these functions take the same parameters
+ * * an info array which is a subset of the XMPInfo::items array
+ * * A value (passed as reference) to validate. This can be either a
+ *     simple value or an array
+ * * A boolean to determine if this is validating a simple or complex values
+ *
+ * It should be noted that when an array is being validated, typically the validation
+ * function is called once for each value, and then once at the end for the entire array.
+ *
+ * These validation functions can also be used to modify the data. See the gps and flash one's
+ * for example.
+ *
+ * @see http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart1.pdf starting at pg 28
+ * @see http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart2.pdf starting at pg 11
+ */
 class XMPValidate {
        /**
-       * function to validate boolean properties ( True or False )
-       *
-       * @param $info Array information about current property
-       * @param &$val Mixed current value to validate
-       * @param $standalone Boolean if this is a simple property or array
-       */
+        * function to validate boolean properties ( True or False )
+        *
+        * @param $info Array information about current property
+        * @param &$val Mixed current value to validate
+        * @param $standalone Boolean if this is a simple property or array
+        */
        public static function validateBoolean( $info, &$val, $standalone ) {
                if ( !$standalone ) {
                        // this only validates standalone properties, not arrays, etc
@@ -61,12 +61,12 @@ class XMPValidate {
        }
 
        /**
-       * function to validate rational properties ( 12/10 )
-       *
-       * @param $info Array information about current property
-       * @param &$val Mixed current value to validate
-       * @param $standalone Boolean if this is a simple property or array
-       */
+        * function to validate rational properties ( 12/10 )
+        *
+        * @param $info Array information about current property
+        * @param &$val Mixed current value to validate
+        * @param $standalone Boolean if this is a simple property or array
+        */
        public static function validateRational( $info, &$val, $standalone ) {
                if ( !$standalone ) {
                        // this only validates standalone properties, not arrays, etc
@@ -80,15 +80,15 @@ class XMPValidate {
        }
 
        /**
-       * function to validate rating properties -1, 0-5
-       *
-       * if its outside of range put it into range.
-       *
-       * @see MWG spec
-       * @param $info Array information about current property
-       * @param &$val Mixed current value to validate
-       * @param $standalone Boolean if this is a simple property or array
-       */
+        * function to validate rating properties -1, 0-5
+        *
+        * if its outside of range put it into range.
+        *
+        * @see MWG spec
+        * @param $info Array information about current property
+        * @param &$val Mixed current value to validate
+        * @param $standalone Boolean if this is a simple property or array
+        */
        public static function validateRating( $info, &$val, $standalone ) {
                if ( !$standalone ) {
                        // this only validates standalone properties, not arrays, etc
@@ -119,12 +119,12 @@ class XMPValidate {
        }
 
        /**
-       * function to validate integers
-       *
-       * @param $info Array information about current property
-       * @param &$val Mixed current value to validate
-       * @param $standalone Boolean if this is a simple property or array
-       */
+        * function to validate integers
+        *
+        * @param $info Array information about current property
+        * @param &$val Mixed current value to validate
+        * @param $standalone Boolean if this is a simple property or array
+        */
        public static function validateInteger( $info, &$val, $standalone ) {
                if ( !$standalone ) {
                        // this only validates standalone properties, not arrays, etc
@@ -138,13 +138,13 @@ class XMPValidate {
        }
 
        /**
-       * function to validate properties with a fixed number of allowed
-       * choices. (closed choice)
-       *
-       * @param $info Array information about current property
-       * @param &$val Mixed current value to validate
-       * @param $standalone Boolean if this is a simple property or array
-       */
+        * function to validate properties with a fixed number of allowed
+        * choices. (closed choice)
+        *
+        * @param $info Array information about current property
+        * @param &$val Mixed current value to validate
+        * @param $standalone Boolean if this is a simple property or array
+        */
        public static function validateClosed( $info, &$val, $standalone ) {
                if ( !$standalone ) {
                        // this only validates standalone properties, not arrays, etc
@@ -169,12 +169,12 @@ class XMPValidate {
        }
 
        /**
-       * function to validate and modify flash structure
-       *
-       * @param $info Array information about current property
-       * @param &$val Mixed current value to validate
-       * @param $standalone Boolean if this is a simple property or array
-       */
+        * function to validate and modify flash structure
+        *
+        * @param $info Array information about current property
+        * @param &$val Mixed current value to validate
+        * @param $standalone Boolean if this is a simple property or array
+        */
        public static function validateFlash( $info, &$val, $standalone ) {
                if ( $standalone ) {
                        // this only validates flash structs, not individual properties
@@ -198,17 +198,17 @@ class XMPValidate {
        }
 
        /**
-       * function to validate LangCode properties ( en-GB, etc )
-       *
-       * This is just a naive check to make sure it somewhat looks like a lang code.
-       *
-       * @see rfc 3066
-       * @see http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart1.pdf page 30 (section 8.2.2.5)
-       *
-       * @param $info Array information about current property
-       * @param &$val Mixed current value to validate
-       * @param $standalone Boolean if this is a simple property or array
-       */
+        * function to validate LangCode properties ( en-GB, etc )
+        *
+        * This is just a naive check to make sure it somewhat looks like a lang code.
+        *
+        * @see rfc 3066
+        * @see http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart1.pdf page 30 (section 8.2.2.5)
+        *
+        * @param $info Array information about current property
+        * @param &$val Mixed current value to validate
+        * @param $standalone Boolean if this is a simple property or array
+        */
        public static function validateLangCode( $info, &$val, $standalone ) {
                if ( !$standalone ) {
                        // this only validates standalone properties, not arrays, etc
@@ -223,22 +223,22 @@ class XMPValidate {
        }
 
        /**
-       * function to validate date properties, and convert to (partial) Exif format.
-       *
-       * Dates can be one of the following formats:
-       * YYYY
-       * YYYY-MM
-       * YYYY-MM-DD
-       * YYYY-MM-DDThh:mmTZD
-       * YYYY-MM-DDThh:mm:ssTZD
-       * YYYY-MM-DDThh:mm:ss.sTZD
-       *
-       * @param $info Array information about current property
-       * @param &$val Mixed current value to validate. Converts to TS_EXIF as a side-effect.
-             in cases where there's only a partial date, it will give things like
-             2011:04.
-       * @param $standalone Boolean if this is a simple property or array
-       */
+        * function to validate date properties, and convert to (partial) Exif format.
+        *
+        * Dates can be one of the following formats:
+        * YYYY
+        * YYYY-MM
+        * YYYY-MM-DD
+        * YYYY-MM-DDThh:mmTZD
+        * YYYY-MM-DDThh:mm:ssTZD
+        * YYYY-MM-DDThh:mm:ss.sTZD
+        *
+        * @param $info Array information about current property
+        * @param &$val Mixed current value to validate. Converts to TS_EXIF as a side-effect.
+        *      in cases where there's only a partial date, it will give things like
+        *      2011:04.
+        * @param $standalone Boolean if this is a simple property or array
+        */
        public static function validateDate( $info, &$val, $standalone ) {
                if ( !$standalone ) {
                        // this only validates standalone properties, not arrays, etc