Merge pull request #15729 from civicrm/5.19
[civicrm-core.git] / CRM / Utils / Check.php
index 57d15a741ff8c06689727020de2b8c2d9a6d5b29..74750759443f927014356d1c464ab406ad656eb4 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
  */
 class CRM_Utils_Check {
   // How often to run checks and notify admins about issues.
@@ -38,7 +38,7 @@ class CRM_Utils_Check {
    * @var array
    * @link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
    */
-  protected static $severityList = array(
+  protected static $severityList = [
     \Psr\Log\LogLevel::DEBUG,
     \Psr\Log\LogLevel::INFO,
     \Psr\Log\LogLevel::NOTICE,
@@ -47,7 +47,7 @@ class CRM_Utils_Check {
     \Psr\Log\LogLevel::CRITICAL,
     \Psr\Log\LogLevel::ALERT,
     \Psr\Log\LogLevel::EMERGENCY,
-  );
+  ];
 
   /**
    * We only need one instance of this object, so we use the
@@ -88,7 +88,7 @@ class CRM_Utils_Check {
         $config = CRM_Core_Config::singleton();
         $config->cleanup(0, FALSE);
 
-        $statusMessages = array();
+        $statusMessages = [];
         $maxSeverity = 0;
         foreach ($this->checkAll() as $message) {
           if (!$message->isVisible()) {
@@ -174,7 +174,7 @@ class CRM_Utils_Check {
       $messages = $this->checkAll();
     }
     $minLevel = self::severityMap($threshold);
-    $errors = array();
+    $errors = [];
     foreach ($messages as $message) {
       if ($message->getLevel() >= $minLevel) {
         $errors[] = $message->toArray();
@@ -200,7 +200,7 @@ class CRM_Utils_Check {
    *   Array of CRM_Utils_Check_Message objects
    */
   public static function checkAll($max = FALSE) {
-    $messages = array();
+    $messages = [];
     foreach (glob(__DIR__ . '/Check/Component/*.php') as $filePath) {
       $className = 'CRM_Utils_Check_Component_' . basename($filePath, '.php');
       /* @var CRM_Utils_Check_Component $check */
@@ -212,7 +212,7 @@ class CRM_Utils_Check {
 
     CRM_Utils_Hook::check($messages);
 
-    uasort($messages, array(__CLASS__, 'severitySort'));
+    uasort($messages, [__CLASS__, 'severitySort']);
 
     $maxSeverity = 1;
     foreach ($messages as $message) {