<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| 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
/**
* @param CRM_Utils_Cache_Interface $cache
* @param CRM_Utils_HttpClient $client
+ * @param null $messagesUrl
*/
public function __construct($cache, $client, $messagesUrl = NULL) {
$this->cache = $cache;
/**
* 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());
* @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'])) {