CRM-16433 fix - "User and User Admin Only" groups should NOT be included in Contribut...
[civicrm-core.git] / CRM / Core / CommunityMessages.php
index fb71592b1ed219c923b60e48c38ddea839a677d9..17f3e077ef8465598f4ff3c6ce56c9ffc202ea05 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  * Manage the download, validation, and rendering of community messages
@@ -34,7 +34,7 @@ class CRM_Core_CommunityMessages {
   const DEFAULT_PERMISSION = 'administer CiviCRM';
 
   /**
-   * Default time to wait before retrying
+   * Default time to wait before retrying.
    */
   const DEFAULT_RETRY = 7200; // 2 hours
 
@@ -54,7 +54,7 @@ class CRM_Core_CommunityMessages {
   protected $messagesUrl;
 
   /**
-   * Create default instance
+   * Create default instance.
    *
    * @return CRM_Core_CommunityMessages
    */
@@ -127,9 +127,10 @@ class CRM_Core_CommunityMessages {
   }
 
   /**
-   * Download document from URL and parse as JSON
+   * Download document from URL and parse as JSON.
    *
-   * @return NULL|array parsed JSON
+   * @return NULL|array
+   *   parsed JSON
    */
   public function fetchDocument() {
     list($status, $json) = $this->client->get($this->getRenderedUrl());
@@ -160,7 +161,7 @@ class CRM_Core_CommunityMessages {
   }
 
   /**
-   * Pick a message to display
+   * Pick a message to display.
    *
    * @return NULL|array
    */
@@ -223,10 +224,10 @@ class CRM_Core_CommunityMessages {
    * @return bool
    */
   public function validateDocument($document) {
-    if (!isset($document['ttl']) || !is_integer($document['ttl'])) {
+    if (!isset($document['ttl']) || !is_int($document['ttl'])) {
       return FALSE;
     }
-    if (!isset($document['retry']) || !is_integer($document['retry'])) {
+    if (!isset($document['retry']) || !is_int($document['retry'])) {
       return FALSE;
     }
     if (!isset($document['messages']) || !is_array($document['messages'])) {