Merge pull request #6356 from monishdeb/CRM-16931
[civicrm-core.git] / CRM / SMS / Provider.php
index 59883708589c5108f9e9ccf1e63e03011695adc0..b7fc04fe334cc2a6ecc5b96346f477bb10bb1fea 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.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -39,19 +39,17 @@ abstract class CRM_SMS_Provider {
    * pattern and cache the instance in this variable
    *
    * @var object
-   * @static
    */
   static private $_singleton = array();
   const MAX_SMS_CHAR = 460;
 
   /**
-   * Singleton function used to manage this object
+   * Singleton function used to manage this object.
    *
    * @param array $providerParams
    * @param bool $force
    *
    * @return object
-   * @static
    */
   public static function &singleton($providerParams = array(), $force = FALSE) {
     $mailingID = CRM_Utils_Array::value('mailing_id', $providerParams);
@@ -89,9 +87,9 @@ abstract class CRM_SMS_Provider {
   }
 
   /**
-   * Send an SMS Message via the API Server
+   * Send an SMS Message via the API Server.
    */
-  abstract function send($recipients, $header, $message, $dncID = NULL);
+  abstract public function send($recipients, $header, $message, $dncID = NULL);
 
   /**
    * Return message text. Child class could override this function to have better control over the message being sent.
@@ -122,7 +120,7 @@ abstract class CRM_SMS_Provider {
    * @param int $jobID
    * @param int $userID
    *
-   * @return $this|null|object
+   * @return self|null|object
    * @throws CRM_Core_Exception
    */
   public function createActivity($apiMsgID, $message, $headers = array(), $jobID = NULL, $userID = NULL) {
@@ -188,7 +186,7 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1";
    * @param null $to
    * @param int $trackID
    *
-   * @return $this|null|object
+   * @return self|null|object
    * @throws CRM_Core_Exception
    */
   public function processInbound($from, $body, $to = NULL, $trackID = NULL) {
@@ -211,14 +209,14 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1";
           1 => array(
             'location_type_id' => $phoneloc,
             'email' => $stripFrom . '@mobile.sms',
-          )
+          ),
         ),
         'phone' => array(
           1 => array(
             'phone_type_id' => $phonetype,
             'location_type_id' => $phoneloc,
             'phone' => $stripFrom,
-          )
+          ),
         ),
       );
       $fromContact = CRM_Contact_BAO_Contact::create($contactparams, FALSE, TRUE, FALSE);
@@ -357,4 +355,5 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1";
     }
     return $uri;
   }
+
 }