Merge pull request #13232 from JO0st/core-574
[civicrm-core.git] / CRM / Utils / Check.php
index 57d15a741ff8c06689727020de2b8c2d9a6d5b29..e8eb744ab21a43d9902982032d12d29df0a834d3 100644 (file)
@@ -1,34 +1,18 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 5                                                  |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM.                                    |
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
+ | Copyright CiviCRM LLC. All rights reserved.                        |
  |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License and the CiviCRM Licensing Exception along                  |
- | with this program; if not, contact CiviCRM LLC                     |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
+ | This work is published under the GNU AGPLv3 license with some      |
+ | permitted exceptions and without any warranty. For full license    |
+ | and copyright information, see https://civicrm.org/licensing       |
  +--------------------------------------------------------------------+
  */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
  */
 class CRM_Utils_Check {
   // How often to run checks and notify admins about issues.
@@ -38,7 +22,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 +31,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 +72,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 +158,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 +184,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 +196,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) {