Passed
Push — master ( 8543ab...7db5d1 )
by Anthony
03:06
created
core/form/FormValidator.class.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,48 +1,48 @@
 block discarded – undo
1 1
 <?php
2
-    namespace core\form;
2
+	namespace core\form;
3 3
 
4
-    class FormValidator {
5
-        private $datas = [];
6
-        private $errors = [];
4
+	class FormValidator {
5
+		private $datas = [];
6
+		private $errors = [];
7 7
 
8 8
 
9
-        //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
10
-        public function __construct($datas) {
11
-            $this->datas = $datas;
12
-        }
13
-        //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------//
9
+		//-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
10
+		public function __construct($datas) {
11
+			$this->datas = $datas;
12
+		}
13
+		//-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------//
14 14
 
15 15
 
16
-        //-------------------------- GETTER ----------------------------------------------------------------------------//
17
-        public function Check($name, $rule, $option=null) {
18
-            $validator = "validate".ucfirst($rule);
16
+		//-------------------------- GETTER ----------------------------------------------------------------------------//
17
+		public function Check($name, $rule, $option=null) {
18
+			$validator = "validate".ucfirst($rule);
19 19
 
20
-            if (!$this->$validator($name, $option)) {
21
-                $this->errors[$name] = "Le champ $name n'a pas été rempli correctement";
22
-            }
23
-        }
20
+			if (!$this->$validator($name, $option)) {
21
+				$this->errors[$name] = "Le champ $name n'a pas été rempli correctement";
22
+			}
23
+		}
24 24
 
25
-        public function getErrors() {
26
-            if (!empty($this->errors)) {
27
-                $errors = "<ul>";
28
-                foreach ($this->errors as $error) {
29
-                    $errors .= "<li>".$error."</li>";
30
-                }
31
-                $errors .= "</ul>";
25
+		public function getErrors() {
26
+			if (!empty($this->errors)) {
27
+				$errors = "<ul>";
28
+				foreach ($this->errors as $error) {
29
+					$errors .= "<li>".$error."</li>";
30
+				}
31
+				$errors .= "</ul>";
32 32
 
33
-                return $errors;
34
-            }
35
-        }
36
-        //-------------------------- FIN GETTER ----------------------------------------------------------------------------//
33
+				return $errors;
34
+			}
35
+		}
36
+		//-------------------------- FIN GETTER ----------------------------------------------------------------------------//
37 37
 
38 38
 
39
-        //-------------------------- SETTER ----------------------------------------------------------------------------//
40
-        public function validateRequired($name) {
41
-            return array_key_exists($name, $this->datas) && $this->datas[$name] != "";
42
-        }
39
+		//-------------------------- SETTER ----------------------------------------------------------------------------//
40
+		public function validateRequired($name) {
41
+			return array_key_exists($name, $this->datas) && $this->datas[$name] != "";
42
+		}
43 43
 
44
-        public function validateEmail($name) {
45
-            return array_key_exists($name, $this->datas) && filter_var($this->datas[$name], FILTER_VALIDATE_EMAIL);
46
-        }
47
-        //-------------------------- FIN SETTER ----------------------------------------------------------------------------//
48
-    }
49 44
\ No newline at end of file
45
+		public function validateEmail($name) {
46
+			return array_key_exists($name, $this->datas) && filter_var($this->datas[$name], FILTER_VALIDATE_EMAIL);
47
+		}
48
+		//-------------------------- FIN SETTER ----------------------------------------------------------------------------//
49
+	}
50 50
\ No newline at end of file
Please login to merge, or discard this patch.