Skip to content

Commit

Permalink
Fix inaccuracies and mistakes in comments
Browse files Browse the repository at this point in the history
(especially phpdoc comments)
  • Loading branch information
braders committed Dec 28, 2021
1 parent 16332a7 commit 64f4eeb
Show file tree
Hide file tree
Showing 25 changed files with 67 additions and 53 deletions.
4 changes: 2 additions & 2 deletions CRM/Batch/BAO/Batch.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static function create(&$params) {
* @param array $defaults
* (reference ) an assoc array to hold the flattened values.
*
* @return array
* @return CRM_Batch_BAO_Batch|null
* CRM_Batch_BAO_Batch object on success, null otherwise
*/
public static function retrieve(&$params, &$defaults) {
Expand Down Expand Up @@ -364,7 +364,7 @@ public static function getBatchCount(&$params) {
* @param array $params
* Associated array for params.
*
* @return string
* @return string[]
*/
public static function whereClause($params) {
$clauses = [];
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/CustomGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -1814,7 +1814,7 @@ public static function formatGroupTree($groupTree, $groupCount = 1, &$form = NUL
$formattedGroupTree[$key]['collapse_adv_display'] = $value['collapse_adv_display'] ?? NULL;
$formattedGroupTree[$key]['style'] = $value['style'] ?? NULL;

// this params needed of bulding multiple values
// this params needed of building multiple values
$formattedGroupTree[$key]['is_multiple'] = $value['is_multiple'] ?? NULL;
$formattedGroupTree[$key]['extends'] = $value['extends'] ?? NULL;
$formattedGroupTree[$key]['extends_entity_column_id'] = $value['extends_entity_column_id'] ?? NULL;
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/Website.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static function del($id) {
* @param array $params
* @param $values
*
* @return bool
* @return array
*/
public static function &getValues(&$params = [], &$values = []) {
$websites = [];
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/Reference/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CRM_Core_Reference_Basic implements CRM_Core_Reference_Interface {
/**
* @param $refTable
* @param $refKey
* @param null $targetTable
* @param string $targetTable
* @param string $targetKey
* @param null $refTypeColumn
*/
Expand Down
11 changes: 5 additions & 6 deletions CRM/Event/BAO/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,13 +650,12 @@ public static function getParticipantCount(
}

/**
* Get the information to map a event.
* Get the information to map an event.
*
* @param int $id
* For which we want map info.
*
* @return null|string
* title of the event
* @return array
*/
public static function &getMapInfo(&$id) {

Expand Down Expand Up @@ -1261,7 +1260,7 @@ public static function sendMail($contactID, $values, $participantId, $isTest = F
* @param int $id
* @param string $name
* @param int $cid
* @param string $template
* @param \CRM_Core_Smarty $template
* @param int $participantId
* @param bool $isTest
* @param bool $returnResults
Expand Down Expand Up @@ -1663,7 +1662,7 @@ public static function displayProfile(&$params, $gid, &$groupTitle, &$values, &$
}
}
elseif ($dao->data_type == 'Float') {
$customVal = (float ) ($params[$name]);
$customVal = (float) ($params[$name]);
}
elseif ($dao->data_type == 'Date') {
//@todo note the currently we are using default date time formatting. Since you can select/set
Expand Down Expand Up @@ -2233,7 +2232,7 @@ public static function getFromEmailIds($eventId = NULL) {
*
* @param int $eventId
* Event id.
* @param sting $extraWhereClause
* @param string $extraWhereClause
* Extra filter on participants.
*
* @return int
Expand Down
5 changes: 2 additions & 3 deletions CRM/Event/BAO/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ public static function resolveDefaults(&$defaults, $reverse = FALSE) {
*
* @param array $defaults
* @param string $property
* @param string $lookup
* @param string[] $lookup
* @param bool $reverse
*
* @return bool
Expand Down Expand Up @@ -1596,8 +1596,7 @@ public static function isPrimaryParticipant($participantId) {
* @param int $newStatusId
* New status.
*
* @return bool
* true if allowed
* @return array
*/
public static function getValidAdditionalIds($participantId, $oldStatusId, $newStatusId) {

Expand Down
7 changes: 2 additions & 5 deletions CRM/Event/Form/ManageEvent/Registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public function buildRegistrationBlock(&$form) {
* Subroutine to insert a Profile Editor widget.
* depends on getProfileSelectorTypes
*
* @param array &$form
* @param \CRM_Core_Form &$form
* @param int $count
* Unique index.
* @param string $prefix
Expand Down Expand Up @@ -392,7 +392,6 @@ public function buildConfirmationBlock(&$form) {
* Build Email Block.
*
* @param CRM_Core_Form $form
*
*/
public function buildMailBlock(&$form) {
$form->registerRule('emailList', 'callback', 'emailList', 'CRM_Utils_Rule');
Expand Down Expand Up @@ -421,7 +420,6 @@ public function buildThankYouBlock(&$form) {
/**
* Add local and global form rules.
*
*
* @return void
*/
public function addRules() {
Expand Down Expand Up @@ -621,7 +619,7 @@ public static function formRule($values, $files, $form) {
* Collect all email fields for an array of profile ids.
*
* @param $profileIds
* @return bool
* @return array
*/
public static function getEmailFields($profileIds) {
$emailFields = [];
Expand Down Expand Up @@ -771,7 +769,6 @@ public static function addMultipleProfiles(&$profileIds, $values, $field) {
/**
* Process the form submission.
*
*
* @return void
*/
public function postProcess() {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Event/Form/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -2181,7 +2181,7 @@ protected function getRevenueRecognitionDate() {
}

/**
* Store the parameters to create a payment, if approprite, on the form.
* Store the parameters to create a payment, if appropriate, on the form.
*
* @param array $params
* Params as submitted.
Expand Down
2 changes: 1 addition & 1 deletion CRM/Event/Page/EventInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

/**
* Event Info Page - Summmary about the event
* Event Info Page - Summary about the event
*/
class CRM_Event_Page_EventInfo extends CRM_Core_Page {

Expand Down
2 changes: 1 addition & 1 deletion CRM/Event/Selector/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
/**
* The query object.
*
* @var string
* @var CRM_Contact_BAO_Query
*/
protected $_query;

Expand Down
4 changes: 2 additions & 2 deletions CRM/Extension/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function checkRequirements() {
/**
* Get a list of all available extensions.
*
* @return array
* @return CRM_Extension_Info[]
* ($key => CRM_Extension_Info)
*/
public function getExtensions() {
Expand Down Expand Up @@ -159,7 +159,7 @@ public function getExtension($key) {
}

/**
* @return array
* @return CRM_Extension_Info[]
* @throws CRM_Extension_Exception_ParseException
*/
private function _discoverRemote() {
Expand Down
28 changes: 22 additions & 6 deletions CRM/Extension/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,28 @@ class CRM_Extension_Info {
const FILENAME = 'info.xml';

/**
* @var string
* @var string|null
*/
public $key = NULL;

/**
* @var string|null
*/
public $type = NULL;

/**
* @var string|null
*/
public $name = NULL;

/**
* @var string|null
*/
public $label = NULL;

/**
* @var string|null
*/
public $file = NULL;

/**
Expand Down Expand Up @@ -140,11 +156,11 @@ public static function buildReverseMap($infos) {
}

/**
* @param null $key
* @param null $type
* @param null $name
* @param null $label
* @param null $file
* @param string|null $key
* @param string|null $type
* @param string|null $name
* @param string|null $label
* @param string|null $file
*/
public function __construct($key = NULL, $type = NULL, $name = NULL, $label = NULL, $file = NULL) {
$this->key = $key;
Expand Down
2 changes: 1 addition & 1 deletion CRM/Extension/Mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ public function refresh() {
* @todo We should improve this to return more appropriate text. eg. when an extension is not installed
* it should not say "version xx is installed".
*
* @param array $remoteExtensionInfo
* @param CRM_Extension_Info $remoteExtensionInfo
* @param array $localExtensionInfo
*
* @return string
Expand Down
4 changes: 2 additions & 2 deletions CRM/Financial/BAO/ExportFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public static function createActivityExport($batchIds, $fileName) {

/**
* @param array $files
* @param null $destination
* @param string $destination
* @param bool $overwrite
*
* @return bool
Expand All @@ -224,7 +224,7 @@ public function createZip($files = [], $destination = NULL, $overwrite = FALSE)
if (file_exists($destination) && !$overwrite) {
return FALSE;
}
$valid_files = [];

if (is_array($files)) {
foreach ($files as $file) {
// make sure the file exists
Expand Down
6 changes: 4 additions & 2 deletions CRM/Financial/Form/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ class CRM_Financial_Form_Export extends CRM_Core_Form {

/**
* Financial batch ids.
* @var array
* (comma-separated array)
*
* @var string
*/
protected $_batchIds = [];
protected $_batchIds = '';

/**
* Export status id.
Expand Down
2 changes: 1 addition & 1 deletion CRM/Logging/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ private function _getCreateQuery($table) {
* Get column query.
*
* @param string $col
* @param bool $createQuery
* @param array $createQuery
*
* @return array|mixed|string
*/
Expand Down
4 changes: 2 additions & 2 deletions CRM/Mailing/BAO/Mailing.php
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ public function getVerpAndUrlsAndHeaders($job_id, $event_queue_id, $hash, $email
* @param bool $isForward
* Is this mailing compose for forward?.
* @param string $fromEmail
* Email address of who is forwardinf it.
* Email address of who is forwarding it.
*
* @param null $replyToEmail
*
Expand Down Expand Up @@ -2289,7 +2289,7 @@ public static function mailingACLIDs() {
* @param int $offset
* The row number to start from.
* @param int $rowCount
* The nmber of rows to return.
* The number of rows to return.
* @param string $sort
* The sql string that describes the sort order.
*
Expand Down
4 changes: 2 additions & 2 deletions CRM/Mailing/Event/BAO/Forward.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public function __construct() {
* @param $queue_id
* @param $hash
* @param $forward_email
* @param null $fromEmail
* @param null $comment
* @param string|null $fromEmail
* @param array|null $comment
*
* @return bool
*/
Expand Down
2 changes: 1 addition & 1 deletion CRM/Mailing/Page/Browse.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/**
* This implements the profile page for all contacts. It uses a selector
* object to do the actual dispay. The fields displayd are controlled by
* object to do the actual display. The fields displayed are controlled by
* the admin
*/
class CRM_Mailing_Page_Browse extends CRM_Core_Page {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Member/Form/MembershipRenewal.php
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ protected function submit() {
/**
* Send a receipt.
*
* @param array $membership
* @param CRM_Member_BAO_Membership $membership
*
* @throws \CRM_Core_Exception
*/
Expand Down
2 changes: 1 addition & 1 deletion CRM/Member/Selector/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
/**
* The query object.
*
* @var string
* @var CRM_Contact_BAO_Query
*/
protected $_query;

Expand Down
4 changes: 2 additions & 2 deletions CRM/Pledge/Selector/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
/**
* The query object
*
* @var string
* @var CRM_Contact_BAO_Query
*/
protected $_query;

Expand Down Expand Up @@ -428,7 +428,7 @@ public function &getColumnHeaders($action = NULL, $output = NULL) {
/**
* Get sql query string.
*
* @return string
* @return CRM_Contact_BAO_Query
*/
public function &getQuery() {
return $this->_query;
Expand Down
2 changes: 1 addition & 1 deletion CRM/Price/BAO/LineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ public static function syncLineItems($entityId, $entityTable, $amount, $otherPar
* @param array $params
* Form values.
*
* @param string $entityId
* @param string[]|null $entityId
* Entity id.
*
* @param string $entityTable
Expand Down
Loading

0 comments on commit 64f4eeb

Please sign in to comment.