Selaa lähdekoodia

Replace create_function with anonymous function

Julio Montoya 6 vuotta sitten
vanhempi
commit
1510ec9def
1 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 5 2
      main/inc/lib/pear/HTML/QuickForm/Rule/MinText.php

+ 5 - 2
main/inc/lib/pear/HTML/QuickForm/Rule/MinText.php

@@ -14,9 +14,12 @@ class Html_Quickform_Rule_MinText extends HTML_QuickForm_Rule
      * @param int $count The minimum number of characters that the text should contain
      * @return boolean True if text has the minimum number of chars required
      */
-    function validate($text, $count)
+    public function validate($text, $count)
     {
-        $checkMinText = create_function('$a,$b', 'return strlen(utf8_decode($a)) >= $b;');
+        $checkMinText = function($a, $b) {
+            return strlen(utf8_decode($a)) >= $b;
+        };
+
         return $checkMinText($text, $count);
     }
 }