@@ -60,24 +60,25 @@ protected function assemble(): void
60
60
'submitButton ' ,
61
61
'add-condition ' ,
62
62
[
63
- 'class ' => ['add-button ' , 'control-button ' , 'spinner ' ],
64
- 'label ' => new Icon ('plus ' ),
65
- 'title ' => $ this ->translate ('Add Condition ' ),
66
- 'formnovalidate ' => true
63
+ 'class ' => ['add-button ' , 'control-button ' , 'spinner ' ],
64
+ 'label ' => new Icon ('plus ' ),
65
+ 'title ' => $ this ->translate ('Add Condition ' ),
66
+ 'formnovalidate ' => true
67
67
]
68
68
);
69
69
70
70
$ this ->registerElement ($ addCondition );
71
71
72
72
/** @var string|int $conditionCount */
73
73
$ conditionCount = $ this ->getValue ('condition-count ' );
74
+ $ conditionCount = (int ) $ conditionCount ;
74
75
$ this ->addElement (
75
76
'hidden ' ,
76
77
'id '
77
78
);
78
79
79
80
if ($ addCondition ->hasBeenPressed ()) {
80
- $ conditionCount += 1 ;
81
+ $ conditionCount = $ conditionCount + 1 ;
81
82
$ this ->getElement ('condition-count ' )->setValue ($ conditionCount );
82
83
}
83
84
@@ -92,14 +93,14 @@ protected function assemble(): void
92
93
'select ' ,
93
94
$ colName ,
94
95
[
95
- 'class ' => ['autosubmit ' , 'left-operand ' ],
96
- 'options ' => [
97
- '' => sprintf (' - %s - ' , $ this ->translate ('Please choose ' )),
96
+ 'class ' => ['autosubmit ' , 'left-operand ' ],
97
+ 'options ' => [
98
+ '' => sprintf (' - %s - ' , $ this ->translate ('Please choose ' )),
98
99
'incident_severity ' => $ this ->translate ('Incident Severity ' ),
99
- 'incident_age ' => $ this ->translate ('Incident Age ' )
100
+ 'incident_age ' => $ this ->translate ('Incident Age ' )
100
101
],
101
- 'disabledOptions ' => ['' ],
102
- 'required ' => true
102
+ 'disabledOptions ' => ['' ],
103
+ 'required ' => true
103
104
]
104
105
);
105
106
@@ -146,7 +147,7 @@ protected function assemble(): void
146
147
}
147
148
148
149
$ this ->addElement ('hidden ' , $ typeName , [
149
- 'value ' => 'incident_severity '
150
+ 'value ' => 'incident_severity '
150
151
]);
151
152
152
153
break ;
@@ -156,15 +157,17 @@ protected function assemble(): void
156
157
'text ' ,
157
158
$ valName ,
158
159
[
159
- 'required ' => true ,
160
- 'class ' => ['autosubmit ' , 'right-operand ' ],
160
+ 'required ' => true ,
161
+ 'class ' => ['autosubmit ' , 'right-operand ' ],
161
162
'validators ' => [
162
163
new CallbackValidator (function ($ value , $ validator ) {
163
164
if (! preg_match ('~^\d+(?:\.?\d*)?[hms]{1}$~ ' , $ value )) {
164
- $ validator ->addMessage ($ this ->translate (
165
- 'Only numbers with optional fractions (separated by a dot) '
166
- . ' and one of these suffixes are allowed: h, m, s '
167
- ));
165
+ $ validator ->addMessage (
166
+ $ this ->translate (
167
+ 'Only numbers with optional fractions (separated by a dot) '
168
+ . ' and one of these suffixes are allowed: h, m, s '
169
+ )
170
+ );
168
171
169
172
return false ;
170
173
}
@@ -194,7 +197,7 @@ protected function assemble(): void
194
197
$ val = $ this ->createElement ('text ' , $ valName , [
195
198
'class ' => 'right-operand ' ,
196
199
'placeholder ' => $ this ->translate ('Please make a decision ' ),
197
- 'disabled ' => true
200
+ 'disabled ' => true
198
201
]);
199
202
}
200
203
@@ -269,11 +272,11 @@ protected function createRemoveButton(int $count): ?SubmitButtonElement
269
272
'submitButton ' ,
270
273
'remove ' ,
271
274
[
272
- 'class ' => ['remove-button ' , 'control-button ' , 'spinner ' ],
273
- 'label ' => new Icon ('minus ' ),
274
- 'title ' => $ this ->translate ('Remove ' ),
275
- 'formnovalidate ' => true ,
276
- 'value ' => (string ) $ count
275
+ 'class ' => ['remove-button ' , 'control-button ' , 'spinner ' ],
276
+ 'label ' => new Icon ('minus ' ),
277
+ 'title ' => $ this ->translate ('Remove ' ),
278
+ 'formnovalidate ' => true ,
279
+ 'value ' => (string ) $ count
277
280
]
278
281
);
279
282
0 commit comments