Uh, also I shouldn't introduce syntax errors while fixing regressions.
[lhc/web/wiklou.git] / includes / Licenses.php
index aaa4405..e76ac23 100644 (file)
@@ -2,8 +2,7 @@
 /**
  * A License class for use on Special:Upload
  *
- * @package MediaWiki
- * @subpackage SpecialPage
+ * @ingroup SpecialPage
  *
  * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
  * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
@@ -31,12 +30,12 @@ class Licenses {
        /**#@-*/
 
        /**
-        * Constrictor
+        * Constructor
         *
         * @param $str String: the string to build the licenses member from, will use
         *                    wfMsgForContent( 'licenses' ) if null (default: null)
         */
-       function Licenses( $str = null ) {
+       function __construct( $str = null ) {
                // PHP sucks, this should be possible in the constructor
                $this->msg = is_null( $str ) ? wfMsgForContent( 'licenses' ) : $str;
                $this->html = '';
@@ -63,12 +62,14 @@ class Licenses {
                                        $obj = new License( $line );
                                        $this->stackItem( $this->licenses, $levels, $obj );
                                } else {
-                                       if ( $level < count( $levels ) )
+                                       if ( $level < count( $levels ) ) {
                                                $levels = array_slice( $levels, 0, $level );
-                                       if ( $level == count( $levels ) )
+                                       }
+                                       if ( $level == count( $levels ) ) {
                                                $levels[$level - 1] = $line;
-                                       else if ( $level > count( $levels ) )
+                                       } else if ( $level > count( $levels ) ) {
                                                $levels[] = $line;
+                                       }
                                }
                        }
                }
@@ -145,6 +146,9 @@ class Licenses {
        function getHtml() { return $this->html; }
 }
 
+/**
+ * A License class for use on Special:Upload (represents a single type of license).
+ */
 class License {
        /**
         * @var string
@@ -168,4 +172,3 @@ class License {
                $this->text = strrev( $text );
        }
 }
-?>