@@ -201,7 +201,7 @@ public static function arrayMerge($a, $b)
201201 if (!is_array ($ v ) || isset ($ a [$ k ]) && !is_array ($ a [$ k ])) {
202202 $ a [$ k ] = $ v ;
203203 } else {
204- $ a [$ k ] = self ::arrayMerge (isset ( $ a [$ k ])? $ a [ $ k ]: [], $ v );
204+ $ a [$ k ] = self ::arrayMerge ($ a [$ k ] ?? [], $ v );
205205 }
206206 }
207207 return $ a ;
@@ -342,12 +342,12 @@ public function getElementsByName($name)
342342 *
343343 * If the reference object is not given, the element will be appended.
344344 *
345- * @param HTML_QuickForm2_Node $element Element to insert
346- * @param HTML_QuickForm2_Node $reference Reference to insert before
345+ * @param HTML_QuickForm2_Node $element Element to insert
346+ * @param ? HTML_QuickForm2_Node $reference Reference to insert before
347347 *
348348 * @return HTML_QuickForm2_Node Inserted element
349349 */
350- public function insertBefore (HTML_QuickForm2_Node $ element , HTML_QuickForm2_Node $ reference = null )
350+ public function insertBefore (HTML_QuickForm2_Node $ element , ? HTML_QuickForm2_Node $ reference = null )
351351 {
352352 if (null === $ reference ) {
353353 return $ this ->appendChild ($ element );
@@ -465,9 +465,9 @@ public function __call($m, $a)
465465 if (preg_match ('/^(add)([a-zA-Z0-9_]+)$/ ' , $ m , $ match )) {
466466 if ($ match [1 ] == 'add ' ) {
467467 $ type = strtolower ($ match [2 ]);
468- $ name = isset ( $ a [0 ]) ? $ a [ 0 ] : null ;
469- $ attr = isset ( $ a [1 ]) ? $ a [ 1 ] : null ;
470- $ data = isset ( $ a [2 ]) ? $ a [ 2 ] : [];
468+ $ name = $ a [0 ] ?? null ;
469+ $ attr = $ a [1 ] ?? null ;
470+ $ data = $ a [2 ] ?? [];
471471 return $ this ->addElement ($ type , $ name , $ attr , $ data );
472472 }
473473 }
0 commit comments