From 14069c56aaad54d635113275a9b03b0e8aabf913 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 14 Sep 2016 13:51:30 -0700 Subject: [PATCH] (NFC) CRM-17789 - Replace `@return $this` with types The "phan" analyzer does not seem to understand `@return $this` correctly; instead, we should indicate a more specific return type. --- CRM/Core/DAO.php | 2 +- CRM/Event/Cart/BAO/Cart.php | 4 ++-- CRM/Extension/ClassLoader.php | 2 +- CRM/Utils/SQL/Insert.php | 2 +- CRM/Utils/SQL/Select.php | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 4747adee2f..20d0a93d2b 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -463,7 +463,7 @@ class CRM_Core_DAO extends DB_DataObject { * * @param bool $hook * - * @return $this + * @return CRM_Core_DAO */ public function save($hook = TRUE) { if (!empty($this->id)) { diff --git a/CRM/Event/Cart/BAO/Cart.php b/CRM/Event/Cart/BAO/Cart.php index f0166b7185..6477e6a9d2 100644 --- a/CRM/Event/Cart/BAO/Cart.php +++ b/CRM/Event/Cart/BAO/Cart.php @@ -11,7 +11,7 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { /** * @param array $params * - * @return $this + * @return CRM_Event_Cart_BAO_Cart */ public static function add(&$params) { $cart = new CRM_Event_Cart_BAO_Cart(); @@ -57,7 +57,7 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { /** * @param array $params * - * @return $this + * @return CRM_Event_Cart_BAO_Cart * @throws Exception */ public static function create($params) { diff --git a/CRM/Extension/ClassLoader.php b/CRM/Extension/ClassLoader.php index ea3db339b3..92061c4fe7 100644 --- a/CRM/Extension/ClassLoader.php +++ b/CRM/Extension/ClassLoader.php @@ -73,7 +73,7 @@ class CRM_Extension_ClassLoader { /** * Registers this instance as an autoloader. - * @return $this + * @return CRM_Extension_ClassLoader */ public function register() { // In pre-installation environments, don't bother with caching. diff --git a/CRM/Utils/SQL/Insert.php b/CRM/Utils/SQL/Insert.php index e7f6d69dfd..fc8f136358 100644 --- a/CRM/Utils/SQL/Insert.php +++ b/CRM/Utils/SQL/Insert.php @@ -88,7 +88,7 @@ class CRM_Utils_SQL_Insert { * * @param array $columns * - * @return $this + * @return CRM_Utils_SQL_Insert * @throws \CRM_Core_Exception */ public function columns($columns) { diff --git a/CRM/Utils/SQL/Select.php b/CRM/Utils/SQL/Select.php index 000042776d..55d401731d 100644 --- a/CRM/Utils/SQL/Select.php +++ b/CRM/Utils/SQL/Select.php @@ -179,7 +179,7 @@ class CRM_Utils_SQL_Select implements ArrayAccess { * @param CRM_Utils_SQL_Select $other * @param array|NULL $parts * ex: 'joins', 'wheres' - * @return $this + * @return CRM_Utils_SQL_Select */ public function merge($other, $parts = NULL) { if ($other === NULL) { @@ -340,7 +340,7 @@ class CRM_Utils_SQL_Select implements ArrayAccess { * @param array|string $keys * Key name, or an array of key-value pairs. * @param null|mixed $value - * @return $this + * @return \CRM_Utils_SQL_Select */ public function param($keys, $value = NULL) { if ($this->mode === self::INTERPOLATE_AUTO) { @@ -389,7 +389,7 @@ class CRM_Utils_SQL_Select implements ArrayAccess { * The name of the other table (which receives new data). * @param array $fields * The fields to fill in the other table (in order). - * @return $this + * @return CRM_Utils_SQL_Select * @see insertIntoField */ public function insertInto($table, $fields = array()) { @@ -401,7 +401,7 @@ class CRM_Utils_SQL_Select implements ArrayAccess { /** * @param array $fields * The fields to fill in the other table (in order). - * @return $this + * @return CRM_Utils_SQL_Select */ public function insertIntoField($fields) { $fields = (array) $fields; @@ -449,7 +449,7 @@ class CRM_Utils_SQL_Select implements ArrayAccess { * In strict mode, unknown variables will generate exceptions. * * @param bool $strict - * @return $this + * @return CRM_Utils_SQL_Select */ public function strict($strict = TRUE) { $this->strict = $strict; -- 2.25.1