Passed
Push — master ( b53b80...d3b52d )
by Bruno
07:51
created
Formularium/Frontend/Bootstrap/RenderableBootstrapWrapperTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,17 +64,17 @@
 block discarded – undo
64 64
             $iconData[] = $icon;
65 65
             $group = HTMLNode::factory(
66 66
                 'div',
67
-                [ 'class' => "input-group mb-3" ],
67
+                ['class' => "input-group mb-3"],
68 68
                 [
69 69
                     HTMLNode::factory(
70 70
                         'div',
71
-                        [ 'class' => "input-group-prepend" ],
71
+                        ['class' => "input-group-prepend"],
72 72
                         HTMLNode::factory(
73 73
                             'span',
74
-                            [ 'class' => "input-group-text" ],
74
+                            ['class' => "input-group-text"],
75 75
                             HTMLNode::factory(
76 76
                                 'i',
77
-                                [ 'class' => $iconData ],
77
+                                ['class' => $iconData],
78 78
                                 []
79 79
                             )
80 80
                         )
Please login to merge, or discard this patch.
util/makeValidator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 
7 7
 $shortopts = "v:p::t::";
8 8
 $longopts = array(
9
-    "validator:",     // Required value
9
+    "validator:", // Required value
10 10
     "namespace::",
11 11
     "path::",
12 12
     "test-path::"
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 
20 20
 $validator = $options['validator'];
21 21
 $namespace = $options['namespace'] ?? 'Formularium\\Validator';
22
-$path = $options['path'] ?? "Formularium/Validator/" ;
23
-$testpath = $options['testpath'] ?? "tests/Validator" ;
22
+$path = $options['path'] ?? "Formularium/Validator/";
23
+$testpath = $options['testpath'] ?? "tests/Validator";
24 24
 
25 25
 $code = ValidatorFactory::generate(
26 26
     $validator,
Please login to merge, or discard this patch.
Formularium/Frontend/HTMLValidation/Renderable.php 1 patch
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -28,17 +28,17 @@
 block discarded – undo
28 28
 
29 29
         foreach ($validators as $validator => $data) {
30 30
             switch ($validator) {
31
-            case MinLength::class:
32
-                $element->setAttribute('minlength', $field->getValidatorOption($validator, 'value', ''));
33
-                break;
34
-            case MaxLength::class:
35
-                $element->setAttribute('maxlength', $field->getValidatorOption($validator, 'value', ''));
36
-                break;
37
-            case Regex::class:
38
-                $element->setAttribute('pattern', $field->getValidatorOption($validator, 'value', ''));
39
-                break;
40
-            default:
41
-                break;
31
+                case MinLength::class:
32
+                    $element->setAttribute('minlength', $field->getValidatorOption($validator, 'value', ''));
33
+                    break;
34
+                case MaxLength::class:
35
+                    $element->setAttribute('maxlength', $field->getValidatorOption($validator, 'value', ''));
36
+                    break;
37
+                case Regex::class:
38
+                    $element->setAttribute('pattern', $field->getValidatorOption($validator, 'value', ''));
39
+                    break;
40
+                default:
41
+                    break;
42 42
             }
43 43
         }
44 44
 
Please login to merge, or discard this patch.
Formularium/Frontend/Vuelidate/Renderable.php 2 patches
Switch Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -34,81 +34,81 @@
 block discarded – undo
34 34
 
35 35
         foreach ($validators as $validator => $data) {
36 36
             switch ($validator) {
37
-            case Datatype::REQUIRED:
38
-            case Filled::class:
39
-                $this->setValidations(
40
-                    $field,
41
-                    'required',
42
-                    'required'
43
-                );
44
-                break;
45
-            case Equals::class:
46
-                // TODO
47
-                break;
37
+                case Datatype::REQUIRED:
38
+                case Filled::class:
39
+                    $this->setValidations(
40
+                        $field,
41
+                        'required',
42
+                        'required'
43
+                    );
44
+                    break;
45
+                case Equals::class:
46
+                    // TODO
47
+                    break;
48 48
 
49
-            case In::class:
50
-                // TODO
51
-                break;
49
+                case In::class:
50
+                    // TODO
51
+                    break;
52 52
 
53
-            case Max::class:
54
-                $this->setValidations(
55
-                    $field,
56
-                    'maxValue',
57
-                    'maxValue(' . $field->getValidatorOption($validator, 'value', '') . ')'
58
-                );
59
-                break;
60
-            case Min::class:
61
-                $this->setValidations(
62
-                    $field,
63
-                    'minValue',
64
-                    'minValue(' . $field->getValidatorOption($validator, 'value', '') . ')'
65
-                );
66
-                break;
53
+                case Max::class:
54
+                    $this->setValidations(
55
+                        $field,
56
+                        'maxValue',
57
+                        'maxValue(' . $field->getValidatorOption($validator, 'value', '') . ')'
58
+                    );
59
+                    break;
60
+                case Min::class:
61
+                    $this->setValidations(
62
+                        $field,
63
+                        'minValue',
64
+                        'minValue(' . $field->getValidatorOption($validator, 'value', '') . ')'
65
+                    );
66
+                    break;
67 67
 
68
-            case MaxLength::class:
69
-                $this->setValidations(
70
-                    $field,
71
-                    'maxLength',
72
-                    'maxLength(' . $field->getValidatorOption($validator, 'value', '') . ')'
73
-                );
74
-                break;
75
-            case MinLength::class:
76
-                $this->setValidations(
77
-                    $field,
78
-                    'minLength',
79
-                    'minLength(' . $field->getValidatorOption($validator, 'value', '') . ')'
80
-                );
81
-                break;
68
+                case MaxLength::class:
69
+                    $this->setValidations(
70
+                        $field,
71
+                        'maxLength',
72
+                        'maxLength(' . $field->getValidatorOption($validator, 'value', '') . ')'
73
+                    );
74
+                    break;
75
+                case MinLength::class:
76
+                    $this->setValidations(
77
+                        $field,
78
+                        'minLength',
79
+                        'minLength(' . $field->getValidatorOption($validator, 'value', '') . ')'
80
+                    );
81
+                    break;
82 82
 
83
-            case NotIn::class:
84
-                // TODO
85
-                break;
83
+                case NotIn::class:
84
+                    // TODO
85
+                    break;
86 86
 
87
-            case Password::class:
88
-                // TODO
89
-                break;
87
+                case Password::class:
88
+                    // TODO
89
+                    break;
90 90
 
91
-            case Regex::class:
92
-                $name = 'regex' . mt_rand();
93
-                $this->setValidations(
94
-                    $field,
95
-                    $name,
96
-                    'helpers.regex(\'' . $name . '\', /' . $field->getValidatorOption($validator, 'value', '') . '/)',
97
-                    'helpers'
98
-                );
99
-                break;
91
+                case Regex::class:
92
+                    $name = 'regex' . mt_rand();
93
+                    $this->setValidations(
94
+                        $field,
95
+                        $name,
96
+                        'helpers.regex(\'' . $name . '\', /' . $field->getValidatorOption($validator, 'value', '') . '/)',
97
+                        'helpers'
98
+                    );
99
+                    break;
100 100
                         
101
-            case SameAs::class:
102
-                $target = $field->getValidatorOption($validator, 'value', '');
103
-                $locator = $target;// TODO
104
-                $this->setValidations(
105
-                    $field,
106
-                    'sameAs',
107
-                    'sameAs(' . $locator . ')'
108
-                );
109
-                break;
110
-            default:
111
-                break;
101
+                case SameAs::class:
102
+                    $target = $field->getValidatorOption($validator, 'value', '');
103
+                    $locator = $target;// TODO
104
+                    $this->setValidations(
105
+                        $field,
106
+                        'sameAs',
107
+                        'sameAs(' . $locator . ')'
108
+                    );
109
+                    break;
110
+                default:
111
+                    break;
112 112
             }
113 113
         }
114 114
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
                         
101 101
             case SameAs::class:
102 102
                 $target = $field->getValidatorOption($validator, 'value', '');
103
-                $locator = $target;// TODO
103
+                $locator = $target; // TODO
104 104
                 $this->setValidations(
105 105
                     $field,
106 106
                     'sameAs',
Please login to merge, or discard this patch.
Formularium/Frontend/Vue/VueCode.php 1 patch
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,12 +20,11 @@  discard block
 block discarded – undo
20 20
  */
21 21
 function expandJS(array $data): array
22 22
 {
23
-    return array_map(function ($key, $value) {
23
+    return array_map(function($key, $value) {
24 24
         return "$key" .
25 25
             (
26 26
                 is_array($value) ?
27
-                ': {' . implode(",\n", expandJS($value)) . '}' :
28
-                ($value ? ':' . $value : '')
27
+                ': {' . implode(",\n", expandJS($value)) . '}' : ($value ? ':' . $value : '')
29 28
             );
30 29
     }, array_keys($data), $data);
31 30
 }
@@ -257,7 +256,7 @@  discard block
 block discarded – undo
257 256
      */
258 257
     protected function serializeProps(array $props): string
259 258
     {
260
-        $s = array_map(function ($p) {
259
+        $s = array_map(function($p) {
261 260
             return "'{$p['name']}': { 'type': {$p['type']}" . ($p['required'] ?? false ? ", 'required': true" : '') . " } ";
262 261
         }, $props);
263 262
         return "{\n        " . implode(",\n        ", $s) . "\n    }";
@@ -276,7 +275,7 @@  discard block
 block discarded – undo
276 275
         $jsonData = json_encode($data);
277 276
         $props = $this->props($m);
278 277
         $propsBind = array_map(
279
-            function ($p) {
278
+            function($p) {
280 279
                 return 'v-bind:' . $p . '="model.' . $p . '"';
281 280
             },
282 281
             array_keys($props)
@@ -288,14 +287,14 @@  discard block
 block discarded – undo
288 287
             'propsBind' => implode(' ', $propsBind),
289 288
             'imports' => implode(
290 289
                 "\n",
291
-                array_map(function ($key, $value) {
290
+                array_map(function($key, $value) {
292 291
                     // TODO: array
293 292
                     return "import $key from \"$value\";";
294 293
                 }, array_keys($this->imports), $this->imports)
295 294
             ),
296 295
             'computedCode' => implode(
297 296
                 "\n",
298
-                array_map(function ($key, $value) {
297
+                array_map(function($key, $value) {
299 298
                     // TODO: array
300 299
                     return "$key() { $value },";
301 300
                 }, array_keys($this->computed), $this->computed)
@@ -307,7 +306,7 @@  discard block
 block discarded – undo
307 306
             'methodsCode' => '{}', // TODO
308 307
             'extraData' => implode(
309 308
                 "\n",
310
-                array_map(function ($key, $value) {
309
+                array_map(function($key, $value) {
311 310
                     return "  $key: $value,";
312 311
                 }, array_keys($this->extraData), $this->extraData)
313 312
             )
Please login to merge, or discard this patch.
Formularium/Frontend/Vuelidate/Framework.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
                 ),
30 30
                 HTMLNode::factory(
31 31
                     'script',
32
-                    [ ],
32
+                    [],
33 33
                     'Vue.use(window.vuelidate.default)'
34 34
                 )
35 35
             ]
Please login to merge, or discard this patch.
Formularium/Frontend/VeeValidate/Framework.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
                 ),
24 24
                 HTMLNode::factory(
25 25
                     'script',
26
-                    [ ],
26
+                    [],
27 27
                     'Vue.component("validation-provider", VeeValidate.ValidationProvider);'
28 28
                 )
29 29
             ]
Please login to merge, or discard this patch.
Formularium/Frontend/VeeValidate/Renderable.php 1 patch
Switch Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -69,50 +69,50 @@
 block discarded – undo
69 69
         $rules = [];
70 70
         foreach ($validators as $validator => $data) {
71 71
             switch ($validator) {
72
-            case Datatype::REQUIRED:
73
-            case Filled::class:
74
-                $rules['required'] = true;
75
-                break;
76
-
77
-            case Equals::class:
78
-                $rules['oneOf'] = implode(',', $field->getValidatorOption($validator, 'value', ''));
79
-                break;
80
-
81
-            case In::class:
82
-                $rules['oneOf'] = implode(',', $field->getValidatorOption($validator, 'value', ''));
83
-                break;
84
-
85
-            case Max::class:
86
-                $rules['max_value'] = $field->getValidatorOption($validator, 'value', '');
87
-                break;
88
-            case Min::class:
89
-                $rules['min_value'] = $field->getValidatorOption($validator, 'value', '');
90
-                break;
91
-
92
-            case MaxLength::class:
93
-                $rules['max'] = $field->getValidatorOption($validator, 'value', '');
94
-                break;
95
-            case MinLength::class:
96
-                $rules['min'] = $field->getValidatorOption($validator, 'value', '');
97
-                break;
98
-
99
-            case NotIn::class:
100
-                // TODO
101
-                break;
102
-
103
-            case Password::class:
104
-                // TODO
105
-                break;
106
-
107
-            case Regex::class:
108
-                $rules['regex'] = $field->getValidatorOption($validator, 'value', '');
109
-                break;
110
-
111
-            case SameAs::class:
112
-                // TODO
113
-                break;
114
-            default:
115
-                break;
72
+                case Datatype::REQUIRED:
73
+                case Filled::class:
74
+                    $rules['required'] = true;
75
+                    break;
76
+
77
+                case Equals::class:
78
+                    $rules['oneOf'] = implode(',', $field->getValidatorOption($validator, 'value', ''));
79
+                    break;
80
+
81
+                case In::class:
82
+                    $rules['oneOf'] = implode(',', $field->getValidatorOption($validator, 'value', ''));
83
+                    break;
84
+
85
+                case Max::class:
86
+                    $rules['max_value'] = $field->getValidatorOption($validator, 'value', '');
87
+                    break;
88
+                case Min::class:
89
+                    $rules['min_value'] = $field->getValidatorOption($validator, 'value', '');
90
+                    break;
91
+
92
+                case MaxLength::class:
93
+                    $rules['max'] = $field->getValidatorOption($validator, 'value', '');
94
+                    break;
95
+                case MinLength::class:
96
+                    $rules['min'] = $field->getValidatorOption($validator, 'value', '');
97
+                    break;
98
+
99
+                case NotIn::class:
100
+                    // TODO
101
+                    break;
102
+
103
+                case Password::class:
104
+                    // TODO
105
+                    break;
106
+
107
+                case Regex::class:
108
+                    $rules['regex'] = $field->getValidatorOption($validator, 'value', '');
109
+                    break;
110
+
111
+                case SameAs::class:
112
+                    // TODO
113
+                    break;
114
+                default:
115
+                    break;
116 116
             }
117 117
         }
118 118
         $validationNode->addAttribute(
Please login to merge, or discard this patch.
Formularium/Factory/DatatypeFactory.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,11 +112,11 @@
 block discarded – undo
112 112
 @param Model \$model The entire model, if your field depends on other things of the model. may be null.
113 113
 @throws Exception If invalid, with the message.
114 114
 @return mixed The validated value.')
115
-             ->setBody("throw new ValidatorException('Not implemented');");
115
+                ->setBody("throw new ValidatorException('Not implemented');");
116 116
         
117 117
         $validateMethod->addParameter('value');
118 118
         $validateMethod->addParameter('model', null)
119
-             ->setType('\Formularium\Model');
119
+                ->setType('\Formularium\Model');
120 120
 
121 121
         if ($classCallback) {
122 122
             $classCallback($class);
Please login to merge, or discard this patch.