Merge pull request #19580 from MegaphoneJon/core-1132
[civicrm-core.git] / Civi / Test / GenericAssertionsTrait.php
index fe31b74b139b9af4b4d8fa729b456af7ff2d45ad..8d04b6359b9613474de876c5e7e50a9d368e389f 100644 (file)
@@ -35,8 +35,8 @@ trait GenericAssertionsTrait {
    * @param array $actual
    */
   public function assertTreeEquals($expected, $actual) {
-    $e = array();
-    $a = array();
+    $e = [];
+    $a = [];
     \CRM_Utils_Array::flatten($expected, $e, '', ':::');
     \CRM_Utils_Array::flatten($actual, $a, '', ':::');
     ksort($e);
@@ -100,7 +100,7 @@ trait GenericAssertionsTrait {
   public function assertArrayValueNotNull($key, &$list) {
     $this->assertArrayKeyExists($key, $list);
 
-    $value = isset($list[$key]) ? $list[$key] : NULL;
+    $value = $list[$key] ?? NULL;
     $this->assertTrue($value,
       sprintf("%s element not null?", $key)
     );