Skip to content

Commit

Permalink
Various phpdoc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
braders committed Jan 14, 2022
1 parent 31f306c commit ffc5866
Show file tree
Hide file tree
Showing 57 changed files with 133 additions and 121 deletions.
4 changes: 2 additions & 2 deletions CRM/Activity/BAO/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ public static function getActivities($params) {
* Filter the activity types to only return the ones we actually asked for
* Uses params['activity_type_id'] and params['activity_type_exclude_id']
*
* @param $params
* @param array $params
* @return array|null (Use in Activity.get API activity_type_id)
*/
public static function filterActivityTypes($params) {
Expand Down Expand Up @@ -2288,7 +2288,7 @@ protected static function getPermittedActivityTypes() {
}

/**
* @param $params
* @param array $params
* @return array
*/
protected static function getActivityParamsForDashboardFunctions($params) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Activity/Form/Task/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function createDocument($activityIds, $html_message, $formValues) {
/**
* Render html from rows
*
* @param $rows
* @param array $rows
* @param string $msgPart
* The name registered with the TokenProcessor
* @param array $formValues
Expand Down
18 changes: 14 additions & 4 deletions CRM/Contact/BAO/ProximityQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,23 @@ class CRM_Contact_BAO_ProximityQuery {
*/

/**
* @var string
* @var float
*/
static protected $_earthFlattening;

/**
* @var float
*/
static protected $_earthRadiusSemiMinor;

/**
* @var float
*/
static protected $_earthRadiusSemiMajor;

/**
* @var float
*/
static protected $_earthEccentricitySQ;

public static function initialize() {
Expand Down Expand Up @@ -353,9 +365,8 @@ public static function process(&$query, &$values) {

/**
* @param array $input
* retun void
*
* @return null
* @return void
*/
public static function fixInputParams(&$input) {
foreach ($input as $param) {
Expand All @@ -378,7 +389,6 @@ public static function fixInputParams(&$input) {
}
}
}
return NULL;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public static function preProcessCommon(&$form) {
* to use a trait based approach. For now this is renamed to
* permit the use of a non-static function with this name
*
* @param $form CRM_Core_Form
* @param CRM_Core_Form_Task $form
*
* @return array $contactIds
*/
Expand Down
4 changes: 2 additions & 2 deletions CRM/Contact/Page/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public static function getContactDetails($contactId) {
}

/**
* @param $page
* @param CRM_Core_Page $page
* @param int $contactID
*/
public static function checkUserPermission($page, $contactID = NULL) {
Expand All @@ -242,7 +242,7 @@ public static function checkUserPermission($page, $contactID = NULL) {
$contactID = $page->_contactId;
}

// automatically grant permissin for users on their own record. makes
// automatically grant permission for users on their own record. makes
// things easier in dashboard
$session = CRM_Core_Session::singleton();

Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/CustomOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public static function getOptionListSelector(&$params) {
/**
* Delete Option.
*
* @param $optionId integer
* @param int $optionId
* option id
*
*/
Expand Down
7 changes: 4 additions & 3 deletions CRM/Core/BAO/EntityTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ public static function create(&$params, $entityTable, $entityID) {
* @param int $contactID
* @param bool $count
*
* @return array
* @return array|int
* Dependant on $count
*/
public static function getContactTags($contactID, $count = FALSE) {
$contactTags = [];
Expand All @@ -319,7 +320,7 @@ public static function getContactTags($contactID, $count = FALSE) {

if ($count) {
$dao->fetch();
return $dao->cnt;
return (int) $dao->cnt;
}

while ($dao->fetch()) {
Expand Down Expand Up @@ -368,7 +369,7 @@ public static function getChildEntityTags($parentId, $entityId, $entityTable = '
*
* @return array
*/
public function mergeTags($tagAId, $tagBId) {
public static function mergeTags($tagAId, $tagBId) {
$queryParams = [
1 => [$tagAId, 'Integer'],
2 => [$tagBId, 'Integer'],
Expand Down
4 changes: 2 additions & 2 deletions CRM/Core/BAO/MailSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static function retrieve(&$params, &$defaults) {
* Reference array contains the values submitted by the form.
*
*
* @return object
* @return CRM_Core_DAO_MailSettings
*/
public static function add(&$params) {
$result = NULL;
Expand Down Expand Up @@ -167,7 +167,7 @@ public static function add(&$params) {
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
* @return CRM_Core_BAO_MailSettings
* @return CRM_Core_DAO_MailSettings|CRM_Core_Error
*/
public static function create(&$params) {
$transaction = new CRM_Core_Transaction();
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ public static function createOrUpdateTopLevelReportsNavItem($domain_id) {
* care about output params appended.
*
* @param string $url
* @param array $url_params
* @param string $url_params
*
* @param int|null $parent_id
* Optionally restrict to one parent.
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/Phone.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public static function allEntityPhones($entityElements, $type = NULL) {
/**
* Set NULL to phone, mapping, uffield
*
* @param $optionId
* @param int $optionId
* Value of option to be deleted.
*/
public static function setOptionToNull($optionId) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/PrevNextCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public static function retrieve($cacheKey, $join = NULL, $whereClause = NULL, $o
}

/**
* @param $string
* @param mixed $string
*
* @return bool
*/
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/UFGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ public static function getUFJoinRecord($ufGroupId = NULL, $displayName = NULL, $
* @param array $params
* (reference) an assoc array of name/value pairs.
*
* @return CRM_Core_BAO_UFJoin
* @return CRM_Core_DAO_UFJoin
*/
public static function addUFJoin(&$params) {
$ufJoin = new CRM_Core_DAO_UFJoin();
Expand Down
3 changes: 2 additions & 1 deletion CRM/Core/BAO/Website.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ public static function create($params) {
*
* @param array $params
*
* @return bool|CRM_Core_BAO_Website
* @return CRM_Core_DAO_Website
* @throws \CRM_Core_Exception
* @deprecated
*/
public static function add($params) {
CRM_Core_Error::deprecatedFunctionWarning('use apiv4');
Expand Down
18 changes: 9 additions & 9 deletions CRM/Core/CodeGen/GenerateData.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ private function randomChar() {
/**
* Get a random item from the sample data or any other array
*
* @param $items (array or string) - if string, used as key for sample data,
* @param array|string $items if string, used as key for sample data,
* if array, used as data source
*
* @return mixed (element from array)
Expand Down Expand Up @@ -908,8 +908,8 @@ private function addRelationship() {
/**
* Create an address for a contact
*
* @param $cid int: contact id
* @param $masterContactId int: set if this is a shared address
* @param int $cid: contact id
* @param int $masterContactId: set if this is a shared address
*
* @return array
*/
Expand Down Expand Up @@ -960,7 +960,7 @@ private function _addAddress($cid, $masterContactId = NULL) {
/**
* Add a phone number for a contact
*
* @param $cid int: contact id
* @param int $cid: contact id
*
* @return array
*/
Expand All @@ -982,7 +982,7 @@ private function _addPhone($cid) {
/**
* Add an email for a contact
*
* @param $cid int: contact id
* @param int $cid: contact id
* @param $email
* @param $locationType
*
Expand All @@ -1002,8 +1002,8 @@ private function _addEmail($cid, $email, $locationType) {
* Add a website based on organization name
* Using common naming patterns
*
* @param $cid int: contact id
* @param $name str: contact name
* @param int $cid: contact id
* @param string $name: contact name
*
* @return array
*/
Expand Down Expand Up @@ -1043,8 +1043,8 @@ private function _addWebsite($cid, $name) {
* Create an email address based on a person's name
* Using common naming patterns
*
* @param $contact obj: individual contact record
* @param $domain str: supply a domain (i.e. for a work address)
* @param CRM_Contact_DAO_Contact $contact: individual contact record
* @param string $domain: supply a domain (i.e. for a work address)
*
* @return string
*/
Expand Down
6 changes: 3 additions & 3 deletions CRM/Core/CodeGen/Util/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class CRM_Core_CodeGen_Util_File {

/**
* @param $dir
* @param string $dir
* @param int $perm
*/
public static function createDir($dir, $perm = 0755) {
Expand All @@ -16,7 +16,7 @@ public static function createDir($dir, $perm = 0755) {
}

/**
* @param $dir
* @param string $dir
*/
public static function cleanTempDir($dir) {
foreach (glob("$dir/*") as $tempFile) {
Expand All @@ -31,7 +31,7 @@ public static function cleanTempDir($dir) {
}

/**
* @param $prefix
* @param string $prefix
*
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/Component/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ private function _getMenuXMLPath() {
/**
* Helper for instantiating component's elements.
*
* @param $cl
* @param string $cl
*
* @return mixed
* component's element as class instance
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/Controller/Simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CRM_Core_Controller_Simple extends CRM_Core_Controller {
/**
* Constructor.
*
* @param null $path
* @param string $path
* The class Path of the form being implemented
* @param bool $title
* @param string $mode
Expand Down
6 changes: 3 additions & 3 deletions CRM/Core/DAO/permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
/**
* Decide what permissions to check for an api call
*
* @param $entity : (str) api entity
* @param $action : (str) api action
* @param $params : (array) api params
* @param string $entity api entity
* @param string $action api action
* @param array $params api params
*
* @return array
* Array of permissions to check for this entity-action combo
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ function_exists($config->fatalErrorHandler)
* so we can interrupt a potential POST/redirect
*
* @param string $name name of debug section
* @param $variable mixed reference to variables that we need a trace of
* @param mixed $variable reference to variables that we need a trace of
* @param bool $log should we log or return the output
* @param bool $html whether to generate a HTML-escaped output
* @param bool $checkPermission should we check permissions before displaying output
Expand Down
4 changes: 2 additions & 2 deletions CRM/Core/Form/Task/PDFLetterCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public static function setDefaultValues() {
* @param array $fields
* The input form values.
* @param array $files
* @param array $self
* @param self $self
* Additional values form 'this'.
*
* @return bool
Expand Down Expand Up @@ -325,7 +325,7 @@ public static function processTemplate(&$formValues) {
/**
* @deprecated
*
* @param $message
* @param string $message
*/
public static function formatMessage(&$message) {
$newLineOperators = [
Expand Down
12 changes: 6 additions & 6 deletions CRM/Core/I18n/NativeGettext.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class CRM_Core_I18n_NativeGettext {

/**
* @param $string
* @param string $string
*
* @return string
*/
Expand All @@ -29,8 +29,8 @@ public function translate($string) {
/**
* Based on php-gettext, since native gettext does not support this as is.
*
* @param $context
* @param $text
* @param string $context
* @param string $text
*
* @return string
*/
Expand All @@ -47,9 +47,9 @@ public function pgettext($context, $text) {
}

/**
* @param $text
* @param $plural
* @param $count
* @param string $text
* @param string $plural
* @param int $count
*
* @return string
*/
Expand Down
4 changes: 2 additions & 2 deletions CRM/Core/I18n/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@ private static function createIndexQueries($locale, $table, $class = 'CRM_Core_I
* schema structure class to use.
* @param bool $isUpgradeMode
* Are we in upgrade mode therefore only build based off table not class
* @return array
* array of CREATE INDEX queries
* @return string
* The generated CREATE VIEW query
*/
private static function createViewQuery($locale, $table, &$dao, $class = 'CRM_Core_I18n_SchemaStructure', $isUpgradeMode = FALSE) {
$columns =& $class::columns();
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public static function fillComponentIds(&$menu, $path) {
}

/**
* @param $path string
* @param string $path
* Path of menu item to retrieve.
*
* @return array
Expand Down
Loading

0 comments on commit ffc5866

Please sign in to comment.