Ver Fonte

Add PHP5-style constructor

pdontthink há 8 anos atrás
pai
commit
66df95da9e
1 ficheiros alterados com 10 adições e 2 exclusões
  1. 10 2
      class/mime/Language.class.php

+ 10 - 2
class/mime/Language.class.php

@@ -23,10 +23,10 @@
  */
  */
 class Language {
 class Language {
     /**
     /**
-     * Class constructor
+     * Constructor (PHP5 style, required in some future version of PHP)
      * @param mixed $name
      * @param mixed $name
      */
      */
-    function Language($name) {
+    function __construct($name) {
         /** @var mixed */
         /** @var mixed */
         $this->name = $name;
         $this->name = $name;
         /**
         /**
@@ -35,4 +35,12 @@ class Language {
          */
          */
         $this->properties = array();
         $this->properties = array();
     }
     }
+
+    /**
+     * Constructor (PHP4 style, kept for compatibility reasons)
+     * @param string $name
+     */
+    function Language($name) {
+       self::__construct($name);
+    }
 }
 }