}
}
- /* @var \CRM_Campaign_DAO_Campaign $campaign */
+ /** @var \CRM_Campaign_DAO_Campaign $campaign */
$campaign = self::writeRecord($params);
/* Create the campaign group record */
if (empty($apiParams['limit']) && empty($apiParams['offset'])) {
unset($apiParams['orderBy']);
}
- /* @var $api \Civi\Api4\Generic\DAOGetAction */
+ /** @var \Civi\Api4\Generic\DAOGetAction $api */
$api = Request::create($savedSearch['api_entity'], 'get', $apiParams);
$query = new Api4SelectQuery($api);
$query->forceSelectId = FALSE;
if ($types === NULL) {
$types = [];
$classes = ClassScanner::get(['interface' => UserJobInterface::class]);
+ /** @var \Civi\UserJob\UserJobInterface $class */
foreach ($classes as $class) {
- /* @var UserJobInterface $class */
$declaredTypes = $class::getUserJobInfo();
foreach ($declaredTypes as $index => $declaredType) {
$declaredTypes[$index]['class'] = $class;
$occurrences = [];
foreach ($links as $refSpec) {
- /** @var $refSpec CRM_Core_Reference_Interface */
$daoName = CRM_Core_DAO_AllCoreTables::getClassForTable($refSpec->getReferenceTable());
$result = $refSpec->findReferences($this);
if ($result) {
$counts = [];
foreach ($links as $refSpec) {
- /** @var $refSpec CRM_Core_Reference_Interface */
$count = $refSpec->getReferenceCount($this);
if (!empty($count['count'])) {
$counts[] = $count;
}
foreach (CRM_Core_Component::getEnabledComponents() as $component) {
- /** @var $component CRM_Core_Component_Info */
$counts = array_merge($counts, $component->getReferenceCounts($this));
}
CRM_Utils_Hook::referenceCounts($this, $counts);
$links = $daoClassName::getReferenceColumns();
foreach ($links as $refSpec) {
- /** @var $refSpec CRM_Core_Reference_Interface */
+ /** @var CRM_Core_Reference_Interface $refSpec */
if ($refSpec->matchesTargetTable($tableName)) {
$refsFound[] = $refSpec;
}
return $var;
}
- /* @var CRM_Core_DAO $object */
+ /** @var CRM_Core_DAO $object */
$object = new $name();
$object->selectAdd();
return FALSE;
}
// Get list of fields for the option table
- /* @var CRM_Core_DAO $dao * */
+ /** @var CRM_Core_DAO $dao * */
$dao = new $daoName();
$availableFields = array_keys($dao->fieldKeys());
* @param array $locks
*/
protected static function releaseLocks(array $locks) {
+ /** @var Civi\Core\Lock\LockInterface $lock */
foreach ($locks as $lock) {
- /* @var Civi\Core\Lock\LockInterface $lock */
$lock->release();
}
}
foreach ($dependency as $name) {
$daoString = 'CRM_' . $name[0] . '_DAO_' . $name[1];
if (class_exists($daoString)) {
- /* @var \CRM_Core_DAO $dao */
+ /** @var \CRM_Core_DAO $dao */
$dao = new $daoString();
$dao->financial_type_id = $financialTypeId;
if ($dao->find(TRUE)) {
break;
}
}
- /* @var \CRM_Import_Parser */
+ /** @var \CRM_Import_Parser $parser */
$parser = new $parserClass();
$parser->setUserJobID($this->getUserJobID());
return $parser;
protected function getDataSourceObject(): ?CRM_Import_DataSource {
$className = $this->getDataSourceClassName();
if ($className) {
- /* @var CRM_Import_DataSource $dataSource */
return new $className($this->getUserJobID());
}
return NULL;
protected function getDataSourceFields(): array {
$className = $this->getDataSourceClassName();
if ($className) {
- /* @var CRM_Import_DataSource $dataSourceClass */
+ /** @var CRM_Import_DataSource $dataSourceClass */
$dataSourceClass = new $className();
return $dataSourceClass->getSubmittableFields();
}
protected function getDataSourceObject(): ?CRM_Import_DataSource {
$className = $this->getSubmittedValue('dataSource');
if ($className) {
- /* @var CRM_Import_DataSource $dataSource */
return new $className($this->getUserJobID());
}
return NULL;
if (!isset($fieldSpec['bao'])) {
return $submittedValue;
}
- /* @var \CRM_Core_DAO $bao */
+ /** @var \CRM_Core_DAO $bao */
$bao = $fieldSpec['bao'];
// For historical reasons use validate as context - ie disabled name matches ARE permitted.
$nameOptions = $bao::buildOptions($fieldSpec['name'], 'validate');
$parserClass = $userJobType['class'];
}
}
- /* @var \CRM_Import_Parser $parser */
+ /** @var \CRM_Import_Parser $parser */
$parser = new $parserClass();
$parser->setUserJobID($userJobID);
// Not sure if we still need to init....
$checksNeeded = $statusNames;
foreach (glob(__DIR__ . '/Check/Component/*.php') as $filePath) {
$className = 'CRM_Utils_Check_Component_' . basename($filePath, '.php');
- /* @var CRM_Utils_Check_Component $component */
+ /** @var CRM_Utils_Check_Component $component */
$component = new $className();
if ($includeDisabled || $component->isEnabled()) {
$messages = array_merge($messages, $component->checkAll($statusNames, $includeDisabled));
];
foreach ($tables as $daoName => $where) {
if (class_exists($daoName)) {
- /* @var \CRM_Core_DAO $dao */
+ /** @var \CRM_Core_DAO $dao */
$dao = new $daoName();
if ($where) {
$dao->whereAdd($where);
* API authorization event.
*/
public function onApiAuthorize(\Civi\API\Event\AuthorizeEvent $event) {
- /* @var \Civi\Api4\Generic\AbstractAction $apiRequest */
+ /** @var \Civi\Api4\Generic\AbstractAction $apiRequest */
$apiRequest = $event->getApiRequest();
if ($apiRequest['version'] == 4) {
if (!$apiRequest->getCheckPermissions() || $apiRequest->isAuthorized(\CRM_Core_Session::singleton()->getLoggedInContactID())) {
*/
private function getBridgeRefs(string $bridgeEntity, string $joinEntity): array {
$bridges = CoreUtil::getInfoItem($bridgeEntity, 'bridge') ?? [];
- /* @var \CRM_Core_DAO $bridgeDAO */
+ /** @var \CRM_Core_DAO $bridgeDAO */
$bridgeDAO = CoreUtil::getInfoItem($bridgeEntity, 'dao');
$bridgeEntityFields = \Civi\API\Request::create($bridgeEntity, 'get', ['version' => 4, 'checkPermissions' => $this->getCheckPermissions()])->entityFields();
$bridgeTable = $bridgeDAO::getTableName();
}
$daoClass = $entityToClassMap[$apiRequest['entity']];
- /* @var $dao CRM_Core_DAO */
+ /** @var CRM_Core_DAO $dao */
$dao = new $daoClass();
$dao->id = $apiRequest['params']['id'];
if ($dao->find(TRUE)) {
* @throws \CiviCRM_API3_Exception
*/
function civicrm_api3_payment_processor_pay($params) {
- /* @var CRM_Core_Payment $processor */
$processor = Civi\Payment\System::singleton()->getById($params['payment_processor_id']);
$processor->setPaymentProcessor(civicrm_api3('PaymentProcessor', 'getsingle', ['id' => $params['payment_processor_id']]));
try {
]
);
- /* @var \CRM_Report_Form $reportInstance */
+ /** @var \CRM_Report_Form $reportInstance */
$reportInstance = new $class();
if (!empty($params['instance_id'])) {
$reportInstance->setID($params['instance_id']);
$fieldInfo = [$fieldName => $fieldInfo];
$params = [$fieldName => $fieldValue];
_civicrm_api3_validate_fields($entity, NULL, $params, $fieldInfo);
- /* @var CRM_Core_DAO $dao*/
+ /** @var CRM_Core_DAO $dao */
$dao = new $daoName();
$dao->id = $params[$fieldName];
$dao->selectAdd();
* API authorization event.
*/
public function onApiAuthorize(\Civi\API\Event\AuthorizeEvent $event) {
- /* @var \Civi\Api4\Generic\AbstractAction $apiRequest */
+ /** @var \Civi\Api4\Generic\AbstractAction $apiRequest */
$apiRequest = $event->getApiRequest();
if ($apiRequest['version'] == 4 && $apiRequest->getEntityName() === 'SavedSearch') {
if (\CRM_Core_Permission::check('administer search_kit')) {
}
// Non-custom DAO entities
elseif (!empty($entity['dao'])) {
- /* @var \CRM_Core_DAO $daoClass */
+ /** @var \CRM_Core_DAO $daoClass */
$daoClass = $entity['dao'];
$references = $daoClass::getReferenceColumns();
$fields = array_column($entity['fields'], NULL, 'name');
$html = __FUNCTION__ . ' html';
$text = __FUNCTION__ . ' text';
- /* @var CRM_Activity_Form_Task_Email $form */
+ /** @var CRM_Activity_Form_Task_Email $form */
$form = $this->getCaseEmailTaskForm($contactId, [
'subject' => '',
'html_message' => $html,
public function testSendSmsMobilePhoneNumber(): void {
$sent = $this->createSendSmsTest(TRUE, 2);
$this->assertEquals(TRUE, $sent[0]);
- /* @var CiviTestSMSProvider $provider $provider['id']*/
+ /** @var CiviTestSMSProvider $providerObj */
$providerObj = CRM_SMS_Provider::singleton(['provider_id' => $this->ids['SmsProvider'][0]]);
$this->assertEquals('text Anthony', $providerObj->getSentMessage());
}
$html = __FUNCTION__ . ' html' . '{contact.display_name}';
$text = __FUNCTION__ . ' text' . '{contact.display_name}';
- /* @var CRM_Contact_Form_Task_Email $form */
+ /** @var CRM_Contact_Form_Task_Email $form */
$form = $this->getFormObject('CRM_Contact_Form_Task_Email', [
'subject' => $subject,
'html_message' => $html,
protected function getCaseEmailTaskForm(int $contactId, array $submittedValues): CRM_Case_Form_Task_Email {
$_REQUEST['cid'] = $contactId;
$_REQUEST['caseid'] = $this->getCaseID();
- /* @var CRM_Case_Form_Task_Email $form */
+ /** @var CRM_Case_Form_Task_Email $form */
$form = $this->getFormObject('CRM_Case_Form_Task_Email', array_merge([
'to' => $contactId . '::' . 'email@example.com',
'from_email_address' => 'from@example.com',
*/
protected function getContactEmailTaskForm(int $contactId, array $submittedValues): CRM_Contact_Form_Task_Email {
$_REQUEST['cid'] = $contactId;
- /* @var CRM_Contact_Form_Task_Email $form */
+ /** @var CRM_Contact_Form_Task_Email $form */
$form = $this->getFormObject('CRM_Contact_Form_Task_Email', array_merge([
'to' => $contactId . '::' . 'email@example.com',
'from_email_address' => 'from@example.com',
* @noinspection PhpUnnecessaryLocalVariableInspection
*/
protected function getDataSourceForm(array $submittedValues): CRM_Activity_Import_Form_DataSource {
- /* @var \CRM_Activity_Import_Form_DataSource $form */
+ /** @var \CRM_Activity_Import_Form_DataSource $form */
$form = $this->getFormObject('CRM_Activity_Import_Form_DataSource', $submittedValues);
return $form;
}
* @noinspection PhpUnnecessaryLocalVariableInspection
*/
protected function getMapFieldForm(array $submittedValues): CRM_Activity_Import_Form_MapField {
- /* @var \CRM_Activity_Import_Form_MapField $form */
+ /** @var \CRM_Activity_Import_Form_MapField $form */
$form = $this->getFormObject('CRM_Activity_Import_Form_MapField', $submittedValues);
return $form;
}
* @noinspection PhpUnnecessaryLocalVariableInspection
*/
protected function getPreviewForm(array $submittedValues): CRM_Activity_Import_Form_Preview {
- /* @var CRM_Activity_Import_Form_Preview $form */
+ /** @var CRM_Activity_Import_Form_Preview $form */
$form = $this->getFormObject('CRM_Activity_Import_Form_Preview', $submittedValues);
return $form;
}
protected function getSearchTaskFormObject(array $formValues) {
$_POST = $formValues;
$_SERVER['REQUEST_METHOD'] = 'GET';
- /* @var CRM_Core_Form $form */
+ /** @var CRM_Core_Form $form */
$form = new CRM_Contact_Form_Task_AddToGroup();
$form->controller = new CRM_Contact_Controller_Search();
$form->controller->setStateMachine(new CRM_Core_StateMachine($form->controller));
}
$deceasedContactID = $this->individualCreate(['is_deceased' => 1, 'email' => 'dead@example.com']);
$to[] = $deceasedContactID . '::' . 'dead@example.com';
- /* @var CRM_Contact_Form_Task_Email $form*/
+ /** @var CRM_Contact_Form_Task_Email $form */
$form = $this->getFormObject('CRM_Contact_Form_Task_Email', [
'to' => implode(',', $to),
'subject' => 'Really interesting stuff',
protected function getPDFForm(array $formValues, array $contactIDs, ?bool $isLiveMode = TRUE): CRM_Contact_Form_Task_PDF {
// pretty cludgey.
$_REQUEST['cid'] = $contactIDs[0];
- /* @var CRM_Contact_Form_Task_PDF $form */
+ /** @var CRM_Contact_Form_Task_PDF $form */
$form = $this->getFormObject('CRM_Contact_Form_Task_PDF', array_merge([
'pdf_file_name' => 'pdf_file_name',
'subject' => 'subject',
*/
public function _testDocumentContent($formValues, $type) {
$html = [];
- /* @var CRM_Contact_Form_Task_PDF $form */
+ /** @var CRM_Contact_Form_Task_PDF $form */
$form = $this->getFormObject('CRM_Contact_Form_Task_PDF', [], NULL, [
'radio_ts' => 'ts_sel',
'task' => CRM_Member_Task::PDF_LETTER,
$dataSource = new CRM_Import_DataSource_SQL($userJobID);
$null = NULL;
- /* @var CRM_Contact_Import_Form_MapField $form */
+ /** @var CRM_Contact_Import_Form_MapField $form */
$form = $this->getFormObject('CRM_Contact_Import_Form_MapField', $submittedValues);
$form->set('user_job_id', $userJobID);
$dataSource->initialize();
'onDuplicate' => CRM_Import_Parser::DUPLICATE_UPDATE,
'groups' => [],
], $submittedValues);
- /* @var CRM_Contact_Import_Form_DataSource $form */
+ /** @var CRM_Contact_Import_Form_DataSource $form */
$form = $this->getFormObject('CRM_Contact_Import_Form_DataSource', $submittedValues);
$values = $_SESSION['_' . $form->controller->_name . '_container']['values'];
// This gets reset in DataSource so re-do....
$_SESSION['_' . $form->controller->_name . '_container']['values'] = $values;
- /* @var CRM_Contact_Import_Form_MapField $form */
+ /** @var CRM_Contact_Import_Form_MapField $form */
$form = $this->getFormObject('CRM_Contact_Import_Form_MapField', $submittedValues);
$form->setUserJobID($this->userJobID);
$form->buildForm();
$form->postProcess();
- /* @var CRM_Contact_Import_Form_MapField $form */
+ /** @var CRM_Contact_Import_Form_MapField $form */
$form = $this->getFormObject('CRM_Contact_Import_Form_Preview', $submittedValues);
$form->setUserJobID($this->userJobID);
$form->buildForm();
* @throws \CRM_Core_Exception
*/
private function validateMultiRowCsv(string $csv, array $mapper, string $field, array $submittedValues = []): void {
- /* @var CRM_Import_DataSource_CSV $dataSource */
- /* @var \CRM_Contact_Import_Parser_Contact $parser */
+ /** @var CRM_Import_DataSource_CSV $dataSource */
+ /** @var \CRM_Contact_Import_Parser_Contact $parser */
[$dataSource, $parser] = $this->getDataSourceAndParser($csv, $mapper, $submittedValues);
while ($values = $dataSource->getRow()) {
try {
$this->enableTaxAndInvoicing();
$financialType = $this->createFinancialType();
$financialAccount = $this->addTaxAccountToFinancialType($financialType['id']);
- /* @var CRM_Contribute_Form_Contribution $form */
+ /** @var CRM_Contribute_Form_Contribution $form */
$form = $this->getFormObject('CRM_Contribute_Form_Contribution', [
'total_amount' => $params['total_amount'],
'financial_type_id' => $financialType['id'],
];
}
$_REQUEST['id'] = $this->ids['Contribution'][0] ?? $this->_contributionId;
- /* @var CRM_Contribute_Form_AdditionalPayment $form*/
+ /** @var CRM_Contribute_Form_AdditionalPayment $form*/
$form = $this->getFormObject('CRM_Contribute_Form_AdditionalPayment', $submitParams);
$form->buildForm();
$form->postProcess();
public function testMail(): void {
$mut = new CiviMailUtils($this, TRUE);
$this->addContribution();
- /* @var CRM_Contribute_Form_CancelSubscription $form */
+ /** @var CRM_Contribute_Form_CancelSubscription $form */
$form = $this->getFormObject('CRM_Contribute_Form_CancelSubscription', ['is_notify' => TRUE]);
$form->set('crid', $this->getContributionRecurID());
$form->buildForm();
*/
public function testCancelSubscriptionForm(): void {
$this->addContribution();
- /* @var CRM_Contribute_Form_CancelSubscription $form */
+ /** @var CRM_Contribute_Form_CancelSubscription $form */
$form = $this->getFormObject('CRM_Contribute_Form_CancelSubscription', ['is_notify' => TRUE]);
$form->set('crid', $this->getContributionRecurID());
$form->buildForm();
// create a contribution page which is later used to make online payment for pending contribution
$contributionPageID2 = $this->createContributionPage(['payment_processor' => $paymentProcessorID]);
- /* @var CRM_Contribute_Form_Contribution_Confirm $form*/
+ /** @var CRM_Contribute_Form_Contribution_Confirm $form */
$form = $this->getFormObject('CRM_Contribute_Form_Contribution_Confirm');
$form->_id = $contributionPageID2;
* @return \CRM_Contribute_Form_Contribution
*/
protected function getContributionForm(array $formValues): CRM_Contribute_Form_Contribution {
- /* @var CRM_Contribute_Form_Contribution $form */
+ /** @var CRM_Contribute_Form_Contribution $form */
$form = $this->getFormObject('CRM_Contribute_Form_Contribution', $formValues);
$form->buildForm();
return $form;
'receive_date' => '2021-02-01 2:21',
'currency' => 'USD',
])['id'];
- /* @var CRM_Contribute_Form_Task_PDFLetter $form */
+ /** @var CRM_Contribute_Form_Task_PDFLetter $form */
$form = $this->getFormObject('CRM_Contribute_Form_Task_PDFLetter', [
'campaign_id' => '',
'subject' => '',
];
$contributionId = $this->createContribution();
- /* @var $form CRM_Contribute_Form_Task_PDFLetter */
+ /** @var $form CRM_Contribute_Form_Task_PDFLetter */
$form = $this->getFormObject('CRM_Contribute_Form_Task_PDFLetter', $formValues);
$form->setContributionIds([$contributionId]);
$format = Civi::settings()->get('dateformatFull');
'html_message' => '{contact.display_name}',
'document_type' => 'pdf',
];
- /* @var $form CRM_Contribute_Form_Task_PDFLetter */
+ /** @var $form CRM_Contribute_Form_Task_PDFLetter */
$form = $this->getFormObject('CRM_Contribute_Form_Task_PDFLetter', $formValues);
$form->setContributionIds([$this->createContribution()]);
try {
$formValues['html_message'] .= "$token : {contribution.$token}\n";
}
$formValues['html_message'] .= '{emoji.favourite_emoticon}';
- /* @var $form CRM_Contribute_Form_Task_PDFLetter */
+ /** @var $form CRM_Contribute_Form_Task_PDFLetter */
$form = $this->getFormObject('CRM_Contribute_Form_Task_PDFLetter', $formValues);
$form->setContributionIds([$this->createContribution(array_merge(['campaign_id' => $tokens['campaign_id:label']], $tokens))]);
try {
]);
$contributionIDs[] = $contribution['id'];
- /* @var \CRM_Contribute_Form_Task_PDFLetter $form */
+ /** @var \CRM_Contribute_Form_Task_PDFLetter $form */
$form = $this->getFormObject('CRM_Contribute_Form_Task_PDFLetter', $formValues);
$form->setContributionIds($contributionIDs);
foreach ($fields as $val) {
// Assert contribIds are returned in a sorted order.
- /* @var CRM_Contribute_Form_Task $form */
+ /** @var CRM_Contribute_Form_Task $form */
$form = $this->getFormObject('CRM_Contribute_Form_Task', ['radio_ts' => 'ts_all'], 'Search');
$form->set(CRM_Utils_Sort::SORT_ORDER, "`{$val}` asc");
CRM_Contribute_Form_Task::preProcessCommon($form);
public function testMail(): void {
$mut = new CiviMailUtils($this, TRUE);
$this->addContribution();
- /* @var CRM_Contribute_Form_UpdateSubscription $form */
+ /** @var CRM_Contribute_Form_UpdateSubscription $form */
$form = $this->getFormObject('CRM_Contribute_Form_UpdateSubscription', ['is_notify' => TRUE]);
$form->set('crid', $this->getContributionRecurID());
$form->buildForm();
* @noinspection PhpUnnecessaryLocalVariableInspection
*/
protected function getMapFieldForm(array $submittedValues): CRM_Contribute_Import_Form_MapField {
- /* @var \CRM_Contribute_Import_Form_MapField $form */
+ /** @var \CRM_Contribute_Import_Form_MapField $form */
$form = $this->getFormObject('CRM_Contribute_Import_Form_MapField', $submittedValues);
return $form;
}
* @noinspection PhpUnnecessaryLocalVariableInspection
*/
protected function getPreviewForm(array $submittedValues): CRM_Contribute_Import_Form_Preview {
- /* @var CRM_Contribute_Import_Form_Preview $form */
+ /** @var CRM_Contribute_Import_Form_Preview $form */
$form = $this->getFormObject('CRM_Contribute_Import_Form_Preview', $submittedValues);
return $form;
}
public function testFindById() {
$params = $this->sampleContact('Individual', 4);
$existing_contact = $this->callAPISuccess('Contact', 'create', $params);
- /* @var CRM_Contact_DAO_Contact $contact */
+ /** @var CRM_Contact_DAO_Contact $contact */
$contact = CRM_Contact_BAO_Contact::findById($existing_contact['id']);
$this->assertEquals($existing_contact['id'], $contact->id);
$deleted_contact_id = $existing_contact['id'];
* @noinspection PhpUnnecessaryLocalVariableInspection
*/
protected function getDataSourceForm(array $submittedValues): CRM_Custom_Import_Form_DataSource {
- /* @var \CRM_Custom_Import_Form_DataSource $form */
+ /** @var \CRM_Custom_Import_Form_DataSource $form */
$form = $this->getFormObject('CRM_Custom_Import_Form_DataSource', $submittedValues);
return $form;
}
* @noinspection PhpUnnecessaryLocalVariableInspection
*/
protected function getMapFieldForm(array $submittedValues): CRM_Custom_Import_Form_MapField {
- /* @var \CRM_Custom_Import_Form_MapField $form */
+ /** @var \CRM_Custom_Import_Form_MapField $form */
$form = $this->getFormObject('CRM_Custom_Import_Form_MapField', $submittedValues);
return $form;
}
* @noinspection PhpUnnecessaryLocalVariableInspection
*/
protected function getPreviewForm(array $submittedValues): CRM_Custom_Import_Form_Preview {
- /* @var CRM_Custom_Import_Form_Preview $form */
+ /** @var CRM_Custom_Import_Form_Preview $form */
$form = $this->getFormObject('CRM_Custom_Import_Form_Preview', $submittedValues);
return $form;
}
$lineItems = CRM_Price_BAO_LineItem::getLineItemsByContributionID($contribution['id']);
$this->assertCount(2, $lineItems);
$participantId = CRM_Core_DAO::getFieldValue('CRM_Event_BAO_ParticipantPayment', $contribution['id'], 'participant_id', 'contribution_id');
- /* @var CRM_Event_Form_SelfSvcTransfer $form */
+ /** @var CRM_Event_Form_SelfSvcTransfer $form */
$form = $this->getFormObject('CRM_Event_Form_SelfSvcTransfer');
$toContactId = $this->individualCreate();
$mut = new CiviMailUtils($this);
$this->setCurrencySeparators($thousandSeparator);
$mut = new CiviMailUtils($this);
$paymentProcessorID = $this->processorCreate();
- /* @var \CRM_Core_Payment_Dummy $processor */
+ /** @var \CRM_Core_Payment_Dummy $processor */
$processor = Civi\Payment\System::singleton()->getById($paymentProcessorID);
$processor->setDoDirectPaymentResult(['fee_amount' => 1.67]);
$params = ['is_monetary' => 1, 'financial_type_id' => 1];
// @todo - figure out why this doesn't pass validate financials
$this->isValidateFinancialsOnPostAssert = FALSE;
$paymentProcessorID = $this->processorCreate();
- /* @var \CRM_Core_Payment_Dummy $processor */
+ /** @var \CRM_Core_Payment_Dummy $processor */
$processor = Civi\Payment\System::singleton()->getById($paymentProcessorID);
$processor->setDoDirectPaymentResult(['fee_amount' => 1.67]);
$params = ['is_monetary' => 1, 'financial_type_id' => 1];
$this->createJoinedProfile(['entity_table' => 'civicrm_event', 'entity_id' => $event['id']]);
$_REQUEST['id'] = $event['id'];
- /* @var \CRM_Event_Form_Registration_Confirm $form */
+ /** @var \CRM_Event_Form_Registration_Confirm $form */
$form = $this->getFormObject('CRM_Event_Form_Registration_Confirm');
$form->set('params', [[]]);
$form->set('values', [
}
$_REQUEST['id'] = $event['id'];
- /* @var \CRM_Event_Form_Registration_Confirm $form */
+ /** @var \CRM_Event_Form_Registration_Confirm $form */
$form = $this->getFormObject('CRM_Event_Form_Registration_Confirm');
$form->set('params', [[]]);
$form->set('values', [
* @return CRM_Event_Form_Registration_Register
*/
protected function getEventForm(int $eventID): CRM_Event_Form_Registration_Register {
- /* @var \CRM_Event_Form_Registration_Register $form */
+ /** @var \CRM_Event_Form_Registration_Register $form */
$form = $this->getFormObject('CRM_Event_Form_Registration_Register');
$_REQUEST['id'] = $eventID;
return $form;
$this->addLocationBlockToDomain();
$this->individualCreate(['email' => 'new@example.org']);
$mut = new CiviMailUtils($this);
- /* @var CRM_Event_Form_SelfSvcTransfer $form*/
+ /** @var CRM_Event_Form_SelfSvcTransfer $form*/
$form = $this->getFormObject('CRM_Event_Form_SelfSvcTransfer', [
'email' => 'new@example.org',
]);
$this->addLocationBlockToDomain();
$this->individualCreate(['email' => 'new@example.org']);
$mut = new CiviMailUtils($this);
- /* @var CRM_Event_Form_SelfSvcUpdate $form*/
+ /** @var CRM_Event_Form_SelfSvcUpdate $form */
$form = $this->getFormObject('CRM_Event_Form_SelfSvcUpdate', [
'email' => 'new@example.org',
'action' => 2,
$_REQUEST['context'] = 'view';
$_REQUEST['id'] = $participantID;
$_REQUEST['cid'] = $contactID;
- /* @var CRM_Event_Form_Task_Badge $form */
+ /** @var CRM_Event_Form_Task_Badge $form */
$form = $this->getFormObject(
'CRM_Event_Form_Task_Badge',
['badge_id' => 1],
$participant = $this->callAPISuccessGetSingle('Participant', ['id' => $participantID]);
$this->assertEquals(2, $participant['participant_status_id']);
- /* @var CRM_Event_Form_Task_Batch $form */
+ /** @var CRM_Event_Form_Task_Batch $form */
$form = $this->getFormObject('CRM_Event_Form_Task_Batch');
$form->submit(['field' => [$participantID => ['participant_status_id' => 1, 'custom_' . $field['id'] => ['two' => 1, 'four' => 1]]]]);
$this->createEventOrder(['source' => 'Online Event Registration', 'is_pay_later' => 1]);
$participantCancelledStatusID = CRM_Core_PseudoConstant::getKey('CRM_Event_BAO_Participant', 'status_id', 'Cancelled');
- /* @var CRM_Event_Form_Task_Batch $form */
+ /** @var CRM_Event_Form_Task_Batch $form */
$form = $this->getFormObject('CRM_Event_Form_Task_Batch');
$form->submit(['field' => [$this->ids['Participant'][0] => ['participant_status' => $participantCancelledStatusID]]]);
* @throws \CRM_Core_Exception
*/
public function testGet() {
- /* @var CRM_Event_Form_Task_Register $form */
+ /** @var CRM_Event_Form_Task_Register $form */
$form = $this->getFormObject('CRM_Event_Form_Task_Register');
$this->assertEquals(FALSE, $form->_single);
}
'saveMappingName' => 'my mapping',
'saveMappingDesc' => 'new mapping',
], $submittedValues);
- /* @var \CRM_Event_Import_Form_DataSource $form */
+ /** @var \CRM_Event_Import_Form_DataSource $form */
$form = $this->getFormObject('CRM_Event_Import_Form_DataSource', $submittedValues);
$values = $_SESSION['_' . $form->controller->_name . '_container']['values'];
$form->buildForm();
$_SESSION['_' . $form->controller->_name . '_container']['values'] = $values;
$this->userJobID = $form->getUserJobID();
- /* @var CRM_Event_Import_Form_MapField $form */
+ /** @var CRM_Event_Import_Form_MapField $form */
$form = $this->getFormObject('CRM_Event_Import_Form_MapField', $submittedValues);
$form->setUserJobID($this->userJobID);
$form->buildForm();
$this->assertTrue($form->validate());
$form->postProcess();
- /* @var CRM_Event_Import_Form_Preview $form */
+ /** @var CRM_Event_Import_Form_Preview $form */
$form = $this->getFormObject('CRM_Event_Import_Form_Preview', $submittedValues);
$form->setUserJobID($this->userJobID);
$form->buildForm();
*/
protected function submitDatasourceForm(string $csvFileName): CRM_Contact_Import_Form_DataSource {
$_GET['dataSource'] = 'CRM_Import_DataSource_CSV';
- /* @var CRM_Contact_Import_Form_DataSource $form */
+ /** @var CRM_Contact_Import_Form_DataSource $form */
$form = $this->getFormObject('CRM_Contact_Import_Form_DataSource', [
'uploadFile' => [
'name' => __DIR__ . '/' . $csvFileName,
* @throws \CiviCRM_API3_Exception
*/
protected function getForm($formValues = [], $mode = 'test'): CRM_Member_Form_MembershipRenewal {
- /* @var CRM_Member_Form_MembershipRenewal $form */
+ /** @var CRM_Member_Form_MembershipRenewal $form */
$form = $this->getFormObject('CRM_Member_Form_MembershipRenewal', $formValues);
$form->_bltID = 5;
*/
public function testSubmitRecurCompleteInstant(): void {
$mut = new CiviMailUtils($this, TRUE);
- /* @var \CRM_Core_Payment_Dummy $processor */
+ /** @var \CRM_Core_Payment_Dummy $processor */
$processor = Civi\Payment\System::singleton()->getById($this->_paymentProcessorID);
$processor->setDoDirectPaymentResult([
'payment_status_id' => 1,
if (isset($_REQUEST['cid'])) {
unset($_REQUEST['cid']);
}
- /* @var CRM_Member_Form_Membership $form*/
+ /** @var CRM_Member_Form_Membership $form*/
$form = $this->getFormObject('CRM_Member_Form_Membership', $formValues);
$form->preProcess();
return $form;
* @return \CRM_Contribute_Form_Contribution
*/
protected function getContributionForm(array $formValues): CRM_Contribute_Form_Contribution {
- /* @var CRM_Contribute_Form_Contribution $form */
+ /** @var CRM_Contribute_Form_Contribution $form */
$form = $this->getFormObject('CRM_Contribute_Form_Contribution', $formValues);
$form->buildForm();
return $form;
$tasks = CRM_Member_Task::permissionedTaskTitles(CRM_Core_Permission::EDIT);
$this->assertArrayHasKey(201, $tasks);
$membershipID = $this->contactMembershipCreate(['contact_id' => $this->individualCreate()]);
- /* @var CRM_Member_Form_Task_Label $form */
+ /** @var CRM_Member_Form_Task_Label $form */
$form = $this->getFormObject('CRM_Member_Form_Task_Label', [
'task' => 201,
'radio_ts' => 'ts_sel',
}
}
- /* @var CRM_Member_Form_Task_PDFLetter $form */
+ /** @var CRM_Member_Form_Task_PDFLetter $form */
$form = $this->getFormObject('CRM_Member_Form_Task_PDFLetter', [
'subject' => '{contact.first_name} {membership.source}',
'html_message' => $htmlMessage,
$form->setUserJobID($this->userJobID);
$form->buildForm();
$form->postProcess();
- /* @var CRM_Member_Import_Form_MapField $form */
+ /** @var CRM_Member_Import_Form_MapField $form */
$form = $this->getFormObject('CRM_Member_Import_Form_Preview', $submittedValues);
$form->setUserJobID($this->userJobID);
$form->buildForm();
$membershipTypeID2 = $this->membershipTypeCreate(['member_of_contact_id' => $this->setupIDs['contact']]);
$priceSetID = $this->callAPISuccess('PriceSet', 'create', ['title' => 'blah', 'extends' => 'CiviMember'])['id'];
- /* @var \CRM_Price_Form_Field $form */
+ /** @var \CRM_Price_Form_Field $form */
$form = $this->getFormObject('CRM_Price_Form_Field');
$_REQUEST['sid'] = $priceSetID;
$form->preProcess();
*/
public function getFormObject($class, $formValues = [], $pageName = '', $searchFormValues = []) {
$_POST = $formValues;
- /* @var CRM_Core_Form $form */
+ /** @var CRM_Core_Form $form */
$form = new $class();
$_SERVER['REQUEST_METHOD'] = 'GET';
switch ($class) {
$_REQUEST['id'] = $this->getContributionID();
$_REQUEST['action'] = 'update';
// change pending contribution to completed
- /* @var CRM_Contribute_Form_Contribution $form */
+ /** @var CRM_Contribute_Form_Contribution $form */
$form = $this->getFormObject('CRM_Contribute_Form_Contribution', [
'total_amount' => 20,
'net_amount' => 20,
public function testTriggerOutput(): void {
Civi::settings()->set('logging_no_trigger_permission', TRUE);
Civi::settings()->set('logging', TRUE);
- /* @var \Civi\Core\SqlTriggers $sqlTriggers */
+ /** @var \Civi\Core\SqlTriggers $sqlTriggers */
$sqlTriggers = Civi::service('sql_triggers');
$fileName = $sqlTriggers->getFile();
$triggerOutPut = file_get_contents($fileName);
$_REQUEST['action'] = 'update';
$_REQUEST['id'] = $order['id'];
// Change Payment Status to Completed
- /* @var CRM_Contribute_Form_Contribution $form */
+ /** @var CRM_Contribute_Form_Contribution $form */
$form = $this->getFormObject('CRM_Contribute_Form_Contribution', [
'total_amount' => 150,
'financial_type_id' => '1',
*/
public function alterReportVarHook($varType, &$var, &$object) {
if ($varType === 'sql' && $object instanceof CRM_Report_Form_Contribute_Summary) {
- /* @var CRM_Report_Form $var */
$from = $var->getVar('_from');
$from .= ' LEFT JOIN civicrm_financial_type as temp ON temp.id = contribution_civireport.financial_type_id';
$var->setVar('_from', $from);
foreach ($infoXmls as $infoXml) {
updateXmlFile($infoXml, function (DOMDocument $dom) use ($newVersion) {
// Update extension version
+ /** @var \DOMNode $tag */
foreach ($dom->getElementsByTagName('version') as $tag) {
- /* @var \DOMNode $tag */
$tag->textContent = $newVersion;
}
// Update compatability - set to major version of core
+ /** @var \DOMNode $compat */
foreach ($dom->getElementsByTagName('compatibility') as $compat) {
- /* @var \DOMNode $compat */
+ /** @var \DOMNode $tag */
foreach ($compat->getElementsByTagName('ver') as $tag) {
- /* @var \DOMNode $tag */
$tag->textContent = implode('.', array_slice(explode('.', $newVersion), 0, 2));
}
}