@@ -87,7 +87,7 @@ public function setValues(array $values)
8787 */
8888 public function getValues ()
8989 {
90- $ values = array () ;
90+ $ values = [] ;
9191 foreach ($ this ->fields ->all () as $ name => $ field ) {
9292 if ($ field ->isDisabled ()) {
9393 continue ;
@@ -108,11 +108,11 @@ public function getValues()
108108 */
109109 public function getFiles ()
110110 {
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 [] ;
113113 }
114114
115- $ files = array () ;
115+ $ files = [] ;
116116
117117 foreach ($ this ->fields ->all () as $ name => $ field ) {
118118 if ($ field ->isDisabled ()) {
@@ -137,13 +137,13 @@ public function getFiles()
137137 */
138138 public function getPhpValues ()
139139 {
140- $ values = array () ;
140+ $ values = [] ;
141141 foreach ($ this ->getValues () as $ name => $ value ) {
142- $ qs = http_build_query (array ( $ name => $ value) , '' , '& ' );
142+ $ qs = http_build_query ([ $ name => $ value] , '' , '& ' );
143143 if (!empty ($ qs )) {
144144 parse_str ($ qs , $ expandedValue );
145145 $ 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 )] );
147147 }
148148 }
149149
@@ -164,9 +164,9 @@ public function getPhpValues()
164164 */
165165 public function getPhpFiles ()
166166 {
167- $ values = array () ;
167+ $ values = [] ;
168168 foreach ($ this ->getFiles () as $ name => $ value ) {
169- $ qs = http_build_query (array ( $ name => $ value) , '' , '& ' );
169+ $ qs = http_build_query ([ $ name => $ value] , '' , '& ' );
170170 if (!empty ($ qs )) {
171171 parse_str ($ qs , $ expandedValue );
172172 $ varName = substr ($ name , 0 , \strlen (key ($ expandedValue )));
@@ -182,7 +182,7 @@ function (&$value, $key) {
182182
183183 reset ($ expandedValue );
184184
185- $ values = array_replace_recursive ($ values , array ( $ varName => current ($ expandedValue )) );
185+ $ values = array_replace_recursive ($ values , [ $ varName => current ($ expandedValue )] );
186186 }
187187 }
188188
@@ -202,9 +202,9 @@ public function getUri()
202202 {
203203 $ uri = parent ::getUri ();
204204
205- if (!\in_array ($ this ->getMethod (), array ( 'POST ' , 'PUT ' , 'DELETE ' , 'PATCH ' ) )) {
205+ if (!\in_array ($ this ->getMethod (), [ 'POST ' , 'PUT ' , 'DELETE ' , 'PATCH ' ] )) {
206206 $ query = parse_url ($ uri , PHP_URL_QUERY );
207- $ currentParameters = array () ;
207+ $ currentParameters = [] ;
208208 if ($ query ) {
209209 parse_str ($ query , $ currentParameters );
210210 }
@@ -379,7 +379,7 @@ public function disableValidation()
379379 protected function setNode (\DOMElement $ node )
380380 {
381381 $ 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 ' ] ))) {
383383 if ($ node ->hasAttribute ('form ' )) {
384384 // if the node has the HTML5-compliant 'form' attribute, use it
385385 $ formId = $ node ->getAttribute ('form ' );
@@ -480,7 +480,7 @@ private function addField(\DOMElement $node)
480480 }
481481 } elseif ('input ' == $ nodeName && 'file ' == strtolower ($ node ->getAttribute ('type ' ))) {
482482 $ 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 ' ] )) {
484484 $ this ->set (new Field \InputFormField ($ node ));
485485 } elseif ('textarea ' == $ nodeName ) {
486486 $ this ->set (new Field \TextareaFormField ($ node ));
0 commit comments