X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FHook%2FUnitTests.php;h=06d70f7454c2e354bfd71dfa5989f3c1fcab365a;hb=8f6e04e904288b3307b8bb63acb82fbbec25a4f8;hp=5c3fb9f85db960545c0df63e58046c34ab2cb5ff;hpb=d7e0c6a6d10fbd3548bfebb9926a3bf79c91296b;p=civicrm-core.git diff --git a/CRM/Utils/Hook/UnitTests.php b/CRM/Utils/Hook/UnitTests.php index 5c3fb9f85d..06d70f7454 100644 --- a/CRM/Utils/Hook/UnitTests.php +++ b/CRM/Utils/Hook/UnitTests.php @@ -1,41 +1,25 @@ mockObject = NULL; - $this->adhocHooks = array(); + $this->adhocHooks = []; } /** @@ -104,14 +88,14 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook { // run standard hooks if ($this->civiModules === NULL) { - $this->civiModules = array(); + $this->civiModules = []; $this->requireCiviModules($this->civiModules); } $fResult1 = $this->runHooks($this->civiModules, $fnSuffix, $numParams, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6); // run mock object hooks - if ($this->mockObject && is_callable(array($this->mockObject, $fnSuffix))) { - $fResult2 = call_user_func(array($this->mockObject, $fnSuffix), $arg1, $arg2, $arg3, $arg4, $arg5, $arg6); + if ($this->mockObject && is_callable([$this->mockObject, $fnSuffix])) { + $fResult2 = call_user_func([$this->mockObject, $fnSuffix], $arg1, $arg2, $arg3, $arg4, $arg5, $arg6); } // run adhoc hooks @@ -119,8 +103,8 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook { $fResult3 = call_user_func_array($this->adhocHooks[$fnSuffix], $params); } - $result = array(); - foreach (array($fResult1, $fResult2, $fResult3) as $fResult) { + $result = []; + foreach ([$fResult1, $fResult2, $fResult3] as $fResult) { if (!empty($fResult) && is_array($fResult)) { $result = array_merge($result, $fResult); }