Completed
Push — master ( 2c1eb1...6e4c54 )
by Justin
03:16
created
system/core/validator/base.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@
 block discarded – undo
27 27
 
28 28
 interface Validator_Base {
29 29
 
30
-	public function isValide ($value) : bool;
30
+    public function isValide ($value) : bool;
31 31
 
32
-	public function validate ($value);
32
+    public function validate ($value);
33 33
 
34 34
 }
35 35
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@
 block discarded – undo
27 27
 
28 28
 interface Validator_Base {
29 29
 
30
-	public function isValide ($value) : bool;
30
+	public function isValide($value) : bool;
31 31
 
32
-	public function validate ($value);
32
+	public function validate($value);
33 33
 
34 34
 }
35 35
 
Please login to merge, or discard this patch.
system/core/validator/string.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -28,26 +28,26 @@
 block discarded – undo
28 28
  */
29 29
 class Validator_String implements Validator_Base {
30 30
 
31
-	public function isValide($value) : bool {
32
-		$validated_str = $this->validate($value);
31
+    public function isValide($value) : bool {
32
+        $validated_str = $this->validate($value);
33 33
 
34
-		return strcmp($value, $validated_str) === 0;
35
-	}
34
+        return strcmp($value, $validated_str) === 0;
35
+    }
36 36
 
37
-	public function validate($value) : string {
38
-		//escape string
39
-		//$value = Database::getInstance()->escape($value);
37
+    public function validate($value) : string {
38
+        //escape string
39
+        //$value = Database::getInstance()->escape($value);
40 40
 
41
-		//remove html entities
42
-		$value = htmlspecialchars($value, ENT_QUOTES, "UTF-8");//htmlentities($value, null, "UTF-8");
41
+        //remove html entities
42
+        $value = htmlspecialchars($value, ENT_QUOTES, "UTF-8");//htmlentities($value, null, "UTF-8");
43 43
 
44
-		return $value;
45
-	}
44
+        return $value;
45
+    }
46 46
 
47
-	public static function get (string $value) : string {
48
-		$obj = new Validator_String();
49
-		return $obj->validate($value);
50
-	}
47
+    public static function get (string $value) : string {
48
+        $obj = new Validator_String();
49
+        return $obj->validate($value);
50
+    }
51 51
 
52 52
 }
53 53
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,12 +39,12 @@
 block discarded – undo
39 39
 		//$value = Database::getInstance()->escape($value);
40 40
 
41 41
 		//remove html entities
42
-		$value = htmlspecialchars($value, ENT_QUOTES, "UTF-8");//htmlentities($value, null, "UTF-8");
42
+		$value = htmlspecialchars($value, ENT_QUOTES, "UTF-8"); //htmlentities($value, null, "UTF-8");
43 43
 
44 44
 		return $value;
45 45
 	}
46 46
 
47
-	public static function get (string $value) : string {
47
+	public static function get(string $value) : string {
48 48
 		$obj = new Validator_String();
49 49
 		return $obj->validate($value);
50 50
 	}
Please login to merge, or discard this patch.
system/core/validator/filename.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -27,19 +27,19 @@
 block discarded – undo
27 27
 
28 28
 class Validator_Filename implements Validator_Base {
29 29
 
30
-	public function isValide ($value): bool {
31
-		return ctype_alnum($value);
32
-	}
33
-
34
-	public function validate ($value) : string {
35
-		//remove all characters except except a-z, A-Z and 0-9
36
-		return preg_replace("/[^a-zA-Z0-9]+/", "", $value);
37
-	}
38
-
39
-	public static function get (string $value) : string {
40
-		$obj = new Validator_Filename();
41
-		return $obj->validate($value);
42
-	}
30
+    public function isValide ($value): bool {
31
+        return ctype_alnum($value);
32
+    }
33
+
34
+    public function validate ($value) : string {
35
+        //remove all characters except except a-z, A-Z and 0-9
36
+        return preg_replace("/[^a-zA-Z0-9]+/", "", $value);
37
+    }
38
+
39
+    public static function get (string $value) : string {
40
+        $obj = new Validator_Filename();
41
+        return $obj->validate($value);
42
+    }
43 43
 }
44 44
 
45 45
 ?>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,16 +27,16 @@
 block discarded – undo
27 27
 
28 28
 class Validator_Filename implements Validator_Base {
29 29
 
30
-	public function isValide ($value): bool {
30
+	public function isValide($value): bool {
31 31
 		return ctype_alnum($value);
32 32
 	}
33 33
 
34
-	public function validate ($value) : string {
34
+	public function validate($value) : string {
35 35
 		//remove all characters except except a-z, A-Z and 0-9
36 36
 		return preg_replace("/[^a-zA-Z0-9]+/", "", $value);
37 37
 	}
38 38
 
39
-	public static function get (string $value) : string {
39
+	public static function get(string $value) : string {
40 40
 		$obj = new Validator_Filename();
41 41
 		return $obj->validate($value);
42 42
 	}
Please login to merge, or discard this patch.
system/core/validator/color.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -27,39 +27,39 @@
 block discarded – undo
27 27
 
28 28
 class Validator_Color implements Validator_Base {
29 29
 
30
-	//https://code.hyperspatial.com/all-code/php-code/verify-hex-color-string/
30
+    //https://code.hyperspatial.com/all-code/php-code/verify-hex-color-string/
31 31
 
32
-	public function isValide ($value): bool {
33
-		if(preg_match('/^#[a-f0-9]{6}$/i', $value)) { //hex color is valid
34
-			//Verified hex color
35
-			return true;
36
-		} else if(preg_match('/^[a-f0-9]{6}$/i', $value)) {
37
-			//Check for a hex color string without hash 'c1c2b4'
38
-			//hex color is valid
32
+    public function isValide ($value): bool {
33
+        if(preg_match('/^#[a-f0-9]{6}$/i', $value)) { //hex color is valid
34
+            //Verified hex color
35
+            return true;
36
+        } else if(preg_match('/^[a-f0-9]{6}$/i', $value)) {
37
+            //Check for a hex color string without hash 'c1c2b4'
38
+            //hex color is valid
39 39
 
40
-			//$fix_color = '#' . $value;
40
+            //$fix_color = '#' . $value;
41 41
 
42
-			return true;
43
-		}
42
+            return true;
43
+        }
44 44
 
45
-		return false;
46
-	}
45
+        return false;
46
+    }
47 47
 
48
-	public function validate ($value) {
49
-		if(preg_match('/^#[a-f0-9]{6}$/i', $value)) { //hex color is valid
50
-			//Verified hex color
51
-			return $value;
52
-		} else if(preg_match('/^[a-f0-9]{6}$/i', $value)) {
53
-			//Check for a hex color string without hash 'c1c2b4'
54
-			//hex color is valid
48
+    public function validate ($value) {
49
+        if(preg_match('/^#[a-f0-9]{6}$/i', $value)) { //hex color is valid
50
+            //Verified hex color
51
+            return $value;
52
+        } else if(preg_match('/^[a-f0-9]{6}$/i', $value)) {
53
+            //Check for a hex color string without hash 'c1c2b4'
54
+            //hex color is valid
55 55
 
56
-			$fix_color = '#' . $value;
56
+            $fix_color = '#' . $value;
57 57
 
58
-			return $fix_color;
59
-		}
58
+            return $fix_color;
59
+        }
60 60
 
61
-		throw new Exception("method isnt implemented yet.");
62
-	}
61
+        throw new Exception("method isnt implemented yet.");
62
+    }
63 63
 
64 64
 }
65 65
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 
30 30
 	//https://code.hyperspatial.com/all-code/php-code/verify-hex-color-string/
31 31
 
32
-	public function isValide ($value): bool {
33
-		if(preg_match('/^#[a-f0-9]{6}$/i', $value)) { //hex color is valid
32
+	public function isValide($value): bool {
33
+		if (preg_match('/^#[a-f0-9]{6}$/i', $value)) { //hex color is valid
34 34
 			//Verified hex color
35 35
 			return true;
36
-		} else if(preg_match('/^[a-f0-9]{6}$/i', $value)) {
36
+		} else if (preg_match('/^[a-f0-9]{6}$/i', $value)) {
37 37
 			//Check for a hex color string without hash 'c1c2b4'
38 38
 			//hex color is valid
39 39
 
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 		return false;
46 46
 	}
47 47
 
48
-	public function validate ($value) {
49
-		if(preg_match('/^#[a-f0-9]{6}$/i', $value)) { //hex color is valid
48
+	public function validate($value) {
49
+		if (preg_match('/^#[a-f0-9]{6}$/i', $value)) { //hex color is valid
50 50
 			//Verified hex color
51 51
 			return $value;
52
-		} else if(preg_match('/^[a-f0-9]{6}$/i', $value)) {
52
+		} else if (preg_match('/^[a-f0-9]{6}$/i', $value)) {
53 53
 			//Check for a hex color string without hash 'c1c2b4'
54 54
 			//hex color is valid
55 55
 
Please login to merge, or discard this patch.
system/core/validator/token.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -27,24 +27,24 @@
 block discarded – undo
27 27
 
28 28
 class Validator_Token implements Validator_Base {
29 29
 
30
-	protected static $instance = null;
30
+    protected static $instance = null;
31 31
 
32
-	public function isValide ($value): bool {
33
-		return $value === $this->validate($value);
34
-	}
32
+    public function isValide ($value): bool {
33
+        return $value === $this->validate($value);
34
+    }
35 35
 
36
-	public function validate ($value) : string {
37
-		//remove all characters except except a-z, A-Z and 0-9
38
-		return preg_replace("/[^a-zA-Z_0-9]+/", "", $value);
39
-	}
36
+    public function validate ($value) : string {
37
+        //remove all characters except except a-z, A-Z and 0-9
38
+        return preg_replace("/[^a-zA-Z_0-9]+/", "", $value);
39
+    }
40 40
 
41
-	public static function get (string $value) : string {
42
-		if (self::$instance == null) {
43
-			self::$instance = new Validator_Token();
44
-		}
41
+    public static function get (string $value) : string {
42
+        if (self::$instance == null) {
43
+            self::$instance = new Validator_Token();
44
+        }
45 45
 
46
-		return self::$instance->validate($value);
47
-	}
46
+        return self::$instance->validate($value);
47
+    }
48 48
 
49 49
 }
50 50
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,16 +29,16 @@
 block discarded – undo
29 29
 
30 30
 	protected static $instance = null;
31 31
 
32
-	public function isValide ($value): bool {
32
+	public function isValide($value): bool {
33 33
 		return $value === $this->validate($value);
34 34
 	}
35 35
 
36
-	public function validate ($value) : string {
36
+	public function validate($value) : string {
37 37
 		//remove all characters except except a-z, A-Z and 0-9
38 38
 		return preg_replace("/[^a-zA-Z_0-9]+/", "", $value);
39 39
 	}
40 40
 
41
-	public static function get (string $value) : string {
41
+	public static function get(string $value) : string {
42 42
 		if (self::$instance == null) {
43 43
 			self::$instance = new Validator_Token();
44 44
 		}
Please login to merge, or discard this patch.
system/core/validator/mail.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -27,27 +27,27 @@
 block discarded – undo
27 27
 
28 28
 class Validator_Mail implements Validator_Base {
29 29
 
30
-	protected static $instance = null;
30
+    protected static $instance = null;
31 31
 
32
-	public function isValide ($value): bool {
33
-		return filter_var($value, FILTER_VALIDATE_EMAIL) !== false;
34
-	}
32
+    public function isValide ($value): bool {
33
+        return filter_var($value, FILTER_VALIDATE_EMAIL) !== false;
34
+    }
35 35
 
36
-	public function validate ($value) : string {
37
-		if (!$this->isValide($value)) {
38
-			throw new SecurityException("given mail '" . htmlentities($value) . "' isnt a valide mail.");
39
-		}
36
+    public function validate ($value) : string {
37
+        if (!$this->isValide($value)) {
38
+            throw new SecurityException("given mail '" . htmlentities($value) . "' isnt a valide mail.");
39
+        }
40 40
 
41
-		return filter_var($value, FILTER_VALIDATE_EMAIL);
42
-	}
41
+        return filter_var($value, FILTER_VALIDATE_EMAIL);
42
+    }
43 43
 
44
-	public static function get (string $value) : string {
45
-		if (self::$instance == null) {
46
-			self::$instance = new Validator_Mail();
47
-		}
44
+    public static function get (string $value) : string {
45
+        if (self::$instance == null) {
46
+            self::$instance = new Validator_Mail();
47
+        }
48 48
 
49
-		return self::$instance->validate($value);
50
-	}
49
+        return self::$instance->validate($value);
50
+    }
51 51
 
52 52
 }
53 53
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 
30 30
 	protected static $instance = null;
31 31
 
32
-	public function isValide ($value): bool {
32
+	public function isValide($value): bool {
33 33
 		return filter_var($value, FILTER_VALIDATE_EMAIL) !== false;
34 34
 	}
35 35
 
36
-	public function validate ($value) : string {
36
+	public function validate($value) : string {
37 37
 		if (!$this->isValide($value)) {
38 38
 			throw new SecurityException("given mail '" . htmlentities($value) . "' isnt a valide mail.");
39 39
 		}
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		return filter_var($value, FILTER_VALIDATE_EMAIL);
42 42
 	}
43 43
 
44
-	public static function get (string $value) : string {
44
+	public static function get(string $value) : string {
45 45
 		if (self::$instance == null) {
46 46
 			self::$instance = new Validator_Mail();
47 47
 		}
Please login to merge, or discard this patch.
system/core/validator/alphanumeric.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -27,24 +27,24 @@
 block discarded – undo
27 27
 
28 28
 class Validator_AlphaNumeric implements Validator_Base {
29 29
 
30
-	protected static $instance = null;
30
+    protected static $instance = null;
31 31
 
32
-	public function isValide ($value): bool {
33
-		return ctype_alnum($value);
34
-	}
32
+    public function isValide ($value): bool {
33
+        return ctype_alnum($value);
34
+    }
35 35
 
36
-	public function validate ($value) : string {
37
-		//remove all characters except except a-z, A-Z and 0-9
38
-		return preg_replace("/[^a-zA-Z0-9]+/", "", $value);
39
-	}
36
+    public function validate ($value) : string {
37
+        //remove all characters except except a-z, A-Z and 0-9
38
+        return preg_replace("/[^a-zA-Z0-9]+/", "", $value);
39
+    }
40 40
 
41
-	public static function get (string $value) : string {
42
-		if (self::$instance == null) {
43
-			self::$instance = new Validator_AlphaNumeric();
44
-		}
41
+    public static function get (string $value) : string {
42
+        if (self::$instance == null) {
43
+            self::$instance = new Validator_AlphaNumeric();
44
+        }
45 45
 
46
-		return self::$instance->validate($value);
47
-	}
46
+        return self::$instance->validate($value);
47
+    }
48 48
 
49 49
 }
50 50
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,16 +29,16 @@
 block discarded – undo
29 29
 
30 30
 	protected static $instance = null;
31 31
 
32
-	public function isValide ($value): bool {
32
+	public function isValide($value): bool {
33 33
 		return ctype_alnum($value);
34 34
 	}
35 35
 
36
-	public function validate ($value) : string {
36
+	public function validate($value) : string {
37 37
 		//remove all characters except except a-z, A-Z and 0-9
38 38
 		return preg_replace("/[^a-zA-Z0-9]+/", "", $value);
39 39
 	}
40 40
 
41
-	public static function get (string $value) : string {
41
+	public static function get(string $value) : string {
42 42
 		if (self::$instance == null) {
43 43
 			self::$instance = new Validator_AlphaNumeric();
44 44
 		}
Please login to merge, or discard this patch.
system/core/exception/securityexception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-class SecurityException extends Exception{
3
+class SecurityException extends Exception {
4 4
 
5 5
 }
Please login to merge, or discard this patch.
system/core/exception/configurationexception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-class ConfigurationException extends Exception{
3
+class ConfigurationException extends Exception {
4 4
 
5 5
 }
Please login to merge, or discard this patch.