NFC - Fix @return annotation in CRM_Utils_Check_Component_*
authorColeman Watts <coleman@civicrm.org>
Fri, 24 Jul 2020 18:23:16 +0000 (14:23 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 24 Jul 2020 18:23:16 +0000 (14:23 -0400)
CRM/Utils/Check/Component/AddressParsing.php
CRM/Utils/Check/Component/Case.php
CRM/Utils/Check/Component/Cms.php
CRM/Utils/Check/Component/Env.php
CRM/Utils/Check/Component/FinancialTypeAcls.php
CRM/Utils/Check/Component/OptionGroups.php
CRM/Utils/Check/Component/PriceFields.php
CRM/Utils/Check/Component/Schema.php
CRM/Utils/Check/Component/Security.php
CRM/Utils/Check/Component/Source.php
CRM/Utils/Check/Component/Timestamps.php

index 815402b48e1aabeaf1342503697f7bfc344b81bb..0d42a1771c6ddc624dc458668b8531e2ebeaa426 100644 (file)
@@ -16,6 +16,9 @@
  */
 class CRM_Utils_Check_Component_AddressParsing extends CRM_Utils_Check_Component {
 
+  /**
+   * @return CRM_Utils_Check_Message[]
+   */
   public static function checkLocaleSupportsAddressParsing() {
 
     $addressOptions = CRM_Core_BAO_Setting::valueOptions(
index 4931f9f37ff7a40db69385bab88098723995ed81..962b844199679ad52f78fa22b2343ff5264736bb 100644 (file)
@@ -46,7 +46,7 @@ class CRM_Utils_Check_Component_Case extends CRM_Utils_Check_Component {
   /**
    * Check that the case-type names don't rely on double-munging.
    *
-   * @return array<CRM_Utils_Check_Message>
+   * @return CRM_Utils_Check_Message[]
    *   An empty array, or a list of warnings
    */
   public function checkCaseTypeNameConsistency() {
@@ -105,7 +105,7 @@ class CRM_Utils_Check_Component_Case extends CRM_Utils_Check_Component {
   /**
    * Check that the timestamp columns are populated. (CRM-20958)
    *
-   * @return array<CRM_Utils_Check_Message>
+   * @return CRM_Utils_Check_Message[]
    *   An empty array, or a list of warnings
    */
   public function checkNullTimestamps() {
@@ -149,7 +149,7 @@ class CRM_Utils_Check_Component_Case extends CRM_Utils_Check_Component {
   /**
    * Check that the relationship types aren't going to cause problems.
    *
-   * @return array<CRM_Utils_Check_Message>
+   * @return CRM_Utils_Check_Message[]
    *   An empty array, or a list of warnings
    */
   public function checkRelationshipTypeProblems() {
@@ -387,7 +387,7 @@ class CRM_Utils_Check_Component_Case extends CRM_Utils_Check_Component {
    * We don't have to think about edge cases because there are already
    * status checks above for those.
    *
-   * @return array<CRM_Utils_Check_Message>
+   * @return CRM_Utils_Check_Message[]
    *   An empty array, or a list of warnings
    */
   public function checkExternalXmlFileRoleNames() {
index 663d68037c0532c378f06617f0fb699e98769cf5..a1e8610db44f56c4a407434f921eace792077edf 100644 (file)
@@ -19,8 +19,7 @@ class CRM_Utils_Check_Component_Cms extends CRM_Utils_Check_Component {
   /**
    * For sites running in WordPress, make sure the configured base page exists.
    *
-   * @return array
-   *   Instances of CRM_Utils_Check_Message
+   * @return CRM_Utils_Check_Message[]
    */
   public static function checkWpBasePage() {
     $config = CRM_Core_Config::singleton();
index a81de7792c0946326fed202d2c5fc47549a42fb1..76ae62ca5f782a1059ff91e7c09ef289a7e69e8b 100644 (file)
@@ -17,7 +17,7 @@
 class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
 
   /**
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkPhpVersion() {
     $messages = [];
@@ -82,7 +82,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
   }
 
   /**
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkPhpMysqli() {
     $messages = [];
@@ -107,7 +107,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
   /**
    * Check that the MySQL time settings match the PHP time settings.
    *
-   * @return array<CRM_Utils_Check_Message> an empty array, or a list of warnings
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkMysqlTime() {
     $messages = [];
@@ -131,7 +131,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
   }
 
   /**
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkDebug() {
     $config = CRM_Core_Config::singleton();
@@ -157,7 +157,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
   }
 
   /**
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkOutboundMail() {
     $messages = [];
@@ -188,7 +188,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
 
   /**
    * Check that domain email and org name are set
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkDomainNameEmail() {
     $messages = [];
@@ -238,7 +238,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
 
   /**
    * Checks if a default bounce handling mailbox is set up
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkDefaultMailbox() {
     $messages = [];
@@ -273,7 +273,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
 
   /**
    * Checks if cron has run in the past hour (3600 seconds)
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    * @throws CRM_Core_Exception
    */
   public function checkLastCron() {
@@ -337,7 +337,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
 
   /**
    * Recommend that sites use path-variables for their directories and URLs.
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkUrlVariables() {
     $messages = [];
@@ -374,7 +374,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
 
   /**
    * Recommend that sites use path-variables for their directories and URLs.
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkDirVariables() {
     $messages = [];
@@ -414,8 +414,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
   /**
    * Check that important directories are writable.
    *
-   * @return array
-   *   Any CRM_Utils_Check_Message instances that need to be generated.
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkDirsWritable() {
     $notWritable = [];
@@ -463,7 +462,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
 
   /**
    * Checks if new versions are available
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkVersion() {
     $messages = [];
@@ -513,7 +512,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
 
   /**
    * Checks if extensions are set up properly
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkExtensions() {
     $messages = [];
@@ -708,7 +707,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
   /**
    * Checks if there are pending extension upgrades.
    *
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkExtensionUpgrades() {
     if (CRM_Extension_Upgrades::hasPending()) {
@@ -732,7 +731,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
 
   /**
    * Checks if CiviCRM database version is up-to-date
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkDbVersion() {
     $messages = [];
@@ -801,8 +800,8 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
   }
 
   /**
-   * ensure that all CiviCRM tables are InnoDB
-   * @return array
+   * Ensure that all CiviCRM tables are InnoDB
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkDbEngine() {
     $messages = [];
@@ -820,8 +819,8 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
   }
 
   /**
-   * ensure reply id is set to any default value
-   * @return array
+   * Ensure reply id is set to any default value
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkReplyIdForMailing() {
     $messages = [];
@@ -845,7 +844,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
 
   /**
    * Check for required mbstring extension
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkMbstring() {
     $messages = [];
@@ -864,7 +863,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
 
   /**
    * Check if environment is Production.
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkEnvironment() {
     $messages = [];
@@ -885,7 +884,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
   /**
    * Check for utf8mb4 support by MySQL.
    *
-   * @return array<CRM_Utils_Check_Message> an empty array, or a list of warnings
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkMysqlUtf8mb4() {
     $messages = [];
index c46e93152bfa996578557e68efa28bede5be79af..05601e0778abdd12baa945dc057f6f12b8b76fd8 100644 (file)
  */
 class CRM_Utils_Check_Component_FinancialTypeAcls extends CRM_Utils_Check_Component {
 
+  /**
+   * @return CRM_Utils_Check_Message[]
+   * @throws CiviCRM_API3_Exception
+   */
   public static function checkFinancialAclReport() {
     $messages = [];
     $ftAclSetting = Civi::settings()->get('acl_financial_type');
index 77a1679a14722781d890b39e4934d0644bdfebb9..a47303ad0de0c4a501e6d2e04710222e84644816 100644 (file)
@@ -17,7 +17,7 @@
 class CRM_Utils_Check_Component_OptionGroups extends CRM_Utils_Check_Component {
 
   /**
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkOptionGroupValues() {
     $messages = [];
index cfb6cf711441909ba421e856f214b8617474de90..03816c98fe7c0ea37fb752b366a6d94a3f5f28c5 100644 (file)
@@ -19,7 +19,7 @@ class CRM_Utils_Check_Component_PriceFields extends CRM_Utils_Check_Component {
 
   /**
    * Display warning about invalid priceFields
-   *
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkPriceFields() {
     $sql = "SELECT DISTINCT ps.title as ps_title, ps.id as ps_id, psf.label as psf_label
index c1333dfa051e83ae91314d66366b5eaa268fcd0a..4e9e9c7ed7e0e1d37954adbdaff069e96da9395b 100644 (file)
@@ -19,7 +19,7 @@ class CRM_Utils_Check_Component_Schema extends CRM_Utils_Check_Component {
   /**
    * Check defined indices exist.
    *
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    * @throws \CiviCRM_API3_Exception
    */
   public function checkIndices() {
@@ -62,7 +62,7 @@ class CRM_Utils_Check_Component_Schema extends CRM_Utils_Check_Component {
   }
 
   /**
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkMissingLogTables() {
     $messages = [];
@@ -91,7 +91,7 @@ class CRM_Utils_Check_Component_Schema extends CRM_Utils_Check_Component {
   /**
    * Check that no smart groups exist that contain deleted custom fields.
    *
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkSmartGroupCustomFieldCriteria() {
     if (CRM_Core_BAO_Domain::isDBUpdateRequired()) {
@@ -182,6 +182,9 @@ class CRM_Utils_Check_Component_Schema extends CRM_Utils_Check_Component {
     return $messages;
   }
 
+  /**
+   * @return CRM_Utils_Check_Message[]
+   */
   public function checkMoneyValueFormatConfig() {
     $messages = [];
     if (CRM_Core_Config::singleton()->moneyvalueformat !== '%!i') {
index 98f7b67267bf07f907ee08022108797c2605fd93..943add05d4322677889f3fe8df1f929713bb15d2 100644 (file)
@@ -20,6 +20,7 @@ class CRM_Utils_Check_Component_Security extends CRM_Utils_Check_Component {
    * CMS have a different pattern to their default file path and URL.
    *
    * @todo Use Civi::paths instead?
+   * @return string
    */
   public function getFilePathMarker() {
     $config = CRM_Core_Config::singleton();
@@ -47,8 +48,7 @@ class CRM_Utils_Check_Component_Security extends CRM_Utils_Check_Component {
    * is browseable or visible to search engines; it means it can be
    * requested directly.
    *
-   * @return array
-   *   Array of messages
+   * @return CRM_Utils_Check_Message[]
    * @see CRM-14091
    */
   public function checkLogFileIsNotAccessible() {
@@ -100,8 +100,7 @@ class CRM_Utils_Check_Component_Security extends CRM_Utils_Check_Component {
    * Being retrievable doesn't mean the files are browseable or visible
    * to search engines; it only means they can be requested directly.
    *
-   * @return array
-   *   Array of messages
+   * @return CRM_Utils_Check_Message[]
    * @see CRM-14091
    *
    * @todo Test with WordPress, Joomla.
@@ -148,8 +147,7 @@ class CRM_Utils_Check_Component_Security extends CRM_Utils_Check_Component {
    * MAY trigger false positives (if you have files named 'a', 'e'
    * we'll probably match that).
    *
-   * @return array
-   *   Array of messages
+   * @return CRM_Utils_Check_Message[]
    * @see CRM-14091
    *
    * @todo Test with WordPress, Joomla.
@@ -192,7 +190,7 @@ class CRM_Utils_Check_Component_Security extends CRM_Utils_Check_Component {
    * These files have generally been deleted but Civi source tree but could be
    * left online if one does a faulty upgrade.
    *
-   * @return array of messages
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkFilesAreNotPresent() {
     $packages_path = rtrim(\Civi::paths()->getPath('[civicrm.packages]/'), '/' . DIRECTORY_SEPARATOR);
@@ -241,6 +239,7 @@ class CRM_Utils_Check_Component_Security extends CRM_Utils_Check_Component {
 
   /**
    * Discourage use of remote profile forms.
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkRemoteProfile() {
     $messages = [];
@@ -261,8 +260,8 @@ class CRM_Utils_Check_Component_Security extends CRM_Utils_Check_Component {
   }
 
   /**
-   * Check that the sysadmin has not modified the Cxn
-   * security setup.
+   * Check that the sysadmin has not modified the Cxn security setup.
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkCxnOverrides() {
     $list = [];
index 7a31d3341aa30fd55bc5a0f813d940ec9d81c677..683f7cd3e38fedaf68608e7add122d8939271bf1 100644 (file)
@@ -58,7 +58,7 @@ class CRM_Utils_Check_Component_Source extends CRM_Utils_Check_Component {
   }
 
   /**
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    *   Each item is an array with keys:
    *     - name: string, an abstract name
    *     - path: string, a full file path
@@ -99,7 +99,7 @@ class CRM_Utils_Check_Component_Source extends CRM_Utils_Check_Component {
   }
 
   /**
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkOrphans() {
     $orphans = $this->findOrphanedFiles();
index 3e9808acadeffacb2ee0f8c00d05509460bddbac..432a011e5f69cb8aa98deafdefd7a38166f22d22 100644 (file)
@@ -21,7 +21,7 @@ class CRM_Utils_Check_Component_Timestamps extends CRM_Utils_Check_Component {
   /**
    * Check that various columns are TIMESTAMP and not DATETIME. (CRM-9683, etal)
    *
-   * @return array
+   * @return CRM_Utils_Check_Message[]
    */
   public function checkSchema() {
     $problems = [];