Passed
Push — master ( 13b465...c7ccbc )
by Oleg
04:22
created
validator/UniqueValidator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     {
27 27
         foreach ($this->elements AS $element) {
28 28
             if (!$model->checkAttributeExists($element)) {
29
-                $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model);
29
+                $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model);
30 30
 
31 31
                 return false;
32 32
             }
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             $query = new Query($this->container->db);
36 36
             $query->select = $this->params['attribute'];
37 37
             $query->table = $this->params['table'];
38
-            $query->addWhere($this->params['attribute'] . '="' . $elementValue . '"');
38
+            $query->addWhere($this->params['attribute'].'="'.$elementValue.'"');
39 39
             $query->limit = 1;
40 40
             $query->single = true;
41 41
 
Please login to merge, or discard this patch.
validator/RegexpValidator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
     {
26 26
         foreach ($this->elements AS $element) {
27 27
             if (!$model->checkAttributeExists($element)) {
28
-                $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model);
28
+                $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model);
29 29
 
30 30
                 return false;
31 31
             }
32 32
             $elementValue = $model->$element;
33 33
             if (preg_match($this->params['pattern'], $elementValue) === false) {
34
-                $this->errors[] = 'Parameter ' . $element . ' not valid with regular expression';
34
+                $this->errors[] = 'Parameter '.$element.' not valid with regular expression';
35 35
 
36 36
                 return false;
37 37
             }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function client(IFormModel $model)
47 47
     {
48
-        $js = 'if (!this.value.match(' . $this->params['pattern'] . ')) {' .
48
+        $js = 'if (!this.value.match('.$this->params['pattern'].')) {'.
49 49
             ' e.preventDefault(); this.focus(); alert(\'Value not valid with regular expression\'); }';
50 50
 
51 51
         return $js;
Please login to merge, or discard this patch.
validator/RequiredValidator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@
 block discarded – undo
25 25
     {
26 26
         foreach ($this->elements AS $element) {
27 27
             if (!$model->checkAttributeExists($element)) {
28
-                $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model);
28
+                $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model);
29 29
 
30 30
                 return false;
31 31
             }
32 32
             if (!$model->$element) {
33
-                $this->errors[] = $element . ' error: required element is empty.';
33
+                $this->errors[] = $element.' error: required element is empty.';
34 34
 
35 35
                 return false;
36 36
             }
Please login to merge, or discard this patch.
validator/BooleanValidator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
     {
41 41
         foreach ($this->elements AS $element) {
42 42
             if (!$model->checkAttributeExists($element)) {
43
-                $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model);
43
+                $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model);
44 44
 
45 45
                 return false;
46 46
             }
47 47
             $elementValue = $model->$element;
48 48
 
49 49
             if (($elementValue !== $this->params['true']) && ($elementValue !== $this->params['false'])) {
50
-                $this->errors[] = $element . ' error: required element is empty.';
50
+                $this->errors[] = $element.' error: required element is empty.';
51 51
 
52 52
                 return false;
53 53
             }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function client(IFormModel $model)
63 63
     {
64
-        return 'if (this.value != ' . $this->params['true'] . ' && this.value != ' . $this->params['false'] . ') {' .
64
+        return 'if (this.value != '.$this->params['true'].' && this.value != '.$this->params['false'].') {'.
65 65
         ' e.preventDefault(); this.focus(); alert(\'Value not compatible\'); }';
66 66
     }
67 67
 }
Please login to merge, or discard this patch.
validator/FileValidator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
             if (!$model->checkAttributeExists($element)) {
28 28
                 $files = $this->container->request->getFiles();
29 29
                 if (!empty($this->params['maxFiles']) && (count($files->files) > $this->params['maxFiles'])) {
30
-                    $this->errors[] = 'Too many files in parameter ' . $element;
30
+                    $this->errors[] = 'Too many files in parameter '.$element;
31 31
 
32 32
                     return false;
33 33
                 }
@@ -35,17 +35,17 @@  discard block
 block discarded – undo
35 35
                     if (!empty($this->params['types']) && (strpos($this->params['types'],
36 36
                                 $fContext['type']) === false)
37 37
                     ) {
38
-                        $this->errors[] = 'File ' . $fContext['name'] . ' not allowed type';
38
+                        $this->errors[] = 'File '.$fContext['name'].' not allowed type';
39 39
 
40 40
                         return false;
41 41
                     }
42 42
                     if (!empty($this->params['minSize']) && ($fContext['size'] < $this->params['minSize'])) {
43
-                        $this->errors[] = 'File ' . $fContext['name'] . ' too small size';
43
+                        $this->errors[] = 'File '.$fContext['name'].' too small size';
44 44
 
45 45
                         return false;
46 46
                     }
47 47
                     if (!empty($this->params['maxSize']) && ($fContext['type'] > $this->params['maxSize'])) {
48
-                        $this->errors[] = 'File ' . $fContext['name'] . ' too many size';
48
+                        $this->errors[] = 'File '.$fContext['name'].' too many size';
49 49
 
50 50
                         return false;
51 51
                     }
Please login to merge, or discard this patch.
validator/UrlValidator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
     {
26 26
         foreach ($this->elements AS $element) {
27 27
             if (!$model->checkAttributeExists($element)) {
28
-                $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model);
28
+                $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model);
29 29
 
30 30
                 return false;
31 31
             }
32 32
             if (filter_var($model->$element, FILTER_VALIDATE_URL) === false) {
33
-                $this->errors[] = 'Parameter ' . $element . ' is not a valid URL address';
33
+                $this->errors[] = 'Parameter '.$element.' is not a valid URL address';
34 34
 
35 35
                 return false;
36 36
             }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function client(IFormModel $model)
46 46
     {
47
-        $jsString = 'if (/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(this.value' .
47
+        $jsString = 'if (/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(this.value'.
48 48
             ') != true) { e.preventDefault(); this.focus(); alert(\'Value is not a URL\'); }';
49 49
 
50 50
         return $jsString;
Please login to merge, or discard this patch.
validator/CaptchaValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     {
46 46
         foreach ($this->elements AS $element) {
47 47
             if (!$model->checkAttributeExists($element)) {
48
-                $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model);
48
+                $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model);
49 49
 
50 50
                 return false;
51 51
             }
Please login to merge, or discard this patch.
validator/CompareValidator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,23 +30,23 @@  discard block
 block discarded – undo
30 30
         }
31 31
 
32 32
         if (!$model->checkAttributeExists($this->params['attribute'])) {
33
-            throw new Exception('Attribute `' . $this->params['attribute'] . '` not found into ' . get_class($model));
33
+            throw new Exception('Attribute `'.$this->params['attribute'].'` not found into '.get_class($model));
34 34
         }
35 35
 
36 36
         foreach ($this->elements AS $element) {
37 37
             if (!$model->checkAttributeExists($element)) {
38
-                $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model);
38
+                $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model);
39 39
 
40 40
                 return false;
41 41
             }
42 42
 
43 43
             $elementValue = $model->$element;
44 44
             if (!empty($this->params['value']) && ($this->params['value'] !== $elementValue)) {
45
-                $this->errors[] = 'Parameter ' . $element . ' not equal ' . $this->params['value'];
45
+                $this->errors[] = 'Parameter '.$element.' not equal '.$this->params['value'];
46 46
 
47 47
                 return false;
48 48
             } elseif (!empty($this->params['attribute']) && ($model->{$this->params['attribute']} !== $elementValue)) {
49
-                $this->errors[] = 'Parameter ' . $element . ' not equal ' . $model->{$this->params['attribute']};
49
+                $this->errors[] = 'Parameter '.$element.' not equal '.$model->{$this->params['attribute']};
50 50
 
51 51
                 return false;
52 52
             }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $value = $model->$attribute;
67 67
         }
68 68
 
69
-        $js = 'if (this.value!="' . $value . '") { e.preventDefault(); this.focus(); alert(\'Value is not compatible\'); }';
69
+        $js = 'if (this.value!="'.$value.'") { e.preventDefault(); this.focus(); alert(\'Value is not compatible\'); }';
70 70
 
71 71
         return $js;
72 72
     }
Please login to merge, or discard this patch.
validator/NumberValidator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@
 block discarded – undo
25 25
     {
26 26
         foreach ($this->elements AS $element) {
27 27
             if (!$model->checkAttributeExists($element)) {
28
-                $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model);
28
+                $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model);
29 29
 
30 30
                 return false;
31 31
             }
32 32
             if (!is_numeric($model->$element)) {
33
-                $this->errors[] = 'Parameter ' . $element . ' is not a numeric';
33
+                $this->errors[] = 'Parameter '.$element.' is not a numeric';
34 34
             }
35 35
         }
36 36
 
Please login to merge, or discard this patch.