@@ -87,7 +87,7 @@ public function setValues(array $values)
87
87
*/
88
88
public function getValues ()
89
89
{
90
- $ values = array () ;
90
+ $ values = [] ;
91
91
foreach ($ this ->fields ->all () as $ name => $ field ) {
92
92
if ($ field ->isDisabled ()) {
93
93
continue ;
@@ -108,11 +108,11 @@ public function getValues()
108
108
*/
109
109
public function getFiles ()
110
110
{
111
- if (!\in_array ($ this ->getMethod (), array ( 'POST ' , 'PUT ' , 'DELETE ' , 'PATCH ' ) )) {
112
- return array () ;
111
+ if (!\in_array ($ this ->getMethod (), [ 'POST ' , 'PUT ' , 'DELETE ' , 'PATCH ' ] )) {
112
+ return [] ;
113
113
}
114
114
115
- $ files = array () ;
115
+ $ files = [] ;
116
116
117
117
foreach ($ this ->fields ->all () as $ name => $ field ) {
118
118
if ($ field ->isDisabled ()) {
@@ -137,13 +137,13 @@ public function getFiles()
137
137
*/
138
138
public function getPhpValues ()
139
139
{
140
- $ values = array () ;
140
+ $ values = [] ;
141
141
foreach ($ this ->getValues () as $ name => $ value ) {
142
- $ qs = http_build_query (array ( $ name => $ value) , '' , '& ' );
142
+ $ qs = http_build_query ([ $ name => $ value] , '' , '& ' );
143
143
if (!empty ($ qs )) {
144
144
parse_str ($ qs , $ expandedValue );
145
145
$ varName = substr ($ name , 0 , \strlen (key ($ expandedValue )));
146
- $ values = array_replace_recursive ($ values , array ( $ varName => current ($ expandedValue )) );
146
+ $ values = array_replace_recursive ($ values , [ $ varName => current ($ expandedValue )] );
147
147
}
148
148
}
149
149
@@ -164,9 +164,9 @@ public function getPhpValues()
164
164
*/
165
165
public function getPhpFiles ()
166
166
{
167
- $ values = array () ;
167
+ $ values = [] ;
168
168
foreach ($ this ->getFiles () as $ name => $ value ) {
169
- $ qs = http_build_query (array ( $ name => $ value) , '' , '& ' );
169
+ $ qs = http_build_query ([ $ name => $ value] , '' , '& ' );
170
170
if (!empty ($ qs )) {
171
171
parse_str ($ qs , $ expandedValue );
172
172
$ varName = substr ($ name , 0 , \strlen (key ($ expandedValue )));
@@ -182,7 +182,7 @@ function (&$value, $key) {
182
182
183
183
reset ($ expandedValue );
184
184
185
- $ values = array_replace_recursive ($ values , array ( $ varName => current ($ expandedValue )) );
185
+ $ values = array_replace_recursive ($ values , [ $ varName => current ($ expandedValue )] );
186
186
}
187
187
}
188
188
@@ -202,9 +202,9 @@ public function getUri()
202
202
{
203
203
$ uri = parent ::getUri ();
204
204
205
- if (!\in_array ($ this ->getMethod (), array ( 'POST ' , 'PUT ' , 'DELETE ' , 'PATCH ' ) )) {
205
+ if (!\in_array ($ this ->getMethod (), [ 'POST ' , 'PUT ' , 'DELETE ' , 'PATCH ' ] )) {
206
206
$ query = parse_url ($ uri , PHP_URL_QUERY );
207
- $ currentParameters = array () ;
207
+ $ currentParameters = [] ;
208
208
if ($ query ) {
209
209
parse_str ($ query , $ currentParameters );
210
210
}
@@ -379,7 +379,7 @@ public function disableValidation()
379
379
protected function setNode (\DOMElement $ node )
380
380
{
381
381
$ this ->button = $ node ;
382
- if ('button ' === $ node ->nodeName || ('input ' === $ node ->nodeName && \in_array (strtolower ($ node ->getAttribute ('type ' )), array ( 'submit ' , 'button ' , 'image ' ) ))) {
382
+ if ('button ' === $ node ->nodeName || ('input ' === $ node ->nodeName && \in_array (strtolower ($ node ->getAttribute ('type ' )), [ 'submit ' , 'button ' , 'image ' ] ))) {
383
383
if ($ node ->hasAttribute ('form ' )) {
384
384
// if the node has the HTML5-compliant 'form' attribute, use it
385
385
$ formId = $ node ->getAttribute ('form ' );
@@ -480,7 +480,7 @@ private function addField(\DOMElement $node)
480
480
}
481
481
} elseif ('input ' == $ nodeName && 'file ' == strtolower ($ node ->getAttribute ('type ' ))) {
482
482
$ this ->set (new Field \FileFormField ($ node ));
483
- } elseif ('input ' == $ nodeName && !\in_array (strtolower ($ node ->getAttribute ('type ' )), array ( 'submit ' , 'button ' , 'image ' ) )) {
483
+ } elseif ('input ' == $ nodeName && !\in_array (strtolower ($ node ->getAttribute ('type ' )), [ 'submit ' , 'button ' , 'image ' ] )) {
484
484
$ this ->set (new Field \InputFormField ($ node ));
485
485
} elseif ('textarea ' == $ nodeName ) {
486
486
$ this ->set (new Field \TextareaFormField ($ node ));
0 commit comments