From 481a74f476c945a324382bad34630d1a78d704c7 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 6 Jan 2015 21:17:23 -0800 Subject: [PATCH] INFRA-132 - Remove white space after an opening "(" or before a closing ")" --- CRM/ACL/Form/WordPress/Permissions.php | 16 ++-- CRM/Activity/BAO/ICalendar.php | 32 +++---- CRM/Activity/BAO/Query.php | 6 +- CRM/Activity/Form/Activity.php | 6 +- CRM/Activity/Form/ActivityView.php | 2 +- CRM/Activity/Form/Task/PickOption.php | 4 +- CRM/Activity/Page/AJAX.php | 2 +- CRM/Activity/Selector/Activity.php | 2 +- CRM/Activity/Task.php | 4 +- CRM/Admin/Form.php | 4 +- CRM/Admin/Form/PaymentProcessor.php | 16 ++-- CRM/Admin/Form/PaymentProcessorType.php | 8 +- CRM/Admin/Form/Setting/Smtp.php | 2 +- CRM/Admin/Form/Setting/Url.php | 2 +- CRM/Admin/Form/WordReplacements.php | 4 +- CRM/Admin/Page/Access.php | 2 +- CRM/Admin/Page/Extensions.php | 8 +- CRM/Badge/Form/Layout.php | 2 +- CRM/Batch/BAO/Batch.php | 16 ++-- CRM/Batch/Form/Batch.php | 4 +- CRM/Batch/Form/Entry.php | 24 +++--- CRM/Campaign/Form/Survey.php | 2 +- CRM/Campaign/Form/Task/Interview.php | 14 ++-- CRM/Case/Form/Activity/ChangeCaseStatus.php | 2 +- CRM/Case/Form/Activity/OpenCase.php | 6 +- CRM/Case/Form/Case.php | 4 +- CRM/Case/Form/CaseView.php | 4 +- CRM/Case/XMLProcessor/Process.php | 4 +- CRM/Contact/BAO/Contact/Optimizer.php | 76 ++++++++--------- CRM/Contact/BAO/Group.php | 4 +- CRM/Contact/BAO/GroupContactCache.php | 4 +- CRM/Contact/BAO/GroupNesting.php | 2 +- CRM/Contact/BAO/SearchCustom.php | 2 +- CRM/Contact/Form/Contact.php | 8 +- CRM/Contact/Form/Edit/Address.php | 4 +- CRM/Contact/Form/Edit/CustomData.php | 2 +- CRM/Contact/Form/Edit/Household.php | 6 +- CRM/Contact/Form/Edit/Individual.php | 8 +- CRM/Contact/Form/Edit/Organization.php | 6 +- CRM/Contact/Form/GroupContact.php | 2 +- CRM/Contact/Form/Location.php | 2 +- CRM/Contact/Form/RelatedContact.php | 2 +- CRM/Contact/Form/Relationship.php | 2 +- CRM/Contact/Form/Search/Criteria.php | 4 +- CRM/Contact/Form/Search/Custom.php | 2 +- CRM/Contact/Form/Search/Custom/FullText.php | 2 +- CRM/Contact/Form/Search/Custom/Group.php | 2 +- CRM/Contact/Form/Task/Label.php | 4 +- CRM/Contact/Form/Task/LabelCommon.php | 2 +- CRM/Contact/Form/Task/Print.php | 2 +- CRM/Contact/Form/Task/SaveSearch.php | 2 +- CRM/Contact/Import/Form/DataSource.php | 4 +- CRM/Contact/Page/Inline/Address.php | 16 ++-- .../Page/Inline/CommunicationPreferences.php | 2 +- CRM/Contact/Page/Inline/ContactInfo.php | 2 +- CRM/Contact/Page/Inline/Demographics.php | 2 +- CRM/Contact/Page/Inline/Email.php | 6 +- CRM/Contact/Page/Inline/Phone.php | 6 +- CRM/Contact/Page/View.php | 2 +- CRM/Contact/Page/View/Summary.php | 2 +- CRM/Contact/Selector.php | 4 +- CRM/Contact/Selector/Custom.php | 2 +- CRM/Contribute/BAO/Contribution/Utils.php | 2 +- CRM/Contribute/BAO/ContributionPage.php | 4 +- CRM/Contribute/BAO/Query.php | 2 +- CRM/Contribute/Form.php | 2 +- CRM/Contribute/Form/AdditionalInfo.php | 2 +- CRM/Contribute/Form/AdditionalPayment.php | 2 +- CRM/Contribute/Form/CancelSubscription.php | 4 +- CRM/Contribute/Form/Contribution.php | 2 +- CRM/Contribute/Form/Contribution/Main.php | 18 ++-- CRM/Contribute/Form/Contribution/ThankYou.php | 2 +- .../Form/ContributionPage/AddProduct.php | 14 ++-- .../Form/ContributionPage/Amount.php | 4 +- .../Form/ContributionPage/Settings.php | 2 +- CRM/Contribute/Form/ManagePremiums.php | 16 ++-- CRM/Contribute/Form/SearchContribution.php | 4 +- CRM/Contribute/Form/Task.php | 4 +- CRM/Contribute/Form/Task/PDFLetter.php | 2 +- CRM/Contribute/Form/UpdateBilling.php | 4 +- CRM/Contribute/Form/UpdateSubscription.php | 6 +- CRM/Contribute/Page/ContributionPage.php | 2 +- CRM/Contribute/Page/ManagePremiums.php | 4 +- CRM/Contribute/Page/Premium.php | 2 +- CRM/Contribute/Page/SubscriptionStatus.php | 4 +- CRM/Contribute/Page/Tab.php | 4 +- CRM/Contribute/Task.php | 2 +- CRM/Core/BAO/ActionSchedule.php | 6 +- CRM/Core/BAO/Block.php | 16 ++-- CRM/Core/BAO/CustomQuery.php | 2 +- CRM/Core/BAO/Discount.php | 8 +- CRM/Core/BAO/FinancialTrxn.php | 8 +- CRM/Core/BAO/Job.php | 2 +- CRM/Core/BAO/Location.php | 2 +- CRM/Core/BAO/Mapping.php | 4 +- CRM/Core/BAO/MessageTemplate.php | 2 +- CRM/Core/BAO/Navigation.php | 6 +- CRM/Core/BAO/PrevNextCache.php | 2 +- CRM/Core/BAO/UFField.php | 2 +- CRM/Core/BAO/WordReplacement.php | 2 +- CRM/Core/CodeGen/Specification.php | 8 +- CRM/Core/Error.php | 10 +-- CRM/Core/Form/Tag.php | 2 +- CRM/Core/I18n/Schema.php | 6 +- CRM/Core/Invoke.php | 4 +- CRM/Core/Page.php | 4 +- CRM/Core/Payment/AuthorizeNet.php | 4 +- CRM/Core/Payment/PayPalProIPN.php | 2 +- CRM/Core/Permission/Drupal.php | 4 +- CRM/Core/Permission/DrupalBase.php | 4 +- CRM/Core/Permission/WordPress.php | 2 +- CRM/Core/PseudoConstant.php | 2 +- CRM/Core/Region.php | 8 +- CRM/Core/Report/Excel.php | 2 +- CRM/Core/SelectValues.php | 2 +- CRM/Core/Smarty.php | 12 +-- CRM/Core/StateMachine.php | 2 +- CRM/Custom/Form/CustomData.php | 4 +- CRM/Custom/Import/Parser/Api.php | 2 +- CRM/Custom/Page/Group.php | 2 +- CRM/Dedupe/BAO/QueryBuilder.php | 2 +- .../QueryBuilder/IndividualUnsupervised.php | 2 +- CRM/Dedupe/Finder.php | 2 +- CRM/Dedupe/Merger.php | 14 ++-- CRM/Event/BAO/Query.php | 2 +- CRM/Event/Badge.php | 4 +- CRM/Event/Cart/Form/Checkout/Payment.php | 2 +- CRM/Event/Form/EventFees.php | 8 +- CRM/Event/Form/ManageEvent/Registration.php | 16 ++-- CRM/Event/Form/Participant.php | 6 +- CRM/Event/Form/Registration.php | 2 +- CRM/Event/Form/Registration/Confirm.php | 4 +- CRM/Event/Form/Search.php | 2 +- CRM/Event/Task.php | 2 +- CRM/Export/Form/Select.php | 2 +- CRM/Extension/Manager/Payment.php | 4 +- CRM/Financial/BAO/ExportFormat.php | 2 +- CRM/Financial/BAO/ExportFormat/CSV.php | 4 +- CRM/Financial/BAO/ExportFormat/IIF.php | 28 +++---- CRM/Financial/BAO/FinancialItem.php | 8 +- CRM/Financial/BAO/FinancialType.php | 14 ++-- CRM/Financial/BAO/FinancialTypeAccount.php | 8 +- CRM/Financial/BAO/PaymentProcessor.php | 4 +- CRM/Financial/Form/BatchTransaction.php | 14 ++-- CRM/Financial/Form/Export.php | 4 +- CRM/Financial/Form/FinancialAccount.php | 6 +- CRM/Financial/Form/FinancialBatch.php | 10 +-- CRM/Financial/Form/FinancialType.php | 2 +- CRM/Financial/Form/Search.php | 6 +- CRM/Financial/Page/AJAX.php | 4 +- CRM/Financial/Page/FinancialAccount.php | 2 +- CRM/Financial/Page/FinancialType.php | 6 +- CRM/Financial/Page/FinancialTypeAccount.php | 16 ++-- CRM/Friend/Form.php | 12 +-- CRM/Grant/Form/Task.php | 4 +- CRM/Import/DataSource/SQL.php | 2 +- CRM/Logging/Differ.php | 8 +- CRM/Logging/Schema.php | 14 ++-- CRM/Mailing/BAO/Mailing.php | 4 +- CRM/Mailing/BAO/Query.php | 4 +- CRM/Mailing/BAO/Spool.php | 12 +-- CRM/Mailing/Event/BAO/Opened.php | 4 +- CRM/Mailing/Event/BAO/TrackableURLOpen.php | 4 +- CRM/Mailing/Form/Optout.php | 4 +- CRM/Mailing/Form/Task.php | 4 +- CRM/Mailing/Form/Unsubscribe.php | 6 +- CRM/Mailing/Info.php | 2 +- CRM/Member/BAO/MembershipType.php | 4 +- CRM/Member/BAO/Query.php | 4 +- CRM/Member/Form.php | 4 +- CRM/Member/Form/Membership.php | 4 +- CRM/Member/Form/MembershipBlock.php | 6 +- CRM/Member/Form/MembershipRenewal.php | 4 +- CRM/Member/Form/MembershipType.php | 6 +- CRM/Member/Form/Task.php | 4 +- CRM/Member/Import/Parser/Membership.php | 16 ++-- CRM/Member/Page/AJAX.php | 2 +- CRM/Member/Page/Tab.php | 2 +- CRM/Member/Page/UserDashboard.php | 4 +- CRM/Member/Task.php | 2 +- CRM/PCP/BAO/PCP.php | 2 +- CRM/PCP/Form/Campaign.php | 10 +-- CRM/Pledge/BAO/Query.php | 8 +- CRM/Pledge/Form/Pledge.php | 6 +- CRM/Pledge/Form/PledgeView.php | 4 +- CRM/Pledge/Form/Task.php | 4 +- CRM/Price/BAO/PriceField.php | 12 +-- CRM/Price/BAO/PriceSet.php | 2 +- CRM/Profile/Form.php | 2 +- .../Page/MultipleRecordFieldsListing.php | 8 +- CRM/Report/Form/Contact/LoggingSummary.php | 6 +- CRM/Report/Form/Instance.php | 4 +- CRM/Report/Page/InstanceList.php | 2 +- CRM/Report/Utils/Report.php | 2 +- CRM/Upgrade/Incremental/php/FourFour.php | 6 +- CRM/Upgrade/Incremental/php/FourThree.php | 12 +-- CRM/Upgrade/Incremental/php/FourTwo.php | 12 +-- CRM/Upgrade/Page/Upgrade.php | 2 +- CRM/Utils/Address/BatchUpdate.php | 2 +- CRM/Utils/Cache/Memcached.php | 6 +- CRM/Utils/DeprecatedUtils.php | 22 ++--- CRM/Utils/Hook.php | 6 +- CRM/Utils/Hook/UnitTests.php | 4 +- CRM/Utils/Hook/WordPress.php | 6 +- CRM/Utils/Mail.php | 6 +- CRM/Utils/OpenFlashChart.php | 2 +- CRM/Utils/PDF/Utils.php | 6 +- CRM/Utils/REST.php | 28 +++---- CRM/Utils/ReCAPTCHA.php | 2 +- CRM/Utils/SoapServer.php | 2 +- CRM/Utils/System.php | 6 +- CRM/Utils/System/Drupal6.php | 4 +- CRM/Utils/System/Joomla.php | 18 ++-- CRM/Utils/System/WordPress.php | 8 +- CRM/Utils/Token.php | 10 +-- CRM/Utils/Weight.php | 2 +- api/v3/Domain.php | 6 +- api/v3/Event.php | 2 +- api/v3/Generic.php | 2 +- api/v3/Job.php | 34 ++++---- api/v3/Mailing.php | 2 +- api/v3/MailingEventQueue.php | 2 +- api/v3/Membership.php | 2 +- api/v3/utils.php | 4 +- bin/cleanup42.php | 4 +- bin/cli.class.php | 2 +- bin/cli.php | 4 +- install/index.php | 4 +- .../CRM/Contact/BAO/GroupContactCacheTest.php | 2 +- .../CRM/Core/BAO/ActionScheduleTest.php | 84 +++++++++---------- .../Core/BAO/CustomValueTableSetGetTest.php | 6 +- tests/phpunit/CRM/Core/BAO/EmailTest.php | 2 +- tests/phpunit/CRM/Core/BAO/LocationTest.php | 2 +- tests/phpunit/CRM/Core/BAO/SettingTest.php | 2 +- .../phpunit/CRM/Core/Payment/BaseIPNTest.php | 10 +-- tests/phpunit/CRM/Core/RegionTest.php | 2 +- tests/phpunit/CRM/Core/ResourcesTest.php | 2 +- tests/phpunit/CRM/Dedupe/DedupeFinderTest.php | 2 +- .../Financial/BAO/FinancialAccountTest.php | 2 +- .../CRM/Financial/BAO/FinancialItemTest.php | 12 +-- .../BAO/FinancialTypeAccountTest.php | 12 +-- .../CRM/Financial/BAO/FinancialTypeTest.php | 2 +- .../BAO/PaymentProcessorTypeTest.php | 4 +- tests/phpunit/CRM/Mailing/BAO/SpoolTest.php | 36 ++++---- .../phpunit/CRM/Member/BAO/MembershipTest.php | 6 +- tests/phpunit/CRM/Utils/JSTest.php | 22 ++--- tests/phpunit/CRM/Utils/SQL/InsertTest.php | 4 +- tests/phpunit/CiviTest/bootstrap.php | 8 +- .../CiviTest/civicrm.settings.dist.php | 30 +++---- .../Activity/ContactContextAddTest.php | 2 +- .../Campaign/OnlineContributionTest.php | 2 +- .../AdvancedSearchedRelatedContactTest.php | 6 +- .../WebTest/Contact/MergeContactsTest.php | 2 +- .../Contribute/OfflineContributionTest.php | 2 +- .../Contribute/OnBehalfOfOrganization.php | 2 +- .../UpdateBatchPendingContributionTest.php | 2 +- .../Contribute/UpdateContributionTest.php | 12 +-- .../UpdatePendingContributionTest.php | 2 +- tests/phpunit/WebTest/Event/AddEventTest.php | 2 +- .../phpunit/WebTest/Event/AddPricesetTest.php | 2 +- .../Financial/FinancialBatchExport.php | 2 +- .../WebTest/Import/MatchExternalIdTest.php | 2 +- tests/phpunit/WebTest/Mailing/MailingTest.php | 2 +- .../Member/DefaultMembershipPricesetTest.php | 2 +- .../Member/FixedMembershipTypeTest.php | 8 +- .../Member/InheritedMembershipTest.php | 2 +- .../OfflineMembershipAddPricesetTest.php | 4 +- .../Member/OfflineMembershipRenewTest.php | 4 +- .../OnlineMembershipAddPricesetTest.php | 6 +- .../Member/OnlineMembershipRenewTest.php | 2 +- .../Member/UpdateMembershipScriptTest.php | 2 +- .../ContactContextPledgePaymentAddTest.php | 2 +- tests/phpunit/WebTest/Report/AddTest.php | 2 +- .../WebTest/Report/LoggingReportTest.php | 4 +- tests/phpunit/WebTest/Utils/RestTest.php | 18 ++-- tests/phpunit/api/v3/ActivityTest.php | 2 +- tests/phpunit/api/v3/ContributionSoftTest.php | 4 +- .../api/v3/CustomValueContactTypeTest.php | 6 +- tests/phpunit/api/v3/EventTest.php | 20 ++--- tests/phpunit/api/v3/GrantTest.php | 2 +- tests/phpunit/api/v3/GroupContactTest.php | 6 +- tests/phpunit/api/v3/GroupNestingTest.php | 6 +- .../phpunit/api/v3/GroupOrganizationTest.php | 14 ++-- .../phpunit/api/v3/JobProcessMailingTest.php | 6 +- tests/phpunit/api/v3/MembershipStatusTest.php | 4 +- tests/phpunit/api/v3/MembershipTypeTest.php | 16 ++-- tests/phpunit/api/v3/NoteTest.php | 14 ++-- .../phpunit/api/v3/ParticipantPaymentTest.php | 14 ++-- tests/phpunit/api/v3/ParticipantTest.php | 14 ++-- .../api/v3/PaymentProcessorTypeTest.php | 14 ++-- tests/phpunit/api/v3/PledgeTest.php | 12 +-- tests/phpunit/api/v3/PriceFieldValueTest.php | 2 +- tests/phpunit/api/v3/ReportTemplateTest.php | 2 +- tests/phpunit/api/v3/SettingTest.php | 2 +- .../phpunit/api/v3/SyntaxConformanceTest.php | 2 +- .../api/v3/TaxContributionPageTest.php | 12 +-- tests/phpunit/api/v3/UFGroupTest.php | 2 +- tests/phpunit/api/v3/UFJoinTest.php | 8 +- 298 files changed, 933 insertions(+), 933 deletions(-) diff --git a/CRM/ACL/Form/WordPress/Permissions.php b/CRM/ACL/Form/WordPress/Permissions.php index efbf0b041b..17790a9b5f 100644 --- a/CRM/ACL/Form/WordPress/Permissions.php +++ b/CRM/ACL/Form/WordPress/Permissions.php @@ -46,7 +46,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form { */ public function buildQuickForm() { - CRM_Utils_System::setTitle( 'Wordpress Access Control' ); + CRM_Utils_System::setTitle('Wordpress Access Control'); // Get the core permissions array $permissionsArray = self::getPermissionArray(); @@ -57,7 +57,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form { if (!isset($wp_roles)) { $wp_roles = new WP_Roles(); } - foreach ( $wp_roles->role_names as $role => $name ) { + foreach ($wp_roles->role_names as $role => $name) { // Dont show the permissions options for administrator, as they have all permissions if ($role !== 'administrator') { $roleObj = $wp_roles->get_role($role); @@ -72,7 +72,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form { // Compose the checkbox array for each role, to assign to form $rolePerms[$role] = $permissionsArray; - foreach ( $rolePerms[$role] as $key => $value) { + foreach ($rolePerms[$role] as $key => $value) { $elementName = $role.'['.$key.']'; $this->add('checkbox', $elementName, $value); } @@ -91,7 +91,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form { 'type' => 'next', 'name' => ts('Save'), 'spacing' => '', - 'isDefault' => FALSE ), + 'isDefault' => FALSE ), ) ); @@ -112,7 +112,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form { if (!isset($wp_roles)) { $wp_roles = new WP_Roles(); } - foreach ( $wp_roles->role_names as $role => $name ) { + foreach ($wp_roles->role_names as $role => $name) { $roleObj = $wp_roles->get_role($role); //Remove all civicrm capabilities for the role, as there may be some capabilities checkbox unticked @@ -123,7 +123,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form { //Add the selected wordpress capabilities for the role $rolePermissions = $params[$role]; if (!empty($rolePermissions)) { - foreach ( $rolePermissions as $key => $capability ) { + foreach ($rolePermissions as $key => $capability) { $roleObj->add_cap($key); } } @@ -141,7 +141,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form { } if (!empty($warningPermissionNames)) { CRM_Core_Session::setStatus( - ts('The %1 role was assigned one or more permissions that may prove dangerous for users of that role to have. Please reconsider assigning %2 to them.', array( 1 => $wp_roles->role_names[$role], 2 => implode(', ', $warningPermissionNames))), + ts('The %1 role was assigned one or more permissions that may prove dangerous for users of that role to have. Please reconsider assigning %2 to them.', array(1 => $wp_roles->role_names[$role], 2 => implode(', ', $warningPermissionNames))), ts('Unsafe Permission Settings') ); } @@ -159,7 +159,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form { CRM_Core_Session::setStatus("", ts('Wordpress Access Control Updated'), "success"); // rebuild the menus to comply with the new permisssions/capabilites - CRM_Core_Invoke::rebuildMenuAndCaches( ); + CRM_Core_Invoke::rebuildMenuAndCaches(); CRM_Utils_System::redirect('admin.php?page=CiviCRM&q=civicrm/admin/access&reset=1'); CRM_Utils_System::civiExit(); diff --git a/CRM/Activity/BAO/ICalendar.php b/CRM/Activity/BAO/ICalendar.php index 598f27c43c..fccd94a09a 100644 --- a/CRM/Activity/BAO/ICalendar.php +++ b/CRM/Activity/BAO/ICalendar.php @@ -53,7 +53,7 @@ class CRM_Activity_BAO_ICalendar { * @return \CRM_Activity_BAO_ICalendar @access public */ - public function __construct( &$act ) { + public function __construct(&$act) { $this->activity = $act; } @@ -67,15 +67,15 @@ class CRM_Activity_BAO_ICalendar { * * @return string Array index of the added attachment in the $attachments array, or else null. */ - public function addAttachment( &$attachments, $contacts ) { + public function addAttachment(&$attachments, $contacts) { // Check preferences setting - if ( CRM_Core_BAO_Setting::getItem( CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'activity_assignee_notification_ics' ) ) { + if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'activity_assignee_notification_ics')) { $config = &CRM_Core_Config::singleton(); - $this->icsfile = tempnam( $config->customFileUploadDir, 'ics' ); - if ( $this->icsfile !== FALSE ) { - rename( $this->icsfile, $this->icsfile . '.ics' ); + $this->icsfile = tempnam($config->customFileUploadDir, 'ics'); + if ($this->icsfile !== FALSE) { + rename($this->icsfile, $this->icsfile . '.ics'); $this->icsfile .= '.ics'; - $icsFileName = basename( $this->icsfile ); + $icsFileName = basename($this->icsfile); // get logged in user's primary email // TODO: Is there a better way to do this? @@ -87,8 +87,8 @@ class CRM_Activity_BAO_ICalendar { $template->assign('contacts', $contacts); $template->assign('timezone', date_default_timezone_get()); $calendar = $template->fetch('CRM/Activity/Calendar/ICal.tpl'); - if ( file_put_contents( $this->icsfile, $calendar ) !== FALSE ) { - if ( empty( $attachments ) ) { + if (file_put_contents($this->icsfile, $calendar) !== FALSE) { + if (empty($attachments)) { $attachments = array(); } $attachments['activity_ics'] = array( @@ -105,8 +105,8 @@ class CRM_Activity_BAO_ICalendar { } public function cleanup() { - if ( !empty ( $this->icsfile ) ) { - @unlink( $this->icsfile ); + if (!empty ($this->icsfile)) { + @unlink($this->icsfile); } } @@ -118,16 +118,16 @@ class CRM_Activity_BAO_ICalendar { $session = &CRM_Core_Session::singleton(); $uid = $session->get('userID'); $primary = ''; - $emails = CRM_Core_BAO_Email::allEmails( $uid ); - foreach ( $emails as $eid => $e ) { - if ( $e['is_primary'] ) { - if ( $e['email'] ) { + $emails = CRM_Core_BAO_Email::allEmails($uid); + foreach ($emails as $eid => $e) { + if ($e['is_primary']) { + if ($e['email']) { $primary = $e['email']; break; } } - if ( count($emails) == 1 ) { + if (count($emails) == 1) { $primary = $e['email']; break; } diff --git a/CRM/Activity/BAO/Query.php b/CRM/Activity/BAO/Query.php index abd533ba93..48ca703e37 100644 --- a/CRM/Activity/BAO/Query.php +++ b/CRM/Activity/BAO/Query.php @@ -544,10 +544,10 @@ class CRM_Activity_BAO_Query { $form->addSelect('activity_engagement_level', array('entity' => 'activity', 'context' => 'search')); // Add survey result field. - $optionGroups = CRM_Campaign_BAO_Survey::getResultSets( 'name' ); + $optionGroups = CRM_Campaign_BAO_Survey::getResultSets('name'); $resultOptions = array(); - foreach ( $optionGroups as $gid => $name ) { - if ( $name ) { + foreach ($optionGroups as $gid => $name) { + if ($name) { $value = array(); $value = CRM_Core_OptionGroup::values($name); if (!empty($value)) { diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index be1039b2c2..ffb4e76678 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -310,7 +310,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { // Set title if (isset($activityTName)) { $activityName = CRM_Utils_Array::value($this->_activityTypeId, $activityTName); - $this->assign('pageTitle', ts('%1 Activity', array( 1 => $activityName))); + $this->assign('pageTitle', ts('%1 Activity', array(1 => $activityName))); if ($this->_currentlyViewedContactId) { $displayName = CRM_Contact_BAO_Contact::displayName($this->_currentlyViewedContactId); @@ -321,7 +321,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { CRM_Utils_System::setTitle($displayName . ' - ' . $activityName); } else { - CRM_Utils_System::setTitle(ts('%1 Activity', array( 1 => $activityName))); + CRM_Utils_System::setTitle(ts('%1 Activity', array(1 => $activityName))); } } @@ -429,7 +429,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { $urlParams .= "&qfKey=$qfKey"; } $path = CRM_Utils_System::currentPath(); - if ($this->_compContext == 'advanced' ) { + if ($this->_compContext == 'advanced') { $urlString = 'civicrm/contact/search/advanced'; } elseif ($path == 'civicrm/group/search' diff --git a/CRM/Activity/Form/ActivityView.php b/CRM/Activity/Form/ActivityView.php index 2f85b0dce9..4c354edca9 100644 --- a/CRM/Activity/Form/ActivityView.php +++ b/CRM/Activity/Form/ActivityView.php @@ -87,7 +87,7 @@ class CRM_Activity_Form_ActivityView extends CRM_Core_Form { $this->_mailing_id, NULL, FALSE, NULL, NULL, NULL, $cid); $this->assign('openreport', $full_open_report); - $click_thru_report = CRM_Mailing_Event_BAO_TrackableURLOpen::getRows( $this->_mailing_id, NULL, FALSE, NULL, NULL, NULL, NULL, $cid); + $click_thru_report = CRM_Mailing_Event_BAO_TrackableURLOpen::getRows($this->_mailing_id, NULL, FALSE, NULL, NULL, NULL, NULL, $cid); $this->assign('clickreport', $click_thru_report); } diff --git a/CRM/Activity/Form/Task/PickOption.php b/CRM/Activity/Form/Task/PickOption.php index dba91bc410..f85f7af820 100644 --- a/CRM/Activity/Form/Task/PickOption.php +++ b/CRM/Activity/Form/Task/PickOption.php @@ -125,7 +125,7 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task { * @static */ public static function formRule($fields) { - if ( !isset($fields['with_contact']) && + if (!isset($fields['with_contact']) && !isset($fields['assigned_to']) && !isset($fields['created_by']) ) { @@ -173,7 +173,7 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task { $this->_contacts = array_unique($this->_contacts); //bounce to pick option if no contacts to send to - if ( empty($this->_contacts) ) { + if (empty($this->_contacts)) { $urlParams = "_qf_PickOption_display=true&qfKey={$params['qfKey']}"; $urlRedirect = CRM_Utils_System::url('civicrm/activity/search', $urlParams); CRM_Core_Error::statusBounce( diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index 0720178e59..9a96968ebf 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -500,7 +500,7 @@ class CRM_Activity_Page_AJAX { $domainID, TRUE ); - if ( $cacheKey ) { + if ($cacheKey) { CRM_Core_BAO_Setting::flushCache($cacheKey); } diff --git a/CRM/Activity/Selector/Activity.php b/CRM/Activity/Selector/Activity.php index 4ef5c9033f..37db986ac4 100644 --- a/CRM/Activity/Selector/Activity.php +++ b/CRM/Activity/Selector/Activity.php @@ -233,7 +233,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C elseif ($activityTypeName == 'Print PDF Letter') { $updateUrl = 'civicrm/activity/pdf/add'; } - if ( CRM_Activity_BAO_Activity::checkPermission($activityId, CRM_Core_Action::UPDATE) ) { + if (CRM_Activity_BAO_Activity::checkPermission($activityId, CRM_Core_Action::UPDATE)) { $actionLinks += array(CRM_Core_Action:: UPDATE => array( 'name' => ts('Edit'), diff --git a/CRM/Activity/Task.php b/CRM/Activity/Task.php index a17978ea23..482a0770f2 100644 --- a/CRM/Activity/Task.php +++ b/CRM/Activity/Task.php @@ -125,8 +125,8 @@ class CRM_Activity_Task { $config = CRM_Core_Config::singleton(); if (in_array('CiviCase', $config->enableComponents)) { - if ( CRM_Core_Permission::check('access all cases and activities') || - CRM_Core_Permission::check('access my cases and activities') ) { + if (CRM_Core_Permission::check('access all cases and activities') || + CRM_Core_Permission::check('access my cases and activities')) { self::$_tasks[6] = array( 'title' => ts('File on Case'), 'class' => 'CRM_Activity_Form_Task_FileOnCase', diff --git a/CRM/Admin/Form.php b/CRM/Admin/Form.php index 1910cc3bb3..3f9cbafaec 100644 --- a/CRM/Admin/Form.php +++ b/CRM/Admin/Form.php @@ -70,7 +70,7 @@ class CRM_Admin_Form extends CRM_Core_Form { $params = array('id' => $this->_id); // this is needed if the form is outside the CRM name space $baoName = $this->_BAOName; - $baoName::retrieve($params, $this->_values ); + $baoName::retrieve($params, $this->_values); } } @@ -86,7 +86,7 @@ class CRM_Admin_Form extends CRM_Core_Form { $this->_values = array(); $params = array('id' => $this->_id); $baoName = $this->_BAOName; - $baoName::retrieve($params, $this->_values ); + $baoName::retrieve($params, $this->_values); } $defaults = $this->_values; diff --git a/CRM/Admin/Form/PaymentProcessor.php b/CRM/Admin/Form/PaymentProcessor.php index 90ab5b80e8..6132f67371 100644 --- a/CRM/Admin/Form/PaymentProcessor.php +++ b/CRM/Admin/Form/PaymentProcessor.php @@ -59,7 +59,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { if ($this->_id) { $this->_ppType = CRM_Utils_Request::retrieve('pp', 'String', $this, FALSE, NULL); if (!$this->_ppType) { - $this->_ppType = CRM_Core_DAO::getFieldValue( 'CRM_Financial_DAO_PaymentProcessor', + $this->_ppType = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessor', $this->_id, 'payment_processor_type_id' ); @@ -71,13 +71,13 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { } $this->assign('ppType', $this->_ppType); - $ppTypeName = CRM_Core_DAO::getFieldValue( 'CRM_Financial_DAO_PaymentProcessorType', + $ppTypeName = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', $this->_ppType, 'name' ); - $this->assign('ppTypeName', $ppTypeName ); + $this->assign('ppTypeName', $ppTypeName); - $this->_ppDAO = new CRM_Financial_DAO_PaymentProcessorType( ); + $this->_ppDAO = new CRM_Financial_DAO_PaymentProcessorType(); $this->_ppDAO->id = $this->_ppType; if (!$this->_ppDAO->find(TRUE)) { @@ -188,7 +188,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { ); $types = CRM_Core_PseudoConstant::paymentProcessorType(); - $this->add( 'select', 'payment_processor_type_id', ts('Payment Processor Type'), $types, TRUE, + $this->add('select', 'payment_processor_type_id', ts('Payment Processor Type'), $types, TRUE, array('onchange' => "reload(true)") ); @@ -305,7 +305,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { } $domainID = CRM_Core_Config::domainID(); - $dao = new CRM_Financial_DAO_PaymentProcessor( ); + $dao = new CRM_Financial_DAO_PaymentProcessor(); $dao->id = $this->_id; $dao->domain_id = $domainID; if (!$dao->find(TRUE)) { @@ -339,7 +339,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { * @return Void */ public function postProcess() { - CRM_Utils_System::flushCache( 'CRM_Financial_DAO_PaymentProcessor' ); + CRM_Utils_System::flushCache('CRM_Financial_DAO_PaymentProcessor'); if ($this->_action & CRM_Core_Action::DELETE) { CRM_Financial_BAO_PaymentProcessor::del($this->_id); @@ -370,7 +370,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { * @return Void */ public function updatePaymentProcessor(&$values, $domainID, $test) { - $dao = new CRM_Financial_DAO_PaymentProcessor( ); + $dao = new CRM_Financial_DAO_PaymentProcessor(); $dao->id = $test ? $this->_testID : $this->_id; $dao->domain_id = $domainID; diff --git a/CRM/Admin/Form/PaymentProcessorType.php b/CRM/Admin/Form/PaymentProcessorType.php index 5ad7af3e11..56ac6a9aa8 100644 --- a/CRM/Admin/Form/PaymentProcessorType.php +++ b/CRM/Admin/Form/PaymentProcessorType.php @@ -159,7 +159,7 @@ class CRM_Admin_Form_PaymentProcessorType extends CRM_Admin_Form { return; } - $attributes = CRM_Core_DAO::getAttribute( 'CRM_Financial_DAO_PaymentProcessorType' ); + $attributes = CRM_Core_DAO::getAttribute('CRM_Financial_DAO_PaymentProcessorType'); foreach ($this->_fields as $field) { $required = CRM_Utils_Array::value('required', $field, FALSE); @@ -192,7 +192,7 @@ class CRM_Admin_Form_PaymentProcessorType extends CRM_Admin_Form { return $defaults; } - $dao = new CRM_Financial_DAO_PaymentProcessorType( ); + $dao = new CRM_Financial_DAO_PaymentProcessorType(); $dao->id = $this->_id; if (!$dao->find(TRUE)) { @@ -211,7 +211,7 @@ class CRM_Admin_Form_PaymentProcessorType extends CRM_Admin_Form { * @return void */ public function postProcess() { - CRM_Utils_System::flushCache( 'CRM_Financial_DAO_PaymentProcessorType' ); + CRM_Utils_System::flushCache('CRM_Financial_DAO_PaymentProcessorType'); if ($this->_action & CRM_Core_Action::DELETE) { CRM_Financial_BAO_PaymentProcessorType::del($this->_id); @@ -226,7 +226,7 @@ UPDATE civicrm_payment_processor SET is_default = 0"; CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray); } - $dao = new CRM_Financial_DAO_PaymentProcessorType( ); + $dao = new CRM_Financial_DAO_PaymentProcessorType(); $dao->id = $this->_id; $dao->is_default = CRM_Utils_Array::value('is_default', $values, 0); diff --git a/CRM/Admin/Form/Setting/Smtp.php b/CRM/Admin/Form/Setting/Smtp.php index 55651fe3bd..f6b282a2ac 100644 --- a/CRM/Admin/Form/Setting/Smtp.php +++ b/CRM/Admin/Form/Setting/Smtp.php @@ -92,7 +92,7 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting { if ($formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_DISABLED) { CRM_Core_Session::setStatus(ts('You have selected "Disable Outbound Email". A test email can not be sent.'), ts("Email Disabled"), "error"); } - elseif ( $formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_REDIRECT_TO_DB ) { + elseif ($formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_REDIRECT_TO_DB) { CRM_Core_Session::setStatus(ts('You have selected "Redirect to Database". A test email can not be sent.'), ts("Email Disabled"), "error"); } else { diff --git a/CRM/Admin/Form/Setting/Url.php b/CRM/Admin/Form/Setting/Url.php index 8cc261d872..d3f1dc2815 100644 --- a/CRM/Admin/Form/Setting/Url.php +++ b/CRM/Admin/Form/Setting/Url.php @@ -97,7 +97,7 @@ class CRM_Admin_Form_Setting_Url extends CRM_Admin_Form_Setting { // a potentially spurious message which might already have been set. This // is a bit hackish // CRM-10629 - $session = CRM_Core_Session::singleton( ); + $session = CRM_Core_Session::singleton(); $session->getStatus(TRUE); parent::postProcess(); diff --git a/CRM/Admin/Form/WordReplacements.php b/CRM/Admin/Form/WordReplacements.php index de422b3abd..fbe7fe33ba 100644 --- a/CRM/Admin/Form/WordReplacements.php +++ b/CRM/Admin/Form/WordReplacements.php @@ -122,8 +122,8 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form { //CRM-14179 $instances = 0; - foreach ( $values as $valMatchType ) { - foreach ( $valMatchType as $valPairs ) { + foreach ($values as $valMatchType) { + foreach ($valMatchType as $valPairs) { $instances += count($valPairs); } } diff --git a/CRM/Admin/Page/Access.php b/CRM/Admin/Page/Access.php index dfee8dff41..4f7ef3020d 100644 --- a/CRM/Admin/Page/Access.php +++ b/CRM/Admin/Page/Access.php @@ -55,7 +55,7 @@ class CRM_Admin_Page_Access extends CRM_Core_Page { case 'Joomla': //condition based on Joomla version; <= 2.5 uses modal window; >= 3.0 uses full page with return value - if (version_compare(JVERSION, '3.0', 'lt') ) { + if (version_compare(JVERSION, '3.0', 'lt')) { JHTML::_('behavior.modal'); $url = $config->userFrameworkBaseURL . 'index.php?option=com_config&view=component&component=com_civicrm&tmpl=component'; $jparams = 'rel="{handler: \'iframe\', size: {x: 875, y: 550}, onClose: function() {}}" class="modal"'; diff --git a/CRM/Admin/Page/Extensions.php b/CRM/Admin/Page/Extensions.php index 5109f9c73d..9f79a50438 100644 --- a/CRM/Admin/Page/Extensions.php +++ b/CRM/Admin/Page/Extensions.php @@ -55,11 +55,11 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { */ public function preProcess() { CRM_Utils_System::setTitle(ts('CiviCRM Extensions')); - $destination = CRM_Utils_System::url( 'civicrm/admin/extensions', - 'reset=1' ); + $destination = CRM_Utils_System::url('civicrm/admin/extensions', + 'reset=1'); - $destination = urlencode( $destination ); - $this->assign( 'destination', $destination ); + $destination = urlencode($destination); + $this->assign('destination', $destination); } /** diff --git a/CRM/Badge/Form/Layout.php b/CRM/Badge/Form/Layout.php index 7294a5ac5a..7a9f8689d2 100644 --- a/CRM/Badge/Form/Layout.php +++ b/CRM/Badge/Form/Layout.php @@ -92,7 +92,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { unset($imageAlignment['C']); $rowCount = self::FIELD_ROWCOUNT; - for ( $i = 1; $i <= $rowCount; $i++ ) { + for ($i = 1; $i <= $rowCount; $i++) { $this->add('select', "token[$i]", ts('Token'), array('' => ts('- skip -')) + $tokens); $this->add('select', "font_name[$i]", ts('Font Name'), $fontNames); $this->add('select', "font_size[$i]", ts('Font Size'), $fontSizes); diff --git a/CRM/Batch/BAO/Batch.php b/CRM/Batch/BAO/Batch.php index bd9840fcdb..f3b895a042 100755 --- a/CRM/Batch/BAO/Batch.php +++ b/CRM/Batch/BAO/Batch.php @@ -513,7 +513,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { $batches = array(); $dao = CRM_Core_DAO::executeQuery($query); - while ( $dao->fetch( ) ) { + while ($dao->fetch()) { $batches[$dao->id] = $dao->title; } return $batches; @@ -592,7 +592,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { // Instantiate appropriate exporter based on user-selected format. $exporterClass = "CRM_Financial_BAO_ExportFormat_" . self::$_exportFormat; - if ( class_exists( $exporterClass ) ) { + if (class_exists($exporterClass)) { $exporter = new $exporterClass(); } else { @@ -621,10 +621,10 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { */ public static function closeReOpen($batchIds = array(), $status) { $batchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id'); - $params['status_id'] = CRM_Utils_Array::key( $status, $batchStatus ); - $session = CRM_Core_Session::singleton( ); + $params['status_id'] = CRM_Utils_Array::key($status, $batchStatus); + $session = CRM_Core_Session::singleton(); $params['modified_date'] = date('YmdHis'); - $params['modified_id'] = $session->get( 'userID' ); + $params['modified_id'] = $session->get('userID'); foreach ($batchIds as $key => $value) { $params['id'] = $ids['batchID'] = $value; self::create($params, $ids); @@ -654,7 +654,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { } // action is taken depending upon the mode $select = 'civicrm_financial_trxn.id '; - if (!empty( $returnValues)) { + if (!empty($returnValues)) { $select .= " , ".implode(' , ', $returnValues); } @@ -784,7 +784,7 @@ WHERE {$where} $batches = array(); $dao = CRM_Core_DAO::executeQuery($query); - while ( $dao->fetch( ) ) { + while ($dao->fetch()) { $batches[$dao->id] = $dao->title; } return $batches; @@ -804,7 +804,7 @@ WHERE {$where} $batches = array(); $dao = CRM_Core_DAO::executeQuery($query); - while ( $dao->fetch( ) ) { + while ($dao->fetch()) { $batches[$dao->id] = $dao->status_id; } return $batches; diff --git a/CRM/Batch/Form/Batch.php b/CRM/Batch/Form/Batch.php index 498bef783a..01c59b57dc 100755 --- a/CRM/Batch/Form/Batch.php +++ b/CRM/Batch/Form/Batch.php @@ -114,7 +114,7 @@ class CRM_Batch_Form_Batch extends CRM_Admin_Form { else { $session = CRM_Core_Session::singleton(); $params['created_id'] = $session->get('userID'); - $params['created_date'] = CRM_Utils_Date::processDate( date( "Y-m-d" ), date( "H:i:s" ) ); + $params['created_date'] = CRM_Utils_Date::processDate(date("Y-m-d"), date("H:i:s")); } // always create with data entry status @@ -123,7 +123,7 @@ class CRM_Batch_Form_Batch extends CRM_Admin_Form { // redirect to batch entry page. $session = CRM_Core_Session::singleton(); - if ( $this->_action & CRM_Core_Action::ADD ) { + if ($this->_action & CRM_Core_Action::ADD) { $session->replaceUserContext(CRM_Utils_System::url('civicrm/batch/entry', "id={$batch->id}&reset=1&action=add")); } else { diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index 34b3110d2d..18600211b8 100755 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -342,12 +342,12 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { } // for add mode set smart defaults - if ( $this->_action & CRM_Core_Action::ADD ) { - list( $currentDate, $currentTime ) = CRM_Utils_Date::setDateDefaults( NULL, 'activityDateTime' ); + if ($this->_action & CRM_Core_Action::ADD) { + list($currentDate, $currentTime) = CRM_Utils_Date::setDateDefaults(NULL, 'activityDateTime'); //get all status $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); - $completeStatus = array_search( 'Completed', $allStatus ); + $completeStatus = array_search('Completed', $allStatus); $specialFields = array( 'join_date' => $currentDate, 'receive_date' => $currentDate, @@ -356,7 +356,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { ); for ($rowNumber = 1; $rowNumber <= $this->_batchInfo['item_count']; $rowNumber++) { - foreach ($specialFields as $key => $value ) { + foreach ($specialFields as $key => $value) { $defaults['field'][$rowNumber][$key] = $value; } } @@ -464,7 +464,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { foreach ($dates as $val) { if (!empty($value[$val])) { - $value[$val] = CRM_Utils_Date::processDate( $value[$val], $value[$val . '_time'], TRUE ); + $value[$val] = CRM_Utils_Date::processDate($value[$val], $value[$val . '_time'], TRUE); } } @@ -523,7 +523,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { if (is_numeric($pledgeId)) { $result = CRM_Pledge_BAO_PledgePayment::getPledgePayments($pledgeId); $pledgePaymentId = 0; - foreach ($result as $key => $values ) { + foreach ($result as $key => $values) { if ($values['status'] != 'Completed') { $pledgePaymentId = $values['id']; break; @@ -569,7 +569,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { $domainEmail = "$domainEmail[0] <$domainEmail[1]>"; $value['from_email_address'] = $domainEmail; $value['contribution_id'] = $contribution->id; - CRM_Contribute_Form_AdditionalInfo::emailReceipt( $this, $value ); + CRM_Contribute_Form_AdditionalInfo::emailReceipt($this, $value); } } } @@ -698,7 +698,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { } if (!empty($value['receive_date'])) { - $value['receive_date'] = CRM_Utils_Date::processDate( $value['receive_date'], $value['receive_date_time'], TRUE ); + $value['receive_date'] = CRM_Utils_Date::processDate($value['receive_date'], $value['receive_date_time'], TRUE); } $params['actualBatchTotal'] += $value['total_amount']; @@ -763,7 +763,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { unset($value['membership_end_date']); $value['is_renew'] = FALSE; - if (!empty($params['member_option']) && CRM_Utils_Array::value( $key, $params['member_option'] ) == 2 ) { + if (!empty($params['member_option']) && CRM_Utils_Array::value($key, $params['member_option']) == 2) { $this->_params = $params; $value['is_renew'] = TRUE; $membership = CRM_Member_BAO_Membership::renewMembershipFormWrapper( @@ -774,7 +774,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { ); // make contribution entry - CRM_Member_BAO_Membership::recordMembershipContribution( array_merge($value, array('membership_id' => $membership->id))); + CRM_Member_BAO_Membership::recordMembershipContribution(array_merge($value, array('membership_id' => $membership->id))); } else { $membership = CRM_Member_BAO_Membership::create($value, CRM_Core_DAO::$_nullArray); @@ -803,7 +803,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { // end of premium //send receipt mail. - if ( $membership->id && !empty($value['send_receipt'])) { + if ($membership->id && !empty($value['send_receipt'])) { // add the domain email id $domainEmail = CRM_Core_BAO_Domain::getNameAndEmail(); @@ -812,7 +812,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { $value['from_email_address'] = $domainEmail; $value['membership_id'] = $membership->id; $value['contribution_id'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipPayment', $membership->id, 'contribution_id', 'membership_id'); - CRM_Member_Form_Membership::emailReceipt( $this, $value, $membership ); + CRM_Member_Form_Membership::emailReceipt($this, $value, $membership); } } } diff --git a/CRM/Campaign/Form/Survey.php b/CRM/Campaign/Form/Survey.php index 3b6ef57ff8..31375bd153 100644 --- a/CRM/Campaign/Form/Survey.php +++ b/CRM/Campaign/Form/Survey.php @@ -174,7 +174,7 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form { * @return string */ public function getTemplateFileName() { - if ($this->controller->getPrint() || $this->getVar('_surveyId') <= 0 ) { + if ($this->controller->getPrint() || $this->getVar('_surveyId') <= 0) { return parent::getTemplateFileName(); } else { diff --git a/CRM/Campaign/Form/Task/Interview.php b/CRM/Campaign/Form/Task/Interview.php index e8880a9c5c..2e4c90ba67 100755 --- a/CRM/Campaign/Form/Task/Interview.php +++ b/CRM/Campaign/Form/Task/Interview.php @@ -95,17 +95,17 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task { $this->_interviewerId = CRM_Utils_Array::value('survey_interviewer_id', $this->get('formValues')); } - if ( $this->_surveyId ) { + if ($this->_surveyId) { $params = array('id' => $this->_surveyId); CRM_Campaign_BAO_Survey::retrieve($params, $this->_surveyDetails); } $orderClause = FALSE; $buttonName = $this->controller->getButtonName(); - if ( $buttonName == '_qf_Interview_submit_orderBy' && !empty($_POST['order_bys'])) { + if ($buttonName == '_qf_Interview_submit_orderBy' && !empty($_POST['order_bys'])) { $orderByParams = CRM_Utils_Array::value('order_bys', $_POST); } - elseif ( CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id'] ) { + elseif (CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id']) { $orderByParams = array( 1 => array( @@ -128,13 +128,13 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task { } $orderBy = array(); - if ( !empty($orderByParams) ) { - foreach ( $orderByParams as $key => $val ) { + if (!empty($orderByParams)) { + foreach ($orderByParams as $key => $val) { if (!empty($val['column'])) { $orderBy[] = "{$val['column']} {$val['order']}"; } } - if ( !empty($orderBy) ) { + if (!empty($orderBy)) { $orderClause = "ORDER BY " . implode(', ', $orderBy); } } @@ -400,7 +400,7 @@ WHERE {$clause} } } - if ( CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id'] ) { + if (CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id']) { $defaults['order_bys'] = array( 1 => array( diff --git a/CRM/Case/Form/Activity/ChangeCaseStatus.php b/CRM/Case/Form/Activity/ChangeCaseStatus.php index 5b9d506865..5287b93576 100644 --- a/CRM/Case/Form/Activity/ChangeCaseStatus.php +++ b/CRM/Case/Form/Activity/ChangeCaseStatus.php @@ -179,7 +179,7 @@ class CRM_Case_Form_Activity_ChangeCaseStatus { $params['priority_id'] = CRM_Core_OptionGroup::getValue('priority', 'Normal', 'name'); $activity->priority_id = $params['priority_id']; - foreach ($form->_oldCaseStatus as $statuskey => $statusval ) { + foreach ($form->_oldCaseStatus as $statuskey => $statusval) { if ($activity->subject == 'null') { $activity->subject = ts('Case status changed from %1 to %2', array( 1 => CRM_Utils_Array::value($statusval, $form->_caseStatus), diff --git a/CRM/Case/Form/Activity/OpenCase.php b/CRM/Case/Form/Activity/OpenCase.php index 8e103e584b..4c9d88766d 100644 --- a/CRM/Case/Form/Activity/OpenCase.php +++ b/CRM/Case/Form/Activity/OpenCase.php @@ -83,7 +83,7 @@ class CRM_Case_Form_Activity_OpenCase { $form->_caseStatusId = array_key_exists($caseStatusId, $caseStatus) ? $caseStatusId : NULL; // Add attachments - CRM_Core_BAO_File::buildAttachment( $form, 'civicrm_activity', $form->_activityId ); + CRM_Core_BAO_File::buildAttachment($form, 'civicrm_activity', $form->_activityId); $session = CRM_Core_Session::singleton(); $session->pushUserContext(CRM_Utils_System::url('civicrm/case', 'reset=1')); } @@ -338,9 +338,9 @@ class CRM_Case_Form_Activity_OpenCase { // Add parameters for attachments $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments'); - for ( $i = 1; $i <= $numAttachments; $i++ ) { + for ($i = 1; $i <= $numAttachments; $i++) { $attachName = "attachFile_$i"; - if ( isset( $params[$attachName] ) && !empty( $params[$attachName] ) ) { + if (isset($params[$attachName]) && !empty($params[$attachName])) { $xmlProcessorParams[$attachName] = $params[$attachName]; } } diff --git a/CRM/Case/Form/Case.php b/CRM/Case/Form/Case.php index 959f97a4a7..08435728d8 100644 --- a/CRM/Case/Form/Case.php +++ b/CRM/Case/Form/Case.php @@ -367,7 +367,7 @@ class CRM_Case_Form_Case extends CRM_Core_Form { // 1. call begin post process if ($this->_activityTypeFile) { $className = "CRM_Case_Form_Activity_{$this->_activityTypeFile}"; - $className::beginPostProcess($this, $params ); + $className::beginPostProcess($this, $params); } if (!empty($params['hidden_custom']) && @@ -431,7 +431,7 @@ class CRM_Case_Form_Case extends CRM_Core_Form { // 4. call end post process if ($this->_activityTypeFile) { - $className::endPostProcess($this, $params ); + $className::endPostProcess($this, $params); } // 5. auto populate activites diff --git a/CRM/Case/Form/CaseView.php b/CRM/Case/Form/CaseView.php index 2579cca46c..6bc55a23cf 100644 --- a/CRM/Case/Form/CaseView.php +++ b/CRM/Case/Form/CaseView.php @@ -257,10 +257,10 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form { FALSE, NULL, FALSE ); } - elseif ($type == $pdfActivityType ) { + elseif ($type == $pdfActivityType) { $url = CRM_Utils_System::url('civicrm/activity/pdf/add', "action=add&context=standalone&reset=1&cid={$this->_contactID}&caseid={$this->_caseID}&atype=$type", - FALSE, NULL, FALSE ); + FALSE, NULL, FALSE); } else { $url = CRM_Utils_System::url('civicrm/case/activity', diff --git a/CRM/Case/XMLProcessor/Process.php b/CRM/Case/XMLProcessor/Process.php index 8eaadbba6a..94d0afe4e1 100644 --- a/CRM/Case/XMLProcessor/Process.php +++ b/CRM/Case/XMLProcessor/Process.php @@ -493,9 +493,9 @@ AND a.is_deleted = 0 // Add parameters for attachments $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments'); - for ( $i = 1; $i <= $numAttachments; $i++ ) { + for ($i = 1; $i <= $numAttachments; $i++) { $attachName = "attachFile_$i"; - if ( isset( $params[$attachName] ) && !empty( $params[$attachName] ) ) { + if (isset($params[$attachName]) && !empty($params[$attachName])) { $activityParams[$attachName] = $params[$attachName]; } } diff --git a/CRM/Contact/BAO/Contact/Optimizer.php b/CRM/Contact/BAO/Contact/Optimizer.php index 0edb6d8ae0..b1c2bae4ab 100644 --- a/CRM/Contact/BAO/Contact/Optimizer.php +++ b/CRM/Contact/BAO/Contact/Optimizer.php @@ -37,67 +37,67 @@ class CRM_Contact_BAO_Contact_Optimizer { * @param $newValues * @param $oldValues */ - public static function edit( &$newValues, &$oldValues ) { + public static function edit(&$newValues, &$oldValues) { // still need to do more work on this // CRM-10192 return; - self::website( $newValues, $oldValues ); + self::website($newValues, $oldValues); } /** * @param $newValues * @param $oldValues */ - public static function website( &$newValues, &$oldValues ) { - $oldWebsiteValues = CRM_Utils_Array::value( 'website', $oldValues ); - $newWebsiteValues = CRM_Utils_Array::value( 'website', $newValues ); + public static function website(&$newValues, &$oldValues) { + $oldWebsiteValues = CRM_Utils_Array::value('website', $oldValues); + $newWebsiteValues = CRM_Utils_Array::value('website', $newValues); - if ( $oldWebsiteValues == null || $newWebsiteValues == null ) { + if ($oldWebsiteValues == null || $newWebsiteValues == null) { return; } // check if we had a value in the old $oldEmpty = $newEmpty = true; - $old = $new = array( ); + $old = $new = array(); - foreach ( $oldWebsiteValues as $idx => $value ) { - if ( ! empty( $value['url'] ) ) { + foreach ($oldWebsiteValues as $idx => $value) { + if (! empty($value['url'])) { $oldEmpty = false; - $old[] = array( 'website_type_id' => $value['website_type_id'], 'url' => $value['url'] ); + $old[] = array('website_type_id' => $value['website_type_id'], 'url' => $value['url']); } } - foreach ( $newWebsiteValues as $idx => $value ) { - if ( ! empty( $value['url'] ) ) { + foreach ($newWebsiteValues as $idx => $value) { + if (! empty($value['url'])) { $newEmpty = false; - $new[] = array( 'website_type_id' => $value['website_type_id'], 'url' => $value['url'] ); + $new[] = array('website_type_id' => $value['website_type_id'], 'url' => $value['url']); } } // if both old and new are empty, we can delete new and avoid a write - if ( $oldEmpty && $newEmpty ) { - unset( $newValues['website'] ); + if ($oldEmpty && $newEmpty) { + unset($newValues['website']); } // if different number of non-empty entries, return - if ( count( $new ) != count( $old ) ) { + if (count($new) != count($old)) { return; } // same number of entries, check if they are exactly the same - foreach ( $old as $oldID => $oldValues ) { + foreach ($old as $oldID => $oldValues) { $found = false; - foreach ( $new as $newID => $newValues ) { + foreach ($new as $newID => $newValues) { if ( $old['website_type_id'] == $new['website_type_id'] && $old['url'] == $new['url'] ) { $found = true; - unset( $new[$newID] ); + unset($new[$newID]); break; } - if ( ! $found ) { + if (! $found) { return; } } @@ -105,27 +105,27 @@ class CRM_Contact_BAO_Contact_Optimizer { // if we've come here, this means old and new are the same // we can skip saving new and return - unset( $newValues['website'] ); + unset($newValues['website']); } /** * @param $newValues * @param $oldValues */ - public static function email( &$newValues, &$oldValues ) { - $oldEmailValues = CRM_Utils_Array::value( 'email', $oldValues ); - $newEmailValues = CRM_Utils_Array::value( 'email', $newValues ); + public static function email(&$newValues, &$oldValues) { + $oldEmailValues = CRM_Utils_Array::value('email', $oldValues); + $newEmailValues = CRM_Utils_Array::value('email', $newValues); - if ( $oldEmailValues == null || $newEmailValues == null ) { + if ($oldEmailValues == null || $newEmailValues == null) { return; } // check if we had a value in the old $oldEmpty = $newEmpty = true; - $old = $new = array( ); + $old = $new = array(); - foreach ( $oldEmailValues as $idx => $value ) { - if ( ! empty( $value['email'] ) ) { + foreach ($oldEmailValues as $idx => $value) { + if (! empty($value['email'])) { $oldEmpty = false; $old[] = array( 'email' => $value['email'], @@ -139,8 +139,8 @@ class CRM_Contact_BAO_Contact_Optimizer { } } - foreach ( $newEmailValues as $idx => $value ) { - if ( ! empty( $value['email'] ) ) { + foreach ($newEmailValues as $idx => $value) { + if (! empty($value['email'])) { $newEmpty = false; $new[] = array( 'email' => $value['email'], @@ -155,28 +155,28 @@ class CRM_Contact_BAO_Contact_Optimizer { } // if both old and new are empty, we can delete new and avoid a write - if ( $oldEmpty && $newEmpty ) { - unset( $newValues['email'] ); + if ($oldEmpty && $newEmpty) { + unset($newValues['email']); } // if different number of non-empty entries, return - if ( count( $new ) != count( $old ) ) { + if (count($new) != count($old)) { return; } // same number of entries, check if they are exactly the same - foreach ( $old as $oldID => $oldValues ) { + foreach ($old as $oldID => $oldValues) { $found = false; - foreach ( $new as $newID => $newValues ) { + foreach ($new as $newID => $newValues) { if ( $old['email_type_id'] == $new['email_type_id'] && $old['url'] == $new['url'] ) { $found = true; - unset( $new[$newID] ); + unset($new[$newID]); break; } - if ( ! $found ) { + if (! $found) { return; } } @@ -184,6 +184,6 @@ class CRM_Contact_BAO_Contact_Optimizer { // if we've come here, this means old and new are the same // we can skip saving new and return - unset( $newValues['email'] ); + unset($newValues['email']); } } diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 6611bda45d..39b79063b0 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -378,7 +378,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { $params['group_type'] = ''; } - $session = CRM_Core_Session::singleton( ); + $session = CRM_Core_Session::singleton(); $cid = $session->get('userID'); // this action is add if ($cid && empty($params['id'])) { @@ -618,7 +618,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { public static function getPermissionClause($force = FALSE) { static $clause = 1; static $retrieved = FALSE; - if ((!$retrieved || $force ) && !CRM_Core_Permission::check('view all contacts') && !CRM_Core_Permission::check('edit all contacts')) { + if ((!$retrieved || $force) && !CRM_Core_Permission::check('view all contacts') && !CRM_Core_Permission::check('edit all contacts')) { //get the allowed groups for the current user $groups = CRM_ACL_API::group(CRM_ACL_API::VIEW); if (!empty($groups)) { diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index 06ad552753..7c79313f0b 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -128,7 +128,7 @@ AND ( g.cache_date IS NULL OR // this function is expensive and should be sparingly used if groupIDs is empty if (empty($groupIDs)) { $groupIDClause = null; - $groupIDs = array( ); + $groupIDs = array(); } else { if (!is_array($groupIDs)) { @@ -653,7 +653,7 @@ ORDER BY gc.contact_id, g.children $prevContactID = $dao->contact_id; if (!array_key_exists($dao->contact_id, $contactGroup)) { $contactGroup[$dao->contact_id] = - array( 'group' => array(), 'groupTitle' => array()); + array('group' => array(), 'groupTitle' => array()); } $contactGroup[$dao->contact_id]['group'][] = diff --git a/CRM/Contact/BAO/GroupNesting.php b/CRM/Contact/BAO/GroupNesting.php index 1a27086e77..172f9a6bee 100644 --- a/CRM/Contact/BAO/GroupNesting.php +++ b/CRM/Contact/BAO/GroupNesting.php @@ -155,7 +155,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen $nextGroup = $this->_getNextSiblingGroup($currentGroup); if (!$nextGroup) { // no sibling, find an ancestor w/ a sibling - for (;; ) { + for (;;) { // since we pop this array everytime, we should be // reasonably safe from infinite loops, I think :) $ancestor = array_pop($this->_parentStack); diff --git a/CRM/Contact/BAO/SearchCustom.php b/CRM/Contact/BAO/SearchCustom.php index 10b91e4b29..29752582e4 100644 --- a/CRM/Contact/BAO/SearchCustom.php +++ b/CRM/Contact/BAO/SearchCustom.php @@ -114,7 +114,7 @@ class CRM_Contact_BAO_SearchCustom { } // instantiate the new class - $customClass = new $customSearchClass( $formValues ); + $customClass = new $customSearchClass($formValues); return $customClass; } diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index b157cde17d..c79406edaf 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -325,7 +325,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { if (!empty($_POST['hidden_custom'])) { $customGroupCount = CRM_Utils_Array::value('hidden_custom_group_count', $_POST); - if ($contactSubType = CRM_Utils_Array::value( 'contact_sub_type', $_POST)) { + if ($contactSubType = CRM_Utils_Array::value('contact_sub_type', $_POST)) { $paramSubType = implode(',', $contactSubType); } @@ -358,7 +358,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { //custom field to load if ($this->_contactSubType || isset($paramSubType)) { $paramSubType = (isset($paramSubType)) ? $paramSubType : - str_replace( CRM_Core_DAO::VALUE_SEPARATOR, ',', trim($this->_contactSubType, CRM_Core_DAO::VALUE_SEPARATOR)); + str_replace(CRM_Core_DAO::VALUE_SEPARATOR, ',', trim($this->_contactSubType, CRM_Core_DAO::VALUE_SEPARATOR)); $this->assign('paramSubType', $paramSubType); } @@ -429,7 +429,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { } //set address block defaults - CRM_Contact_Form_Edit_Address::setDefaultValues( $defaults, $this ); + CRM_Contact_Form_Edit_Address::setDefaultValues($defaults, $this); if (!empty($defaults['image_URL'])) { @@ -866,7 +866,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { } } - CRM_Contact_BAO_Contact_Optimizer::edit( $params, $this->_preEditValues ); + CRM_Contact_BAO_Contact_Optimizer::edit($params, $this->_preEditValues); if (!empty($params['image_URL'])) { CRM_Contact_BAO_Contact::processImageParams($params); diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index cdfaeef9c7..b1bb21a159 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -210,7 +210,7 @@ class CRM_Contact_Form_Edit_Address { // since we change element name for address custom data, we need to format the setdefault values $addressDefaults = array(); foreach ($defaults as $key => $val) { - if ( empty( $val ) ) { + if (empty($val)) { continue; } @@ -322,7 +322,7 @@ class CRM_Contact_Form_Edit_Address { * * @static */ - public static function setDefaultValues( &$defaults, &$form ) { + public static function setDefaultValues(&$defaults, &$form) { $addressValues = array(); if (isset($defaults['address']) && is_array($defaults['address']) && !CRM_Utils_System::isNull($defaults['address']) diff --git a/CRM/Contact/Form/Edit/CustomData.php b/CRM/Contact/Form/Edit/CustomData.php index 265958ba17..e67424094a 100644 --- a/CRM/Contact/Form/Edit/CustomData.php +++ b/CRM/Contact/Form/Edit/CustomData.php @@ -82,7 +82,7 @@ class CRM_Contact_Form_Edit_CustomData { unset($customValueCount[0]); } $form->_customValueCount = $customValueCount; - $form->assign( 'customValueCount', $customValueCount); + $form->assign('customValueCount', $customValueCount); } } } diff --git a/CRM/Contact/Form/Edit/Household.php b/CRM/Contact/Form/Edit/Household.php index acdee4b6a7..3a56578824 100644 --- a/CRM/Contact/Form/Edit/Household.php +++ b/CRM/Contact/Form/Edit/Household.php @@ -57,18 +57,18 @@ class CRM_Contact_Form_Edit_Household { $form->applyFilter('__ALL__', 'trim'); - if ( !$inlineEditMode || $inlineEditMode == 1 ) { + if (!$inlineEditMode || $inlineEditMode == 1) { // household_name $form->add('text', 'household_name', ts('Household Name'), $attributes['household_name']); } - if ( !$inlineEditMode || $inlineEditMode == 2 ) { + if (!$inlineEditMode || $inlineEditMode == 2) { // nick_name $form->addElement('text', 'nick_name', ts('Nickname'), $attributes['nick_name']); $form->addElement('text', 'contact_source', ts('Source'), CRM_Utils_Array::value('source', $attributes)); } - if ( !$inlineEditMode ) { + if (!$inlineEditMode) { $form->add('text', 'external_identifier', ts('External ID'), $attributes['external_identifier'], FALSE); $form->addRule('external_identifier', ts('External ID already exists in Database.'), diff --git a/CRM/Contact/Form/Edit/Individual.php b/CRM/Contact/Form/Edit/Individual.php index 76987294b7..319ed3a2cd 100644 --- a/CRM/Contact/Form/Edit/Individual.php +++ b/CRM/Contact/Form/Edit/Individual.php @@ -55,7 +55,7 @@ class CRM_Contact_Form_Edit_Individual { public static function buildQuickForm(&$form, $inlineEditMode = NULL) { $form->applyFilter('__ALL__', 'trim'); - if ( !$inlineEditMode || $inlineEditMode == 1 ) { + if (!$inlineEditMode || $inlineEditMode == 1) { $nameFields = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_edit_options', TRUE, NULL, FALSE, 'name', TRUE, 'AND v.filter = 2' @@ -95,7 +95,7 @@ class CRM_Contact_Form_Edit_Individual { } } - if ( !$inlineEditMode || $inlineEditMode == 2 ) { + if (!$inlineEditMode || $inlineEditMode == 2) { // nick_name $form->addElement('text', 'nick_name', ts('Nickname'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'nick_name') @@ -116,14 +116,14 @@ class CRM_Contact_Form_Edit_Individual { $form->addElement('text', 'contact_source', ts('Source'), CRM_Utils_Array::value('source', $attributes)); } - if ( !$inlineEditMode ) { + if (!$inlineEditMode) { $checkSimilar = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_ajax_check_similar', NULL, TRUE ); - if ( $checkSimilar == null ) { + if ($checkSimilar == null) { $checkSimilar = 0; } $form->assign('checkSimilar', $checkSimilar); diff --git a/CRM/Contact/Form/Edit/Organization.php b/CRM/Contact/Form/Edit/Organization.php index 31429ca2be..da17b87dd3 100644 --- a/CRM/Contact/Form/Edit/Organization.php +++ b/CRM/Contact/Form/Edit/Organization.php @@ -57,12 +57,12 @@ class CRM_Contact_Form_Edit_Organization { $form->applyFilter('__ALL__', 'trim'); - if ( !$inlineEditMode || $inlineEditMode == 1 ) { + if (!$inlineEditMode || $inlineEditMode == 1) { // Organization_name $form->add('text', 'organization_name', ts('Organization Name'), $attributes['organization_name']); } - if ( !$inlineEditMode || $inlineEditMode == 2 ) { + if (!$inlineEditMode || $inlineEditMode == 2) { // legal_name $form->addElement('text', 'legal_name', ts('Legal Name'), $attributes['legal_name']); @@ -77,7 +77,7 @@ class CRM_Contact_Form_Edit_Organization { $form->addElement('text', 'contact_source', ts('Source'), CRM_Utils_Array::value('source', $attributes)); } - if ( !$inlineEditMode ) { + if (!$inlineEditMode) { $form->add('text', 'external_identifier', ts('External ID'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'external_identifier'), FALSE); $form->addRule('external_identifier', ts('External ID already exists in Database.'), diff --git a/CRM/Contact/Form/GroupContact.php b/CRM/Contact/Form/GroupContact.php index 809e108bf7..dd0a16e2b7 100644 --- a/CRM/Contact/Form/GroupContact.php +++ b/CRM/Contact/Form/GroupContact.php @@ -89,7 +89,7 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form { $groupSelect = $groupHierarchy; } - $groupSelect = array( '' => ts('- select group -')) + $groupSelect; + $groupSelect = array('' => ts('- select group -')) + $groupSelect; if (count($groupSelect) > 1) { $session = CRM_Core_Session::singleton(); diff --git a/CRM/Contact/Form/Location.php b/CRM/Contact/Form/Location.php index c858eaec27..6d6363c13c 100644 --- a/CRM/Contact/Form/Location.php +++ b/CRM/Contact/Form/Location.php @@ -111,7 +111,7 @@ class CRM_Contact_Form_Location { $form->set($blockName . '_Block_Count', $instance); $formName = 'CRM_Contact_Form_Edit_' . $blockName; - $formName::buildQuickForm( $form ); + $formName::buildQuickForm($form); } } diff --git a/CRM/Contact/Form/RelatedContact.php b/CRM/Contact/Form/RelatedContact.php index 647eb4fbe5..ce80a97f24 100644 --- a/CRM/Contact/Form/RelatedContact.php +++ b/CRM/Contact/Form/RelatedContact.php @@ -178,7 +178,7 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { $params['contact_type'] = $this->_contactType; //CRM-14904 - if ( isset($this->_defaults['contact_sub_type']) ) { + if (isset($this->_defaults['contact_sub_type'])) { $params['contact_sub_type'] = $this->_defaults['contact_sub_type']; } $params['contact_id'] = $this->_contactId; diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 2ec068edb5..1fb145835c 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -345,7 +345,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { 'select', 'relationship_type_id', ts('Relationship Type'), - array( '' => ts('- select -')) + $relationshipList, + array('' => ts('- select -')) + $relationshipList, TRUE, array('class' => 'crm-select2 huge') ); diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index 18ac653726..a105b2a2dc 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -430,7 +430,7 @@ class CRM_Contact_Form_Search_Criteria { $form->addRadio('relation_status', ts('Relationship Status'), $relStatusOption); $form->setDefaults(array('relation_status' => 0)); // relation permission - $relPermissionOption = array(ts('Any'), ts('Yes'), ts('No') ); + $relPermissionOption = array(ts('Any'), ts('Yes'), ts('No')); $form->addRadio('relation_permission', ts('Permissioned Relationship?'), $relPermissionOption); $form->setDefaults(array('relation_permission' => 0)); @@ -487,7 +487,7 @@ class CRM_Contact_Form_Search_Criteria { // radio button for is_deceased - $form->addYesNo( 'is_deceased', ts('Deceased'), TRUE); + $form->addYesNo('is_deceased', ts('Deceased'), TRUE); } /** diff --git a/CRM/Contact/Form/Search/Custom.php b/CRM/Contact/Form/Search/Custom.php index d2299822b2..d56354eb14 100644 --- a/CRM/Contact/Form/Search/Custom.php +++ b/CRM/Contact/Form/Search/Custom.php @@ -80,7 +80,7 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search { parent::preProcess(); // instantiate the new class - $this->_customClass = new $this->_customSearchClass( $this->_formValues ); + $this->_customClass = new $this->_customSearchClass($this->_formValues); // CRM-12747 if (isset($this->_customClass->_permissionedComponent) && diff --git a/CRM/Contact/Form/Search/Custom/FullText.php b/CRM/Contact/Form/Search/Custom/FullText.php index 17e4736ace..88d0cfcf6b 100644 --- a/CRM/Contact/Form/Search/Custom/FullText.php +++ b/CRM/Contact/Form/Search/Custom/FullText.php @@ -309,7 +309,7 @@ WHERE t.table_name = 'Activity' AND } } - $form->add('select', 'table', ts('Tables'), $tables ); + $form->add('select', 'table', ts('Tables'), $tables); $form->assign('csID', $form->get('csid')); diff --git a/CRM/Contact/Form/Search/Custom/Group.php b/CRM/Contact/Form/Search/Custom/Group.php index b3c2c46ca8..131c338a2f 100644 --- a/CRM/Contact/Form/Search/Custom/Group.php +++ b/CRM/Contact/Form/Search/Custom/Group.php @@ -161,7 +161,7 @@ class CRM_Contact_Form_Search_Custom_Group * @return array */ public function setDefaultValues() { - $defaults = array( 'andOr' => '1' ); + $defaults = array('andOr' => '1'); if (!empty($this->_formValues)) { $defaults['andOr'] = CRM_Utils_Array::value('andOr', $this->_formValues, '1'); diff --git a/CRM/Contact/Form/Task/Label.php b/CRM/Contact/Form/Task/Label.php index c911e0d925..b2c55bc5bb 100644 --- a/CRM/Contact/Form/Task/Label.php +++ b/CRM/Contact/Form/Task/Label.php @@ -278,8 +278,8 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task { $valuesothers = CRM_Core_BAO_Location::getValues($paramsothers, $valuesothers); if (!empty($fv['location_type_id'])) { foreach ($valuesothers as $vals) { - if ( CRM_Utils_Array::value('location_type_id', $vals) == - CRM_Utils_Array::value('location_type_id', $fv ) ) { + if (CRM_Utils_Array::value('location_type_id', $vals) == + CRM_Utils_Array::value('location_type_id', $fv)) { foreach ($vals as $k => $v) { if (in_array($k, array( 'email', 'phone', 'im', 'openid'))) { diff --git a/CRM/Contact/Form/Task/LabelCommon.php b/CRM/Contact/Form/Task/LabelCommon.php index df451d8a94..121b17dd51 100644 --- a/CRM/Contact/Form/Task/LabelCommon.php +++ b/CRM/Contact/Form/Task/LabelCommon.php @@ -202,7 +202,7 @@ class CRM_Contact_Form_Task_LabelCommon { $valuesothers = CRM_Core_BAO_Location::getValues($paramsothers, $valuesothers); if ($locationTypeID) { foreach ($valuesothers as $vals) { - if ( CRM_Utils_Array::value('location_type_id', $vals) == + if (CRM_Utils_Array::value('location_type_id', $vals) == $locationTypeID) { foreach ($vals as $k => $v) { if (in_array($k, array( diff --git a/CRM/Contact/Form/Task/Print.php b/CRM/Contact/Form/Task/Print.php index f724d160c7..75428d14a8 100644 --- a/CRM/Contact/Form/Task/Print.php +++ b/CRM/Contact/Form/Task/Print.php @@ -85,7 +85,7 @@ class CRM_Contact_Form_Task_Print extends CRM_Contact_Form_Task { $returnP = isset($returnPropeties) ? $returnPropeties : ""; $customSearchClass = $this->get('customSearchClass'); - $selector = new $selectorName( $customSearchClass, + $selector = new $selectorName($customSearchClass, $fv, $params, $returnP, diff --git a/CRM/Contact/Form/Task/SaveSearch.php b/CRM/Contact/Form/Task/SaveSearch.php index 179b6cb59c..ee5150566c 100644 --- a/CRM/Contact/Form/Task/SaveSearch.php +++ b/CRM/Contact/Form/Task/SaveSearch.php @@ -222,7 +222,7 @@ class CRM_Contact_Form_Task_SaveSearch extends CRM_Contact_Form_Task { $this->_id = $savedSearch->id; //CRM-14190 - if ( !empty($formValues['parents']) ) { + if (!empty($formValues['parents'])) { CRM_Contact_BAO_GroupNestingCache::update(); } } diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index 38ff171c7c..5a88617e37 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -137,7 +137,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { $this->_dataSourceClassFile = str_replace('_', '/', $this->_dataSource) . ".php"; require_once $this->_dataSourceClassFile; $this->_dataSourceClass = new $this->_dataSource; - $this->_dataSourceClass->buildQuickForm( $this ); + $this->_dataSourceClass->buildQuickForm($this); } // Get list of data sources and display them as options @@ -336,7 +336,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { $this->_params['import_table_name'] = 'civicrm_import_job_' . md5(uniqid(rand(), TRUE)); } - $this->_dataSourceClass->postProcess( $this->_params, $db, $this ); + $this->_dataSourceClass->postProcess($this->_params, $db, $this); // We should have the data in the DB now, parse it $importTableName = $this->get('importTableName'); diff --git a/CRM/Contact/Page/Inline/Address.php b/CRM/Contact/Page/Inline/Address.php index 5871f917a3..18fb9a03ca 100644 --- a/CRM/Contact/Page/Inline/Address.php +++ b/CRM/Contact/Page/Inline/Address.php @@ -54,7 +54,7 @@ class CRM_Contact_Page_Inline_Address extends CRM_Core_Page { $addressId = CRM_Utils_Request::retrieve('aid', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, NULL, $_REQUEST); $address = array(); - if ( $addressId > 0 ) { + if ($addressId > 0) { $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array('labelColumn' => 'display_name')); $entityBlock = array('id' => $addressId); @@ -67,9 +67,9 @@ class CRM_Contact_Page_Inline_Address extends CRM_Core_Page { } // we just need current address block - $currentAddressBlock['address'][$locBlockNo] = array_pop( $address ); + $currentAddressBlock['address'][$locBlockNo] = array_pop($address); - if ( !empty( $currentAddressBlock['address'][$locBlockNo] ) ) { + if (!empty($currentAddressBlock['address'][$locBlockNo])) { // get contact name of shared contact names $sharedAddresses = array(); $shareAddressContactNames = CRM_Contact_BAO_Contact_Utils::getAddressShareContactNames($currentAddressBlock['address']); @@ -85,23 +85,23 @@ class CRM_Contact_Page_Inline_Address extends CRM_Core_Page { } // add custom data of type address - $groupTree = CRM_Core_BAO_CustomGroup::getTree( 'Address', + $groupTree = CRM_Core_BAO_CustomGroup::getTree('Address', $this, $currentAddressBlock['address'][$locBlockNo]['id'] ); // we setting the prefix to dnc_ below so that we don't overwrite smarty's grouptree var. - $currentAddressBlock['address'][$locBlockNo]['custom'] = CRM_Core_BAO_CustomGroup::buildCustomDataView( $this, $groupTree, FALSE, NULL, "dnc_"); + $currentAddressBlock['address'][$locBlockNo]['custom'] = CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree, FALSE, NULL, "dnc_"); $this->assign("dnc_viewCustomData", NULL); $this->assign('add', $currentAddressBlock['address'][$locBlockNo]); $this->assign('sharedAddresses', $sharedAddresses); } - $contact = new CRM_Contact_BAO_Contact( ); + $contact = new CRM_Contact_BAO_Contact(); $contact->id = $contactId; $contact->find(TRUE); $privacy = array(); - foreach ( CRM_Contact_BAO_Contact::$_commPrefs as $name ) { - if ( isset( $contact->$name ) ) { + foreach (CRM_Contact_BAO_Contact::$_commPrefs as $name) { + if (isset($contact->$name)) { $privacy[$name] = $contact->$name; } } diff --git a/CRM/Contact/Page/Inline/CommunicationPreferences.php b/CRM/Contact/Page/Inline/CommunicationPreferences.php index 2ee21d5870..f138987e35 100644 --- a/CRM/Contact/Page/Inline/CommunicationPreferences.php +++ b/CRM/Contact/Page/Inline/CommunicationPreferences.php @@ -54,7 +54,7 @@ class CRM_Contact_Page_Inline_CommunicationPreferences extends CRM_Core_Page { $params = array('id' => $contactId); $defaults = array(); - CRM_Contact_BAO_Contact::getValues( $params, $defaults ); + CRM_Contact_BAO_Contact::getValues($params, $defaults); $defaults['privacy_values'] = CRM_Core_SelectValues::privacy(); $communicationStyle = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'communication_style_id'); diff --git a/CRM/Contact/Page/Inline/ContactInfo.php b/CRM/Contact/Page/Inline/ContactInfo.php index c8aaf89729..44cd2c1385 100644 --- a/CRM/Contact/Page/Inline/ContactInfo.php +++ b/CRM/Contact/Page/Inline/ContactInfo.php @@ -54,7 +54,7 @@ class CRM_Contact_Page_Inline_ContactInfo extends CRM_Core_Page { $params = array('id' => $contactId); $defaults = array(); - CRM_Contact_BAO_Contact::getValues( $params, $defaults ); + CRM_Contact_BAO_Contact::getValues($params, $defaults); //get the current employer name if (CRM_Utils_Array::value('contact_type', $defaults) == 'Individual') { diff --git a/CRM/Contact/Page/Inline/Demographics.php b/CRM/Contact/Page/Inline/Demographics.php index f5fe3e1341..b213a36fea 100644 --- a/CRM/Contact/Page/Inline/Demographics.php +++ b/CRM/Contact/Page/Inline/Demographics.php @@ -54,7 +54,7 @@ class CRM_Contact_Page_Inline_Demographics extends CRM_Core_Page { $params = array('id' => $contactId); $defaults = array(); - CRM_Contact_BAO_Contact::getValues( $params, $defaults ); + CRM_Contact_BAO_Contact::getValues($params, $defaults); if (!empty($defaults['gender_id'])) { $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'); diff --git a/CRM/Contact/Page/Inline/Email.php b/CRM/Contact/Page/Inline/Email.php index 5176525c0d..f4ae51d7ba 100644 --- a/CRM/Contact/Page/Inline/Email.php +++ b/CRM/Contact/Page/Inline/Email.php @@ -61,12 +61,12 @@ class CRM_Contact_Page_Inline_Email extends CRM_Core_Page { } } - $contact = new CRM_Contact_BAO_Contact( ); + $contact = new CRM_Contact_BAO_Contact(); $contact->id = $contactId; $contact->find(TRUE); $privacy = array(); - foreach ( CRM_Contact_BAO_Contact::$_commPrefs as $name ) { - if ( isset( $contact->$name ) ) { + foreach (CRM_Contact_BAO_Contact::$_commPrefs as $name) { + if (isset($contact->$name)) { $privacy[$name] = $contact->$name; } } diff --git a/CRM/Contact/Page/Inline/Phone.php b/CRM/Contact/Page/Inline/Phone.php index 33c436fc02..73cd2fb8ac 100644 --- a/CRM/Contact/Page/Inline/Phone.php +++ b/CRM/Contact/Page/Inline/Phone.php @@ -63,12 +63,12 @@ class CRM_Contact_Page_Inline_Phone extends CRM_Core_Page { } } - $contact = new CRM_Contact_BAO_Contact( ); + $contact = new CRM_Contact_BAO_Contact(); $contact->id = $contactId; $contact->find(TRUE); $privacy = array(); - foreach ( CRM_Contact_BAO_Contact::$_commPrefs as $name ) { - if ( isset( $contact->$name ) ) { + foreach (CRM_Contact_BAO_Contact::$_commPrefs as $name) { + if (isset($contact->$name)) { $privacy[$name] = $contact->$name; } } diff --git a/CRM/Contact/Page/View.php b/CRM/Contact/Page/View.php index bfd3a63b63..3e10088eaa 100644 --- a/CRM/Contact/Page/View.php +++ b/CRM/Contact/Page/View.php @@ -104,7 +104,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page { } // ensure that the id does exist - if ( CRM_Core_DAO::getFieldValue( 'CRM_Contact_DAO_Contact', $this->_contactId, 'id' ) != $this->_contactId ) { + if (CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'id') != $this->_contactId) { CRM_Core_Error::statusBounce( ts('A Contact with that ID does not exist: %1', array(1 => $this->_contactId)), CRM_Utils_System::url('civicrm/dashboard', 'reset=1') diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index 7aa79b1b19..51eccdfa4f 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -188,7 +188,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { if (isset($value['customData'])) { foreach ($defaults[$key] as $blockId => $blockVal) { $idValue = $blockVal['id']; - if ( $key == 'address' ) { + if ($key == 'address') { if (!empty($blockVal['master_id'])) { $idValue = $blockVal['master_id']; } diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index 461dc334c4..4f6b911543 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -342,7 +342,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se 'contact_sub_type', 'sort_name', ); - foreach ( $doNotCareElements as $value) { + foreach ($doNotCareElements as $value) { unset($this->_returnProperties[$value]); } } @@ -841,7 +841,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se // check for current != previous to ensure cache is not reset if paging is done without changing // sort criteria - if (!$pageNum || (!empty($currentSortID) && $currentSortID != $previousSortID) ) { + if (!$pageNum || (!empty($currentSortID) && $currentSortID != $previousSortID)) { CRM_Core_BAO_PrevNextCache::deleteItem(NULL, $cacheKey, 'civicrm_contact'); // this means it's fresh search, so set pageNum=1 if (!$pageNum) { diff --git a/CRM/Contact/Selector/Custom.php b/CRM/Contact/Selector/Custom.php index 1bd4f4c1bc..6d955299af 100644 --- a/CRM/Contact/Selector/Custom.php +++ b/CRM/Contact/Selector/Custom.php @@ -146,7 +146,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { else { require_once str_replace('_', DIRECTORY_SEPARATOR, $customSearchClass) . '.php'; } - $this->_search = new $customSearchClass( $formValues ); + $this->_search = new $customSearchClass($formValues); } else { $fnName = $ext->keyToPath; diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index c4f75a232d..fe7119b8e1 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -526,7 +526,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) $transaction['trxn_id'] = md5(uniqid(rand(), TRUE)); } - if (!isset( $transaction['financial_type_id'])) { + if (!isset($transaction['financial_type_id'])) { $contributionTypes = array_keys(CRM_Contribute_PseudoConstant::financialType()); $transaction['financial_type_id'] = $contributionTypes[0]; } diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index 372f8fcc2c..3a8ea68695 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -238,7 +238,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio if ($gId) { $email = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $gId, 'notify'); if ($email) { - $val = CRM_Core_BAO_UFGroup::checkFieldsEmptyValues($gId, $contactID, CRM_Utils_Array::value($key, $params), TRUE ); + $val = CRM_Core_BAO_UFGroup::checkFieldsEmptyValues($gId, $contactID, CRM_Utils_Array::value($key, $params), TRUE); CRM_Core_BAO_UFGroup::commonSendMail($contactID, $val); } } @@ -402,7 +402,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio $sendTemplateParams['cc'] = CRM_Utils_Array::value('cc_receipt', $values); $sendTemplateParams['bcc'] = CRM_Utils_Array::value('bcc_receipt', $values); //send email with pdf invoice - $template = CRM_Core_Smarty::singleton( ); + $template = CRM_Core_Smarty::singleton(); $taxAmt = $template->get_template_vars('dataArray'); $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings'); $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue); diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 06f22fceac..fabb0ed330 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -1095,7 +1095,7 @@ class CRM_Contribute_BAO_Query { // Add batch select $batches = CRM_Contribute_PseudoConstant::batch(); - if ( !empty( $batches ) ) { + if (!empty($batches)) { $form->add('select', 'contribution_batch_id', ts('Batch Name'), array('' => ts('- any -')) + $batches, diff --git a/CRM/Contribute/Form.php b/CRM/Contribute/Form.php index b8a4dee7fd..a3194669f1 100644 --- a/CRM/Contribute/Form.php +++ b/CRM/Contribute/Form.php @@ -51,7 +51,7 @@ class CRM_Contribute_Form extends CRM_Admin_Form { if (isset($this->_id)) { $params = array('id' => $this->_id); - if (!empty( $this->_BAOName)) { + if (!empty($this->_BAOName)) { $baoName = $this->_BAOName; $baoName::retrieve($params, $defaults); } diff --git a/CRM/Contribute/Form/AdditionalInfo.php b/CRM/Contribute/Form/AdditionalInfo.php index b2cfb7da5b..e45757fb63 100644 --- a/CRM/Contribute/Form/AdditionalInfo.php +++ b/CRM/Contribute/Form/AdditionalInfo.php @@ -481,7 +481,7 @@ class CRM_Contribute_Form_AdditionalInfo { $form->assign('receive_date', CRM_Utils_Date::processDate($params['receive_date'])); } - $template = CRM_Core_Smarty::singleton( ); + $template = CRM_Core_Smarty::singleton(); $taxAmt = $template->get_template_vars('dataArray'); $eventTaxAmt = $template->get_template_vars('totalTaxAmount'); $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings'); diff --git a/CRM/Contribute/Form/AdditionalPayment.php b/CRM/Contribute/Form/AdditionalPayment.php index 973f557efb..2267a54c77 100644 --- a/CRM/Contribute/Form/AdditionalPayment.php +++ b/CRM/Contribute/Form/AdditionalPayment.php @@ -163,7 +163,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract if ($this->_view == 'transaction' && ($this->_action & CRM_Core_Action::BROWSE)) { return; } - $defaults = array( ); + $defaults = array(); if ($this->_mode) { $defaults = $this->_values; diff --git a/CRM/Contribute/Form/CancelSubscription.php b/CRM/Contribute/Form/CancelSubscription.php index 4330dc7458..3de3847f04 100644 --- a/CRM/Contribute/Form/CancelSubscription.php +++ b/CRM/Contribute/Form/CancelSubscription.php @@ -163,7 +163,7 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form { } $type = 'next'; - if ( $this->_selfService ) { + if ($this->_selfService) { $type = 'submit'; } @@ -323,7 +323,7 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form { $session = CRM_Core_Session::singleton(); $userID = $session->get('userID'); - if ( $userID && $status) { + if ($userID && $status) { $session->setStatus($status, $msgTitle, $msgType); } elseif (!$userID) { diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 14754dae39..0019c2bd0e 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -1501,7 +1501,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP } //store contribution ID if not yet set (on create) - if ( empty($this->_id) && !empty($contribution->id) ) { + if (empty($this->_id) && !empty($contribution->id)) { $this->_id = $contribution->id; } } diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index e0b6786562..4cacae0c13 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -592,7 +592,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu //when multiple payment processor as the user //can toggle with payment processor selection $billingModePaymentProcessors = 0; - if ( !empty( $this->_paymentProcessors ) ) { + if (!empty($this->_paymentProcessors)) { foreach ($this->_paymentProcessors as $key => $values) { if ($values['billing_mode'] == CRM_Core_Payment::BILLING_MODE_BUTTON) { $billingModePaymentProcessors++; @@ -765,7 +765,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu if ($self->_quickConfig && ($priceField->name == 'contribution_amount' || $priceField->name == 'membership_amount')) { $previousId = $priceField->id; - if ($priceField->name == 'membership_amount' && !$priceField->is_active ) { + if ($priceField->name == 'membership_amount' && !$priceField->is_active) { $membershipIsActive = FALSE; } } @@ -1259,14 +1259,14 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu if ($priceSetId = CRM_Utils_Array::value('priceSetId', $params)) { $lineItem = array(); - $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config' ); - if ( $is_quick_config ) { - foreach ( $this->_values['fee'] as $key => & $val ) { - if ( $val['name'] == 'other_amount' && $val['html_type'] == 'Text' && array_key_exists( 'price_'.$key, $params ) ) { + $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config'); + if ($is_quick_config) { + foreach ($this->_values['fee'] as $key => & $val) { + if ($val['name'] == 'other_amount' && $val['html_type'] == 'Text' && array_key_exists('price_'.$key, $params) ) { $params['price_'.$key] = CRM_Utils_Rule::cleanMoney($params['price_'.$key]); //Clean out any currency symbols - if ( $params['price_'.$key] != 0 ) { - foreach ( $val['options'] as $optionKey => & $options ) { - $options['amount'] = CRM_Utils_Array::value( 'price_'.$key, $params ); + if ($params['price_'.$key] != 0) { + foreach ($val['options'] as $optionKey => & $options) { + $options['amount'] = CRM_Utils_Array::value('price_'.$key, $params); break; } } diff --git a/CRM/Contribute/Form/Contribution/ThankYou.php b/CRM/Contribute/Form/Contribution/ThankYou.php index ba3d69cd8e..15637dd705 100644 --- a/CRM/Contribute/Form/Contribution/ThankYou.php +++ b/CRM/Contribute/Form/Contribution/ThankYou.php @@ -161,7 +161,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont } } - $this->assign( 'qParams', $qParams ); + $this->assign('qParams', $qParams); if ($membershipTypeID) { $transactionID = $this->get('membership_trx_id'); diff --git a/CRM/Contribute/Form/ContributionPage/AddProduct.php b/CRM/Contribute/Form/ContributionPage/AddProduct.php index 60b71ace50..53e781accd 100644 --- a/CRM/Contribute/Form/ContributionPage/AddProduct.php +++ b/CRM/Contribute/Form/ContributionPage/AddProduct.php @@ -168,7 +168,7 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For $this->addElement('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_PremiumsProduct', 'weight')); - $financialType = CRM_Contribute_PseudoConstant::financialType( ); + $financialType = CRM_Contribute_PseudoConstant::financialType(); $premiumFinancialType = array(); CRM_Core_PseudoConstant::populate( $premiumFinancialType, @@ -189,18 +189,18 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For 'account_relationship = 7' ); $productFinancialType = array_intersect($costFinancialType, $premiumFinancialType); - foreach ($financialType as $key => $financialTypeName ) { - if (!in_array( $key, $productFinancialType)) { - unset( $financialType[$key] ); + foreach ($financialType as $key => $financialTypeName) { + if (!in_array($key, $productFinancialType)) { + unset($financialType[$key]); } } - if (count( $financialType ) ) { - $this->assign( 'financialType', $financialType ); + if (count($financialType)) { + $this->assign('financialType', $financialType); } $this->add( 'select', 'financial_type_id', - ts( 'Financial Type' ), + ts('Financial Type'), array('' => ts('- select -')) + $financialType ); $this->addRule('weight', ts('Please enter integer value for weight'), 'integer'); diff --git a/CRM/Contribute/Form/ContributionPage/Amount.php b/CRM/Contribute/Form/ContributionPage/Amount.php index 438125c44d..f33dc4e93d 100644 --- a/CRM/Contribute/Form/ContributionPage/Amount.php +++ b/CRM/Contribute/Form/ContributionPage/Amount.php @@ -685,7 +685,7 @@ SELECT id CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceFieldValue', $priceFieldValueID, 'label', $params['amount_label']); } else { - CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceField', $priceFieldID, 'is_required', 0 ); + CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceField', $priceFieldID, 'is_required', 0); CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceFieldValue', $priceFieldValueID, 'label', 'Other Amount'); } } @@ -743,7 +743,7 @@ SELECT id CRM_Price_BAO_PriceSet::removeFrom('civicrm_contribution_page', $contributionPageID); } - if ($deleteAmountBlk ) { + if ($deleteAmountBlk) { $priceField = !empty($params['price_field_id']) ? $params['price_field_id'] : CRM_Utils_Array::value('price_field_other', $params); if ($priceField) { $priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $priceField, 'price_set_id'); diff --git a/CRM/Contribute/Form/ContributionPage/Settings.php b/CRM/Contribute/Form/ContributionPage/Settings.php index 8b5e7dc436..461ba5fd63 100644 --- a/CRM/Contribute/Form/ContributionPage/Settings.php +++ b/CRM/Contribute/Form/ContributionPage/Settings.php @@ -232,7 +232,7 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_ // ensure on-behalf-of profile meets minimum requirements if (!empty($values['is_organization'])) { - if (empty($values['onbehalf_profile_id']) ) { + if (empty($values['onbehalf_profile_id'])) { $errors['onbehalf_profile_id'] = ts('Please select a profile to collect organization information on this contribution page.'); } else { diff --git a/CRM/Contribute/Form/ManagePremiums.php b/CRM/Contribute/Form/ManagePremiums.php index 2cf4195a7b..813052315a 100644 --- a/CRM/Contribute/Form/ManagePremiums.php +++ b/CRM/Contribute/Form/ManagePremiums.php @@ -90,7 +90,7 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form { * @return void */ public function buildQuickForm() { - parent::buildQuickForm( ); + parent::buildQuickForm(); $this->setPageTitle(ts('Premium Product')); if ($this->_action & CRM_Core_Action::PREVIEW) { @@ -146,7 +146,7 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form { $this->add('text', 'frequency_interval', ts('Frequency'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'frequency_interval')); //Financial Type CRM-11106 - $financialType = CRM_Contribute_PseudoConstant::financialType( ); + $financialType = CRM_Contribute_PseudoConstant::financialType(); $premiumFinancialType = array(); CRM_Core_PseudoConstant::populate( $premiumFinancialType, @@ -167,18 +167,18 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form { 'account_relationship = 7' ); $productFinancialType = array_intersect($costFinancialType, $premiumFinancialType); - foreach ($financialType as $key => $financialTypeName ) { - if (!in_array( $key, $productFinancialType)) { - unset( $financialType[$key] ); + foreach ($financialType as $key => $financialTypeName) { + if (!in_array($key, $productFinancialType)) { + unset($financialType[$key]); } } - if (count( $financialType ) ) { - $this->assign( 'financialType', $financialType ); + if (count($financialType)) { + $this->assign('financialType', $financialType); } $this->add( 'select', 'financial_type_id', - ts( 'Financial Type' ), + ts('Financial Type'), array('' => ts('- select -')) + $financialType ); diff --git a/CRM/Contribute/Form/SearchContribution.php b/CRM/Contribute/Form/SearchContribution.php index df72a0e2b7..a822ea569e 100644 --- a/CRM/Contribute/Form/SearchContribution.php +++ b/CRM/Contribute/Form/SearchContribution.php @@ -46,7 +46,7 @@ class CRM_Contribute_Form_SearchContribution extends CRM_Core_Form { $this->add('text', 'title', ts('Find'), $attributes); - $financial_account = CRM_Contribute_PseudoConstant::financialType( ); + $financial_account = CRM_Contribute_PseudoConstant::financialType(); foreach ($financial_account as $contributionId => $contributionName) { $this->addElement('checkbox', "financial_type_id[$contributionId]", 'Financial Type', $contributionName); } @@ -67,7 +67,7 @@ class CRM_Contribute_Form_SearchContribution extends CRM_Core_Form { $parent = $this->controller->getParent(); $parent->set('searchResult', 1); if (!empty($params)) { - $fields = array( 'title', 'financial_type_id', 'campaign_id' ); + $fields = array('title', 'financial_type_id', 'campaign_id'); foreach ($fields as $field) { if (isset($params[$field]) && !CRM_Utils_System::isNull($params[$field]) diff --git a/CRM/Contribute/Form/Task.php b/CRM/Contribute/Form/Task.php index 2e5e73c6d3..2fd0a3565f 100644 --- a/CRM/Contribute/Form/Task.php +++ b/CRM/Contribute/Form/Task.php @@ -123,8 +123,8 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form { else { $queryParams = $form->get('queryParams'); $sortOrder = NULL; - if ( $form->get( CRM_Utils_Sort::SORT_ORDER ) ) { - $sortOrder = $form->get( CRM_Utils_Sort::SORT_ORDER ); + if ($form->get(CRM_Utils_Sort::SORT_ORDER )) { + $sortOrder = $form->get(CRM_Utils_Sort::SORT_ORDER); } $form->_includesSoftCredits = CRM_Contribute_BAO_Query::isSoftCreditOptionEnabled($queryParams); diff --git a/CRM/Contribute/Form/Task/PDFLetter.php b/CRM/Contribute/Form/Task/PDFLetter.php index 08ceac1d9f..7f8d3bae4e 100644 --- a/CRM/Contribute/Form/Task/PDFLetter.php +++ b/CRM/Contribute/Form/Task/PDFLetter.php @@ -132,7 +132,7 @@ class CRM_Contribute_Form_Task_PDFLetter extends CRM_Contribute_Form_Task { ); $this->addElement('select', 'group_by', ts('Group contributions by'), $options, array(), "
", FALSE); // this was going to be free-text but I opted for radio options in case there was a script injection risk - $separatorOptions = array('comma' => 'Comma', 'td' => 'Table Cell' ); + $separatorOptions = array('comma' => 'Comma', 'td' => 'Table Cell'); $this->addElement('select', 'group_by_separator', ts('Separator (grouped contributions)'), $separatorOptions); $emailOptions = array( '' => ts('Generate PDFs for printing (only)'), diff --git a/CRM/Contribute/Form/UpdateBilling.php b/CRM/Contribute/Form/UpdateBilling.php index 8a84c63f7d..c412f07b23 100644 --- a/CRM/Contribute/Form/UpdateBilling.php +++ b/CRM/Contribute/Form/UpdateBilling.php @@ -190,7 +190,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { */ public function buildQuickForm() { $type = 'next'; - if ( $this->_selfService ) { + if ($this->_selfService) { $type = 'submit'; } @@ -420,7 +420,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { $session = CRM_Core_Session::singleton(); $userID = $session->get('userID'); - if ( $userID && $status) { + if ($userID && $status) { $session->setStatus($status, $msgTitle, $msgType); } elseif (!$userID) { diff --git a/CRM/Contribute/Form/UpdateSubscription.php b/CRM/Contribute/Form/UpdateSubscription.php index 847d862899..1ab480f7f1 100644 --- a/CRM/Contribute/Form/UpdateSubscription.php +++ b/CRM/Contribute/Form/UpdateSubscription.php @@ -104,7 +104,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form { if (!$this->_paymentProcessorObj->isSupported('changeSubscriptionAmount')) { $userAlert = "" . ts('Updates made using this form will change the recurring contribution information stored in your CiviCRM database, but will NOT be sent to the payment processor. You must enter the same changes using the payment processor web site.', - array( 1 => $this->_paymentProcessorObj->_processorName ) ) . ''; + array(1 => $this->_paymentProcessorObj->_processorName)) . ''; CRM_Core_Session::setStatus($userAlert, ts('Warning'), 'alert'); } @@ -160,7 +160,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form { } $type = 'next'; - if ( $this->_selfService ) { + if ($this->_selfService) { $type = 'submit'; } @@ -306,7 +306,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form { $session = CRM_Core_Session::singleton(); $userID = $session->get('userID'); - if ( $userID && $status) { + if ($userID && $status) { CRM_Core_Session::setStatus($status, $msgTitle, $msgType); } elseif (!$userID) { diff --git a/CRM/Contribute/Page/ContributionPage.php b/CRM/Contribute/Page/ContributionPage.php index ae80cd90df..97911f9a15 100644 --- a/CRM/Contribute/Page/ContributionPage.php +++ b/CRM/Contribute/Page/ContributionPage.php @@ -582,7 +582,7 @@ ORDER BY title asc } } - $value = $this->get( 'financial_type_id' ); + $value = $this->get('financial_type_id'); $val = array(); if ($value) { if (is_array($value)) { diff --git a/CRM/Contribute/Page/ManagePremiums.php b/CRM/Contribute/Page/ManagePremiums.php index 1f3f9aa8b2..698cf559b1 100644 --- a/CRM/Contribute/Page/ManagePremiums.php +++ b/CRM/Contribute/Page/ManagePremiums.php @@ -170,9 +170,9 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic { $dao->id ); //Financial Type - if (!empty( $dao->financial_type_id ) ) { + if (!empty($dao->financial_type_id) ) { require_once 'CRM/Core/DAO.php'; - $premiums[$dao->id]['financial_type_id'] = CRM_Core_DAO::getFieldValue( 'CRM_Financial_DAO_FinancialType', $dao->financial_type_id, 'name' ); + $premiums[$dao->id]['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $dao->financial_type_id, 'name'); } } $this->assign('rows', $premiums); diff --git a/CRM/Contribute/Page/Premium.php b/CRM/Contribute/Page/Premium.php index c82aa0ad01..ef361e6eef 100644 --- a/CRM/Contribute/Page/Premium.php +++ b/CRM/Contribute/Page/Premium.php @@ -173,7 +173,7 @@ class CRM_Contribute_Page_Premium extends CRM_Core_Page_Basic { ); //Financial Type if (!empty($dao->financial_type_id)) { - $premiums[$productDAO->id]['financial_type_id'] = CRM_Core_DAO::getFieldValue( 'CRM_Financial_DAO_FinancialType', $dao->financial_type_id, 'name' ); + $premiums[$productDAO->id]['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $dao->financial_type_id, 'name'); } } } diff --git a/CRM/Contribute/Page/SubscriptionStatus.php b/CRM/Contribute/Page/SubscriptionStatus.php index 98bdd06180..da9f814c6e 100644 --- a/CRM/Contribute/Page/SubscriptionStatus.php +++ b/CRM/Contribute/Page/SubscriptionStatus.php @@ -48,10 +48,10 @@ class CRM_Contribute_Page_SubscriptionStatus extends CRM_Core_Page { $this->assign('task', $task); $this->assign('result', $result); - if ( $task == 'billing' ) { + if ($task == 'billing') { $session = CRM_Core_Session::singleton(); $tplParams = $session->get('resultParams'); - foreach ( $tplParams as $key => $val ) { + foreach ($tplParams as $key => $val) { $this->assign($key, $val); } } diff --git a/CRM/Contribute/Page/Tab.php b/CRM/Contribute/Page/Tab.php index 608cbb55c8..670aa667e5 100644 --- a/CRM/Contribute/Page/Tab.php +++ b/CRM/Contribute/Page/Tab.php @@ -83,12 +83,12 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { if ($recurID) { $paymentProcessorObj = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($recurID, 'recur', 'obj'); - if (is_object( $paymentProcessorObj) && $paymentProcessorObj->isSupported('cancelSubscription')) { + if (is_object($paymentProcessorObj) && $paymentProcessorObj->isSupported('cancelSubscription')) { unset(self::$_links[CRM_Core_Action::DISABLE]['extra'], self::$_links[CRM_Core_Action::DISABLE]['ref']); self::$_links[CRM_Core_Action::DISABLE]['url'] = "civicrm/contribute/unsubscribe"; self::$_links[CRM_Core_Action::DISABLE]['qs'] = "reset=1&crid=%%crid%%&cid=%%cid%%&context={$context}"; } - if (is_object( $paymentProcessorObj) && $paymentProcessorObj->isSupported('updateSubscriptionBillingInfo')) { + if (is_object($paymentProcessorObj) && $paymentProcessorObj->isSupported('updateSubscriptionBillingInfo')) { self::$_links[CRM_Core_Action::RENEW] = array( 'name' => ts('Change Billing Details'), 'title' => ts('Change Billing Details'), diff --git a/CRM/Contribute/Task.php b/CRM/Contribute/Task.php index f2855036c7..663977f547 100644 --- a/CRM/Contribute/Task.php +++ b/CRM/Contribute/Task.php @@ -125,7 +125,7 @@ class CRM_Contribute_Task { unset(self::$_tasks[1]); } //CRM-12920 - check for edit permission - if (!CRM_Core_Permission::check('edit contributions') ) { + if (!CRM_Core_Permission::check('edit contributions')) { unset(self::$_tasks[4], self::$_tasks[6]); } diff --git a/CRM/Core/BAO/ActionSchedule.php b/CRM/Core/BAO/ActionSchedule.php index 5f3c281023..17de29d0b3 100644 --- a/CRM/Core/BAO/ActionSchedule.php +++ b/CRM/Core/BAO/ActionSchedule.php @@ -229,7 +229,7 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule { if ($kkey) { $auto = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $kkey, 'auto_renew'); } - if ( $auto ) { + if ($auto) { $vval = $statusLabel + $autoRenew; } else { @@ -1057,11 +1057,11 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL $contactField = 'e.contact_id'; $table = 'civicrm_membership e'; // build where clause - if ( $status == 2 ) { + if ($status == 2) { //auto-renew memberships $where[] = "e.contribution_recur_id IS NOT NULL "; } - elseif ( $status == 1 ) { + elseif ($status == 1) { $where[] = "e.contribution_recur_id IS NULL "; } diff --git a/CRM/Core/BAO/Block.php b/CRM/Core/BAO/Block.php index 23a2e22678..dcffc8bd93 100644 --- a/CRM/Core/BAO/Block.php +++ b/CRM/Core/BAO/Block.php @@ -64,7 +64,7 @@ class CRM_Core_BAO_Block { return NULL; } $BAOString = 'CRM_Core_BAO_' . $blockName; - $block = new $BAOString( ); + $block = new $BAOString(); $blocks = array(); if (!isset($params['entity_table'])) { @@ -83,7 +83,7 @@ class CRM_Core_BAO_Block { $count = 1; foreach ($blockIds as $blockId) { - $block = new $BAOString( ); + $block = new $BAOString(); $block->id = $blockId['id']; $getBlocks = self::retrieveBlock($block, $blockName); $blocks[$count++] = array_pop($getBlocks); @@ -199,11 +199,11 @@ class CRM_Core_BAO_Block { // e.g $bao = new $baoString; // $bao->getAllBlocks() $baoFunction = 'all' . $name . 's'; - $allBlocks = $baoString::$baoFunction( $contactId, $updateBlankLocInfo ); + $allBlocks = $baoString::$baoFunction($contactId, $updateBlankLocInfo); } elseif (!empty($entityElements) && $blockName != 'openid') { $baoFunction = 'allEntity' . $name . 's'; - $allBlocks = $baoString::$baoFunction( $entityElements ); + $allBlocks = $baoString::$baoFunction($entityElements); } return $allBlocks; @@ -275,7 +275,7 @@ class CRM_Core_BAO_Block { } if ($resetPrimaryId) { $baoString = 'CRM_Core_BAO_' . $blockName; - $block = new $baoString( ); + $block = new $baoString(); $block->selectAdd(); $block->selectAdd("id, is_primary"); $block->id = $resetPrimaryId; @@ -375,7 +375,7 @@ class CRM_Core_BAO_Block { $blockFields = array_merge($value, $contactFields); $baoString = 'CRM_Core_BAO_' . $name; - $blocks[] = $baoString::add( $blockFields ); + $blocks[] = $baoString::add($blockFields); } // we need to delete blocks that were deleted during update @@ -412,7 +412,7 @@ class CRM_Core_BAO_Block { } $baoString = 'CRM_Core_DAO_' . $name; - $block = new $baoString( ); + $block = new $baoString(); $block->copyValues($params); /* @@ -491,7 +491,7 @@ class CRM_Core_BAO_Block { * is_primary to 1 * CRM-10451 */ - if ( $existingEntities->N == 1 && $existingEntities->id == CRM_Utils_Array::value( 'id', $params ) ) { + if ($existingEntities->N == 1 && $existingEntities->id == CRM_Utils_Array::value('id', $params)) { $params['is_primary'] = 1; return; } diff --git a/CRM/Core/BAO/CustomQuery.php b/CRM/Core/BAO/CustomQuery.php index b36e4daf0a..d6433e956f 100644 --- a/CRM/Core/BAO/CustomQuery.php +++ b/CRM/Core/BAO/CustomQuery.php @@ -533,7 +533,7 @@ SELECT label, value break; case 'File': - if ( $op == 'IS NULL' || $op == 'IS NOT NULL' || $op == 'IS EMPTY' || $op == 'IS NOT EMPTY' ) { + if ($op == 'IS NULL' || $op == 'IS NOT NULL' || $op == 'IS EMPTY' || $op == 'IS NOT EMPTY') { switch ($op) { case 'IS EMPTY': $op = 'IS NULL'; diff --git a/CRM/Core/BAO/Discount.php b/CRM/Core/BAO/Discount.php index 770fe2850f..c474aa5107 100644 --- a/CRM/Core/BAO/Discount.php +++ b/CRM/Core/BAO/Discount.php @@ -52,7 +52,7 @@ class CRM_Core_BAO_Discount extends CRM_Core_DAO_Discount { */ public static function del($entityId, $entityTable) { // delete all discount records with the selected discounted id - $discount = new CRM_Core_DAO_Discount( ); + $discount = new CRM_Core_DAO_Discount(); $discount->entity_id = $entityId; $discount->entity_table = $entityTable; if ($discount->delete()) { @@ -74,7 +74,7 @@ class CRM_Core_BAO_Discount extends CRM_Core_DAO_Discount { * @static */ public static function add(&$params) { - $discount = new CRM_Core_DAO_Discount( ); + $discount = new CRM_Core_DAO_Discount(); $discount->copyValues($params); $discount->save(); return $discount; @@ -94,7 +94,7 @@ class CRM_Core_BAO_Discount extends CRM_Core_DAO_Discount { */ public static function getOptionGroup($entityId, $entityTable) { $optionGroupIDs = array(); - $dao = new CRM_Core_DAO_Discount( ); + $dao = new CRM_Core_DAO_Discount(); $dao->entity_id = $entityId; $dao->entity_table = $entityTable; $dao->find(); @@ -122,7 +122,7 @@ class CRM_Core_BAO_Discount extends CRM_Core_DAO_Discount { return NULL; } - $dao = new CRM_Core_DAO_Discount( ); + $dao = new CRM_Core_DAO_Discount(); $dao->entity_id = $entityID; $dao->entity_table = $entityTable; $dao->find(); diff --git a/CRM/Core/BAO/FinancialTrxn.php b/CRM/Core/BAO/FinancialTrxn.php index c885df5530..ce87300849 100644 --- a/CRM/Core/BAO/FinancialTrxn.php +++ b/CRM/Core/BAO/FinancialTrxn.php @@ -58,7 +58,7 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { * @return CRM_Core_BAO_FinancialTrxn object * @static */ - public static function create(&$params, $trxnEntityTable = null ) { + public static function create(&$params, $trxnEntityTable = null) { $trxn = new CRM_Financial_DAO_FinancialTrxn(); $trxn->copyValues($params); $fids = array(); @@ -130,11 +130,11 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { * @return CRM_Contribute_BAO_ContributionType object * @static */ - public static function retrieve( &$params, &$defaults ) { - $financialItem = new CRM_Financial_DAO_FinancialTrxn( ); + public static function retrieve(&$params, &$defaults) { + $financialItem = new CRM_Financial_DAO_FinancialTrxn(); $financialItem->copyValues($params); if ($financialItem->find(true)) { - CRM_Core_DAO::storeValues( $financialItem, $defaults ); + CRM_Core_DAO::storeValues($financialItem, $defaults); return $financialItem; } return null; diff --git a/CRM/Core/BAO/Job.php b/CRM/Core/BAO/Job.php index f368db54db..1aad25f0c9 100644 --- a/CRM/Core/BAO/Job.php +++ b/CRM/Core/BAO/Job.php @@ -135,7 +135,7 @@ class CRM_Core_BAO_Job extends CRM_Core_DAO_Job { $query = 'SELECT COUNT(*) FROM civicrm_job_log'; $count = CRM_Core_DAO::singleValueQuery($query); - if ( $count <= $maxEntriesToKeep) { + if ($count <= $maxEntriesToKeep) { return; } diff --git a/CRM/Core/BAO/Location.php b/CRM/Core/BAO/Location.php index 541c301b1e..7eb55cd0d8 100644 --- a/CRM/Core/BAO/Location.php +++ b/CRM/Core/BAO/Location.php @@ -66,7 +66,7 @@ class CRM_Core_BAO_Location extends CRM_Core_DAO { // create location blocks. foreach (self::$blocks as $block) { if ($block != 'address') { - $location[$block] = CRM_Core_BAO_Block::create( $block, $params, $entity ); + $location[$block] = CRM_Core_BAO_Block::create($block, $params, $entity); } else { $location[$block] = CRM_Core_BAO_Address::create($params, $fixAddress, $entity); diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index 9670fd100c..d148cf0cbe 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -377,8 +377,8 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { if (array_key_exists('note', $fields['Contact'])) { $noteTitle = $fields['Contact']['note']['title']; $fields['Contact']['note']['title'] = $noteTitle . ': ' . ts('Body and Subject'); - $fields['Contact']['note_body'] = array( 'title' => $noteTitle . ': ' . ts('Body Only'), 'name' => 'note_body' ); - $fields['Contact']['note_subject'] = array( 'title' => $noteTitle . ': ' . ts('Subject Only'), 'name' => 'note_subject' ); + $fields['Contact']['note_body'] = array('title' => $noteTitle . ': ' . ts('Body Only'), 'name' => 'note_body'); + $fields['Contact']['note_subject'] = array('title' => $noteTitle . ': ' . ts('Subject Only'), 'name' => 'note_subject'); } } diff --git a/CRM/Core/BAO/MessageTemplate.php b/CRM/Core/BAO/MessageTemplate.php index 938aea66b0..d7d27dac89 100644 --- a/CRM/Core/BAO/MessageTemplate.php +++ b/CRM/Core/BAO/MessageTemplate.php @@ -208,7 +208,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { null, null, false, $tokens, 'CRM_Core_BAO_MessageTemplate'); - $contact = reset( $details ); + $contact = reset($details); // call token hook $hookTokens = array(); diff --git a/CRM/Core/BAO/Navigation.php b/CRM/Core/BAO/Navigation.php index 9dec705973..a012d72d94 100644 --- a/CRM/Core/BAO/Navigation.php +++ b/CRM/Core/BAO/Navigation.php @@ -96,7 +96,7 @@ class CRM_Core_BAO_Navigation extends CRM_Core_DAO_Navigation { $params['has_separator'] = CRM_Utils_Array::value('has_separator', $params, FALSE); if (!isset($params['id']) || - (CRM_Utils_Array::value( 'parent_id', $params ) != CRM_Utils_Array::value('current_parent_id', $params)) + (CRM_Utils_Array::value('parent_id', $params) != CRM_Utils_Array::value('current_parent_id', $params)) ) { /* re/calculate the weight, if the Parent ID changed OR create new menu */ @@ -741,7 +741,7 @@ ORDER BY parent_id, weight"; $incrementOtherNodes = true; $sql = "SELECT weight from civicrm_navigation WHERE {$parentClause} ORDER BY weight LIMIT %1, 1"; - $params = array(1 => array( $position, 'Positive')); + $params = array(1 => array($position, 'Positive')); $newWeight = CRM_Core_DAO::singleValueQuery($sql, $params); // this means node is moved to last position, so you need to get the weight of last element + 1 @@ -761,7 +761,7 @@ ORDER BY parent_id, weight"; $transaction = new CRM_Core_Transaction(); // now update the existing nodes to weight + 1, if required. - if ( $incrementOtherNodes ) { + if ($incrementOtherNodes) { $query = "UPDATE civicrm_navigation SET weight = weight + 1 WHERE {$parentClause} AND weight >= {$newWeight}"; diff --git a/CRM/Core/BAO/PrevNextCache.php b/CRM/Core/BAO/PrevNextCache.php index fe80b9dfb2..5cef089046 100644 --- a/CRM/Core/BAO/PrevNextCache.php +++ b/CRM/Core/BAO/PrevNextCache.php @@ -454,7 +454,7 @@ WHERE cacheKey LIKE %1 $params1[2] = array("{$cacheKey}_alphabet%", 'String'); $dao = CRM_Core_DAO::executeQuery($query, $params1); - $val = array( ); + $val = array(); while ($dao->fetch()) { $val[] = $dao->data; } diff --git a/CRM/Core/BAO/UFField.php b/CRM/Core/BAO/UFField.php index 94fcc27910..0f698b1635 100644 --- a/CRM/Core/BAO/UFField.php +++ b/CRM/Core/BAO/UFField.php @@ -840,7 +840,7 @@ SELECT id } } - if (!in_array($prefixName, $validProfileFields) ) { + if (!in_array($prefixName, $validProfileFields)) { return; } diff --git a/CRM/Core/BAO/WordReplacement.php b/CRM/Core/BAO/WordReplacement.php index 10a8e4bbd2..8fff450e2c 100644 --- a/CRM/Core/BAO/WordReplacement.php +++ b/CRM/Core/BAO/WordReplacement.php @@ -159,7 +159,7 @@ SELECT find_word,replace_word,is_active,match_type FROM civicrm_word_replacement WHERE domain_id = %1 "; - $params = array( 1 => array($id, 'Integer')); + $params = array(1 => array($id, 'Integer')); $dao = CRM_Core_DAO::executeQuery($query, $params); diff --git a/CRM/Core/CodeGen/Specification.php b/CRM/Core/CodeGen/Specification.php index acbffbb0c9..37678b34bb 100644 --- a/CRM/Core/CodeGen/Specification.php +++ b/CRM/Core/CodeGen/Specification.php @@ -38,17 +38,17 @@ class CRM_Core_CodeGen_Specification { // add archive tables here $archiveTables = array(); - foreach ($this->tables as $name => $table ) { - if ( $table['archive'] == 'true' ) { + foreach ($this->tables as $name => $table) { + if ($table['archive'] == 'true') { $name = 'archive_' . $table['name']; $table['name'] = $name; $table['archive'] = 'false'; - if ( isset($table['foreignKey']) ) { + if (isset($table['foreignKey'])) { foreach ($table['foreignKey'] as $fkName => $fkValue) { if ($this->tables[$fkValue['table']]['archive'] == 'true') { $table['foreignKey'][$fkName]['table'] = 'archive_' . $table['foreignKey'][$fkName]['table']; $table['foreignKey'][$fkName]['uniqName'] = - str_replace( 'FK_', 'FK_archive_', $table['foreignKey'][$fkName]['uniqName'] ); + str_replace('FK_', 'FK_archive_', $table['foreignKey'][$fkName]['uniqName']); } } $archiveTables[$name] = $table; diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index 663bcc0d54..6a6026699b 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -605,12 +605,12 @@ class CRM_Core_Error extends PEAR_ErrorStack { * Append to the query log (if enabled) */ public static function debug_query($string) { - if ( defined( 'CIVICRM_DEBUG_LOG_QUERY' ) ) { - if ( CIVICRM_DEBUG_LOG_QUERY == 'backtrace' ) { - CRM_Core_Error::backtrace( $string, TRUE ); + if (defined('CIVICRM_DEBUG_LOG_QUERY')) { + if (CIVICRM_DEBUG_LOG_QUERY == 'backtrace') { + CRM_Core_Error::backtrace($string, TRUE); } - elseif ( CIVICRM_DEBUG_LOG_QUERY ) { - CRM_Core_Error::debug_var( 'Query', $string, FALSE, TRUE ); + elseif (CIVICRM_DEBUG_LOG_QUERY) { + CRM_Core_Error::debug_var('Query', $string, FALSE, TRUE); } } } diff --git a/CRM/Core/Form/Tag.php b/CRM/Core/Form/Tag.php index 97a0a616d0..b3b637972f 100644 --- a/CRM/Core/Form/Tag.php +++ b/CRM/Core/Form/Tag.php @@ -63,7 +63,7 @@ class CRM_Core_Form_Tag { */ static function buildQuickForm( &$form, $parentNames, $entityTable, $entityId = NULL, $skipTagCreate = FALSE, - $skipEntityAction = FALSE, $tagsetElementName = NULL ) { + $skipEntityAction = FALSE, $tagsetElementName = NULL) { $tagset = $form->_entityTagValues = array(); $form->assign("isTagset", FALSE); $mode = NULL; diff --git a/CRM/Core/I18n/Schema.php b/CRM/Core/I18n/Schema.php index 7307be120d..ddabc94a28 100644 --- a/CRM/Core/I18n/Schema.php +++ b/CRM/Core/I18n/Schema.php @@ -132,7 +132,7 @@ class CRM_Core_I18n_Schema { // lets drop all triggers first $logging = new CRM_Logging_Schema; - $logging->dropTriggers( ); + $logging->dropTriggers(); // turn subsequent tables singlelingual $tables = CRM_Core_I18n_SchemaStructure::tables(); @@ -149,7 +149,7 @@ class CRM_Core_I18n_Schema { $dbLocale = ''; // now lets rebuild all triggers - CRM_Core_DAO::triggerRebuild( ); + CRM_Core_DAO::triggerRebuild(); } /** @@ -221,7 +221,7 @@ class CRM_Core_I18n_Schema { $dao->query($query, FALSE); } - if ( !empty($triggers)) { + if (!empty($triggers)) { if (CRM_Core_Config::isUpgradeMode()) { foreach ($triggers as $triggerInfo) { $when = $triggerInfo['when']; diff --git a/CRM/Core/Invoke.php b/CRM/Core/Invoke.php index 67f1adc801..7f52c37c79 100644 --- a/CRM/Core/Invoke.php +++ b/CRM/Core/Invoke.php @@ -289,7 +289,7 @@ class CRM_Core_Invoke { } $title = CRM_Utils_Array::value('title', $item); if (strstr($item['page_callback'], '_Page')) { - $object = new $item['page_callback'] ($title, $mode ); + $object = new $item['page_callback'] ($title, $mode); $object->urlPath = explode('/', $_GET[$config->userFrameworkURLVar]); } elseif (strstr($item['page_callback'], '_Controller')) { @@ -299,7 +299,7 @@ class CRM_Core_Invoke { $addSequence = $addSequence ? 'true' : 'false'; unset($pageArgs['addSequence']); } - $object = new $item['page_callback'] ($title, true, $mode, null, $addSequence ); + $object = new $item['page_callback'] ($title, true, $mode, null, $addSequence); } else { CRM_Core_Error::fatal(); diff --git a/CRM/Core/Page.php b/CRM/Core/Page.php index 561cb3dac2..62e13b9970 100644 --- a/CRM/Core/Page.php +++ b/CRM/Core/Page.php @@ -184,8 +184,8 @@ class CRM_Core_Page { CRM_Utils_Hook::pageRun($this); if ($this->_print) { - if (in_array( $this->_print, array( CRM_Core_Smarty::PRINT_SNIPPET, - CRM_Core_Smarty::PRINT_PDF, CRM_Core_Smarty::PRINT_NOFORM, CRM_Core_Smarty::PRINT_JSON ))) { + if (in_array($this->_print, array(CRM_Core_Smarty::PRINT_SNIPPET, + CRM_Core_Smarty::PRINT_PDF, CRM_Core_Smarty::PRINT_NOFORM, CRM_Core_Smarty::PRINT_JSON))) { $content = self::$_template->fetch('CRM/common/snippet.tpl'); } else { diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index ddb2169ff8..5fe0710c56 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -289,7 +289,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { $startDate->setTimezone(new DateTimeZone(self::TIMEZONE)); } - $template->assign( 'startDate', $startDate->format('Y-m-d') ); + $template->assign('startDate', $startDate->format('Y-m-d')); $installments = $this->_getParam('installments'); @@ -587,7 +587,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { public function _getParam($field, $xmlSafe = FALSE) { $value = CRM_Utils_Array::value($field, $this->_params, ''); if ($xmlSafe) { - $value = str_replace(array( '&', '"', "'", '<', '>' ), '', $value); + $value = str_replace(array('&', '"', "'", '<', '>'), '', $value); } return $value; } diff --git a/CRM/Core/Payment/PayPalProIPN.php b/CRM/Core/Payment/PayPalProIPN.php index ac937ea4e7..2a0ff4dc0e 100644 --- a/CRM/Core/Payment/PayPalProIPN.php +++ b/CRM/Core/Payment/PayPalProIPN.php @@ -538,7 +538,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr $contributionRecur = civicrm_api3('contribution_recur', 'getsingle', array('return' => 'contact_id, id', 'invoice_id' => $input['invoice'])); $ids['contact'] = $contributionRecur['contact_id']; $ids['contributionRecur'] = $contributionRecur['id']; - $result = civicrm_api3('contribution', 'getsingle', array('invoice_id' => $input['invoice'] )); + $result = civicrm_api3('contribution', 'getsingle', array('invoice_id' => $input['invoice'])); $ids['contribution'] = $result['id']; //@todo hard - coding 'pending' for now diff --git a/CRM/Core/Permission/Drupal.php b/CRM/Core/Permission/Drupal.php index 3271ffb574..9cc51f98dc 100644 --- a/CRM/Core/Permission/Drupal.php +++ b/CRM/Core/Permission/Drupal.php @@ -99,7 +99,7 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase{ */ public function checkGroupRole($array) { if (function_exists('user_load') && isset($array)) { - $user = user_load( $GLOBALS['user']->uid); + $user = user_load($GLOBALS['user']->uid); //if giver roles found in user roles - return true foreach ($array as $key => $value) { if (in_array($value, $user->roles)) { @@ -158,7 +158,7 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase{ "; $result = db_query($sql); - foreach ( $result as $record ) { + foreach ($result as $record) { $uids[] = $record->uid; } diff --git a/CRM/Core/Permission/DrupalBase.php b/CRM/Core/Permission/DrupalBase.php index e788541e08..ac499f1ae7 100644 --- a/CRM/Core/Permission/DrupalBase.php +++ b/CRM/Core/Permission/DrupalBase.php @@ -261,7 +261,7 @@ class CRM_Core_Permission_DrupalBase extends CRM_Core_Permission_Base { */ public function checkGroupRole($array) { if (function_exists('user_load') && isset($array)) { - $user = user_load( $GLOBALS['user']->uid); + $user = user_load($GLOBALS['user']->uid); //if giver roles found in user roles - return true foreach ($array as $key => $value) { if (in_array($value, $user->roles)) { @@ -307,7 +307,7 @@ class CRM_Core_Permission_DrupalBase extends CRM_Core_Permission_Base { "; $result = db_query($sql); - foreach ( $result as $record ) { + foreach ($result as $record) { $uids[] = $record->uid; } diff --git a/CRM/Core/Permission/WordPress.php b/CRM/Core/Permission/WordPress.php index a9eedb7c81..01bbe9e58d 100644 --- a/CRM/Core/Permission/WordPress.php +++ b/CRM/Core/Permission/WordPress.php @@ -71,7 +71,7 @@ class CRM_Core_Permission_WordPress extends CRM_Core_Permission_Base { // Make string lowercase and convert spaces into underscore $str = CRM_Utils_String::munge(strtolower($str)); - if ( is_user_logged_in() ) { + if (is_user_logged_in()) { // Check whether the logged in user has the capabilitity if (current_user_can($str)) { return TRUE; diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php index cf9ca258a6..21d5dcdbb1 100644 --- a/CRM/Core/PseudoConstant.php +++ b/CRM/Core/PseudoConstant.php @@ -576,7 +576,7 @@ class CRM_Core_PseudoConstant { return $var; } - $object = new $name ( ); + $object = new $name (); $object->selectAdd(); $object->selectAdd("$key, $retrieve"); diff --git a/CRM/Core/Region.php b/CRM/Core/Region.php index a0efabc4eb..417b1ecaa1 100644 --- a/CRM/Core/Region.php +++ b/CRM/Core/Region.php @@ -15,7 +15,7 @@ class CRM_Core_Region { * @return CRM_Core_Region */ public static function &instance($name, $autocreate = TRUE) { - if ( $autocreate && ! isset( self::$_instances[$name] ) ) { + if ($autocreate && ! isset(self::$_instances[$name])) { self::$_instances[$name] = new CRM_Core_Region($name); } return self::$_instances[$name]; @@ -48,7 +48,7 @@ class CRM_Core_Region { public function __construct($name) { // Templates injected into regions should normally be file names, but sometimes inline notation is handy. require_once 'CRM/Core/Smarty/resources/String.php'; - civicrm_smarty_register_string_resource( ); + civicrm_smarty_register_string_resource(); $this->_name = $name; $this->_snippets = array(); @@ -219,8 +219,8 @@ class CRM_Core_Region { default: require_once 'CRM/Core/Error.php'; - CRM_Core_Error::fatal( ts( 'Snippet type %1 is unrecognized', - array( 1 => $snippet['type'] ) ) ); + CRM_Core_Error::fatal(ts('Snippet type %1 is unrecognized', + array(1 => $snippet['type']))); } } return $html; diff --git a/CRM/Core/Report/Excel.php b/CRM/Core/Report/Excel.php index a15077ef13..d3dd8fab49 100644 --- a/CRM/Core/Report/Excel.php +++ b/CRM/Core/Report/Excel.php @@ -223,7 +223,7 @@ class CRM_Core_Report_Excel { if ($saveFile) { $print = FALSE; } - return self::makeCSVTable( $header, $rows, $titleHeader, $print, $outputHeader ); + return self::makeCSVTable($header, $rows, $titleHeader, $print, $outputHeader); } } diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php index 283143a069..d65ddff757 100644 --- a/CRM/Core/SelectValues.php +++ b/CRM/Core/SelectValues.php @@ -864,7 +864,7 @@ class CRM_Core_SelectValues { ); $contactTypes = self::contactType(); $contactTypes = !empty($contactTypes) ? array('Contact' => 'Contacts') + $contactTypes : array(); - $profileGroupType = array_merge($contactTypes, $profileGroupType ); + $profileGroupType = array_merge($contactTypes, $profileGroupType); return $profileGroupType; } diff --git a/CRM/Core/Smarty.php b/CRM/Core/Smarty.php index caf5925d5d..5ff43aca84 100644 --- a/CRM/Core/Smarty.php +++ b/CRM/Core/Smarty.php @@ -178,8 +178,8 @@ class CRM_Core_Smarty extends Smarty { */ public static function &singleton() { if (!isset(self::$_singleton)) { - self::$_singleton = new CRM_Core_Smarty( ); - self::$_singleton->initialize( ); + self::$_singleton = new CRM_Core_Smarty(); + self::$_singleton->initialize(); self::registerStringResource(); } @@ -197,7 +197,7 @@ class CRM_Core_Smarty extends Smarty { * @return bool|mixed|string */ public function fetch($resource_name, $cache_id = NULL, $compile_id = NULL, $display = FALSE) { - if (preg_match( '/^(\s+)?string:/', $resource_name)) { + if (preg_match('/^(\s+)?string:/', $resource_name)) { $old_security = $this->security; $this->security = TRUE; } @@ -265,11 +265,11 @@ class CRM_Core_Smarty extends Smarty { * @param $path */ public function addTemplateDir($path) { - if ( is_array( $this->template_dir ) ) { - array_unshift( $this->template_dir, $path ); + if (is_array($this->template_dir)) { + array_unshift($this->template_dir, $path); } else { - $this->template_dir = array( $path, $this->template_dir ); + $this->template_dir = array($path, $this->template_dir); } } diff --git a/CRM/Core/StateMachine.php b/CRM/Core/StateMachine.php index 3e7f7f92ff..d483956e92 100644 --- a/CRM/Core/StateMachine.php +++ b/CRM/Core/StateMachine.php @@ -233,7 +233,7 @@ class CRM_Core_StateMachine { * we change the form name to allow multiple edits to happen * We need a cleaner way of doing this going forward */ - foreach ($this->_states as $n => $s ) { + foreach ($this->_states as $n => $s) { if (substr($name, 0, strlen($n)) == $n) { return $s; } diff --git a/CRM/Custom/Form/CustomData.php b/CRM/Custom/Form/CustomData.php index 433a460d7c..dfd78931c6 100644 --- a/CRM/Custom/Form/CustomData.php +++ b/CRM/Custom/Form/CustomData.php @@ -103,9 +103,9 @@ class CRM_Custom_Form_CustomData { $form->_entityId = CRM_Utils_Request::retrieve('entityID', 'Positive', $form); } - $typeCheck = CRM_Utils_Request::retrieve( 'type', 'String', CRM_Core_DAO::$_nullObject ); + $typeCheck = CRM_Utils_Request::retrieve('type', 'String', CRM_Core_DAO::$_nullObject); $urlGroupId = CRM_Utils_Request::retrieve('groupID', 'Positive', CRM_Core_DAO::$_nullObject); - if ( isset($typeCheck) && $urlGroupId) { + if (isset($typeCheck) && $urlGroupId) { $form->_groupID = $urlGroupId; } else { diff --git a/CRM/Custom/Import/Parser/Api.php b/CRM/Custom/Import/Parser/Api.php index 603a472980..4559c7ca13 100644 --- a/CRM/Custom/Import/Parser/Api.php +++ b/CRM/Custom/Import/Parser/Api.php @@ -223,7 +223,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { $fields = $allFields['values']; foreach ($fields as $id => $values) { $datatype = CRM_Utils_Array::value('data_type', $values); - if ( $datatype == 'File' ) { + if ($datatype == 'File') { continue; } /* generate the key for the fields array */ diff --git a/CRM/Custom/Page/Group.php b/CRM/Custom/Page/Group.php index ed5595d8c2..b227a177e2 100644 --- a/CRM/Custom/Page/Group.php +++ b/CRM/Custom/Page/Group.php @@ -244,7 +244,7 @@ class CRM_Custom_Page_Group extends CRM_Core_Page { $subTypes = array(); $subTypes['Activity'] = CRM_Core_PseudoConstant::activityType(FALSE, TRUE, FALSE, 'label', TRUE); - $subTypes['Contribution'] = CRM_Contribute_PseudoConstant::financialType( ); + $subTypes['Contribution'] = CRM_Contribute_PseudoConstant::financialType(); $subTypes['Membership'] = CRM_Member_BAO_MembershipType::getMembershipTypes(FALSE); $subTypes['Event'] = CRM_Core_OptionGroup::values('event_type'); $subTypes['Grant'] = CRM_Core_OptionGroup::values('grant_type'); diff --git a/CRM/Dedupe/BAO/QueryBuilder.php b/CRM/Dedupe/BAO/QueryBuilder.php index ee56688353..686cda71d9 100644 --- a/CRM/Dedupe/BAO/QueryBuilder.php +++ b/CRM/Dedupe/BAO/QueryBuilder.php @@ -14,7 +14,7 @@ class CRM_Dedupe_BAO_QueryBuilder { public static function internalFilters($rg, $strID1 = 'contact1.id', $strID2 = 'contact2.id') { // Add a contact id filter for dedupe by group requests and add logic // to remove duplicate results with opposing orders, i.e. 1,2 and 2,1 - if (!empty($rg->contactIds) ) { + if (!empty($rg->contactIds)) { $cids = implode(',', $rg->contactIds); return "($strID1 IN ($cids) AND ( $strID2 NOT IN ($cids) OR ($strID2 IN ($cids) AND $strID1 < $strID2) ))"; } diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php index a810bc0898..fc05be3f70 100644 --- a/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php +++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php @@ -93,7 +93,7 @@ INSERT INTO emails FROM civicrm_email as email1 JOIN civicrm_email as email2 USING (email) WHERE email1.contact_id < email2.contact_id - AND " . self::internalFilters($rg, "email1.contact_id", "email2.contact_id" ); + AND " . self::internalFilters($rg, "email1.contact_id", "email2.contact_id"); CRM_Core_DAO::executeQuery($sql); $query = " diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php index 86aec8f776..bde82fa112 100644 --- a/CRM/Dedupe/Finder.php +++ b/CRM/Dedupe/Finder.php @@ -151,7 +151,7 @@ class CRM_Dedupe_Finder { */ public static function dupesInGroup($rgid, $gid) { $cids = array_keys(CRM_Contact_BAO_Group::getMember($gid)); - if ( !empty($cids) ) { + if (!empty($cids)) { return self::dupes($rgid, $cids); } return array(); diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index c698a3254e..f29b9c9c57 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -248,7 +248,7 @@ WHERE public static function locTables() { static $locTables; if (!$locTables) { - $locTables = array( 'civicrm_email', 'civicrm_address', 'civicrm_phone' ); + $locTables = array('civicrm_email', 'civicrm_address', 'civicrm_phone'); // Allow hook_civicrm_merge() to adjust $locTables CRM_Utils_Hook::merge('locTables', $locTables); @@ -1486,7 +1486,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m // move the other contact's file to main contact //NYSS need to INSERT or UPDATE depending on whether main contact has an existing record - if ( CRM_Core_DAO::singleValueQuery("SELECT id FROM {$tableName} WHERE entity_id = {$mainId}") ) { + if (CRM_Core_DAO::singleValueQuery("SELECT id FROM {$tableName} WHERE entity_id = {$mainId}")) { $sql = "UPDATE {$tableName} SET {$columnName} = {$fileIds[$otherId]} WHERE entity_id = {$mainId}"; } else { @@ -1494,10 +1494,10 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m } CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray); - if ( CRM_Core_DAO::singleValueQuery(" + if (CRM_Core_DAO::singleValueQuery(" SELECT id FROM civicrm_entity_file - WHERE entity_table = '{$tableName}' AND file_id = {$fileIds[$otherId]}") ) { + WHERE entity_table = '{$tableName}' AND file_id = {$fileIds[$otherId]}")) { $sql = " UPDATE civicrm_entity_file SET entity_id = {$mainId} @@ -1554,7 +1554,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m // CRM-15681 merge sub_types if ($other_sub_types = CRM_Utils_array::value('contact_sub_type', $migrationInfo['other_details'])) { if ($main_sub_types = CRM_Utils_array::value('contact_sub_type', $migrationInfo['main_details'])) { - $submitted['contact_sub_type'] = array_unique( array_merge($main_sub_types, $other_sub_types)); + $submitted['contact_sub_type'] = array_unique(array_merge($main_sub_types, $other_sub_types)); } else { $submitted['contact_sub_type'] = $other_sub_types; @@ -1577,10 +1577,10 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m } //CRM-14312 include prefix/suffix from mainId if not overridden for proper construction of display/sort name - if ( !isset($submitted['prefix_id']) && !empty($migrationInfo['main_details']['prefix_id']) ) { + if (!isset($submitted['prefix_id']) && !empty($migrationInfo['main_details']['prefix_id'])) { $submitted['prefix_id'] = $migrationInfo['main_details']['prefix_id']; } - if ( !isset($submitted['suffix_id']) && !empty($migrationInfo['main_details']['suffix_id']) ) { + if (!isset($submitted['suffix_id']) && !empty($migrationInfo['main_details']['suffix_id'])) { $submitted['suffix_id'] = $migrationInfo['main_details']['suffix_id']; } diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index 79fd0198b5..35ab118480 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -416,7 +416,7 @@ class CRM_Event_BAO_Query { $names = array(); foreach ($val as $id => $dontCare) { - if (!empty($roleTypes[$id]) ) { + if (!empty($roleTypes[$id])) { $names[] = $roleTypes[$id]; } } diff --git a/CRM/Event/Badge.php b/CRM/Event/Badge.php index 7dd9349fc9..5efaba68d6 100644 --- a/CRM/Event/Badge.php +++ b/CRM/Event/Badge.php @@ -119,9 +119,9 @@ class CRM_Event_Badge { // CRM-13235 - leverage the Smarty path to get all templates directories $template = CRM_Core_Smarty::singleton(); if (isset($template->template_dir) && $template->template_dir) { - $dirs = is_array( $template->template_dir ) ? $template->template_dir : array($template->template_dir); + $dirs = is_array($template->template_dir) ? $template->template_dir : array($template->template_dir); foreach ($dirs as $dir) { - foreach (array( "$dir/$path/$eventID/$img", "$dir/$path/$img") as $imgFile) { + foreach (array("$dir/$path/$eventID/$img", "$dir/$path/$img") as $imgFile) { if (file_exists($imgFile)) { return $imgFile; } diff --git a/CRM/Event/Cart/Form/Checkout/Payment.php b/CRM/Event/Cart/Form/Checkout/Payment.php index ce39419576..00471494a4 100644 --- a/CRM/Event/Cart/Form/Checkout/Payment.php +++ b/CRM/Event/Cart/Form/Checkout/Payment.php @@ -545,7 +545,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { if ($event_in_cart->event->financial_type_id && $mer_participant->cost) { $params['financial_type_id'] = $event_in_cart->event->financial_type_id; $params['participant_contact_id'] = $mer_participant->contact_id; - $contribution = $this->record_contribution($mer_participant, $params, $event_in_cart->event ); + $contribution = $this->record_contribution($mer_participant, $params, $event_in_cart->event); // Record civicrm_line_item CRM_Price_BAO_LineItem::processPriceSet($mer_participant->id, $mer_participant->price_details, $contribution, $entity_table = 'civicrm_participant'); } diff --git a/CRM/Event/Form/EventFees.php b/CRM/Event/Form/EventFees.php index c5fe459e51..477b056e32 100644 --- a/CRM/Event/Form/EventFees.php +++ b/CRM/Event/Form/EventFees.php @@ -80,7 +80,7 @@ class CRM_Event_Form_EventFees { if ($form->_eventId) { //get receipt text and financial type - $returnProperities = array( 'confirm_email_text', 'financial_type_id', 'campaign_id', 'start_date' ); + $returnProperities = array('confirm_email_text', 'financial_type_id', 'campaign_id', 'start_date'); $details = array(); CRM_Core_DAO::commonRetrieveAll('CRM_Event_DAO_Event', 'id', $form->_eventId, $details, $returnProperities); if (!empty($details[$form->_eventId]['financial_type_id'])) { @@ -233,8 +233,8 @@ class CRM_Event_Form_EventFees { if ($contriId = $form->get('onlinePendingContributionId')) { $contribution = new CRM_Contribute_DAO_Contribution(); $contribution->id = $contriId; - $contribution->find( TRUE ); - foreach (array('financial_type_id', 'payment_instrument_id', 'contribution_status_id', 'receive_date', 'total_amount' ) as $f ) { + $contribution->find(TRUE); + foreach (array('financial_type_id', 'payment_instrument_id', 'contribution_status_id', 'receive_date', 'total_amount') as $f) { if ($f == 'receive_date') { list($defaults[$form->_pId]['receive_date']) = CRM_Utils_Date::setDateDefaults($contribution->$f); } @@ -412,7 +412,7 @@ SELECT id, html_type ); $form->add('select', 'financial_type_id', - ts( 'Financial Type' ), + ts('Financial Type'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType() ); diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php index 15c79e0b8f..27e277f301 100644 --- a/CRM/Event/Form/ManageEvent/Registration.php +++ b/CRM/Event/Form/ManageEvent/Registration.php @@ -333,13 +333,13 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent ); $form->addWysiwyg('footer_text', ts('Footer Text'), $footerAttribs); - extract( self::getProfileSelectorTypes() ); + extract(self::getProfileSelectorTypes()); //CRM-15427 - $form->addProfileSelector( 'custom_pre_id', ts('Include Profile') . '
' . ts('(top of page)'), $allowCoreTypes, $allowSubTypes, $profileEntities, TRUE); - $form->addProfileSelector( 'custom_post_id', ts('Include Profile') . '
' . ts('(bottom of page)'), $allowCoreTypes, $allowSubTypes, $profileEntities, TRUE); + $form->addProfileSelector('custom_pre_id', ts('Include Profile') . '
' . ts('(top of page)'), $allowCoreTypes, $allowSubTypes, $profileEntities, TRUE); + $form->addProfileSelector('custom_post_id', ts('Include Profile') . '
' . ts('(bottom of page)'), $allowCoreTypes, $allowSubTypes, $profileEntities, TRUE); - $form->addProfileSelector( 'additional_custom_pre_id', ts('Profile for Additional Participants') . '
' . ts('(top of page)'), $allowCoreTypes, $allowSubTypes, $profileEntities, TRUE); - $form->addProfileSelector( 'additional_custom_post_id', ts('Profile for Additional Participants') . '
' . ts('(bottom of page)'), $allowCoreTypes, $allowSubTypes, $profileEntities, TRUE); + $form->addProfileSelector('additional_custom_pre_id', ts('Profile for Additional Participants') . '
' . ts('(top of page)'), $allowCoreTypes, $allowSubTypes, $profileEntities, TRUE); + $form->addProfileSelector('additional_custom_post_id', ts('Profile for Additional Participants') . '
' . ts('(bottom of page)'), $allowCoreTypes, $allowSubTypes, $profileEntities, TRUE); } /** @@ -357,10 +357,10 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * Optional, for addProfileSelector(), defaults to using getProfileSelectorTypes(). **/ public function buildMultipleProfileBottom(&$form, $count, $prefix = '', $label = 'Include Profile', $configs = NULL) { - extract( ( is_null($configs) ) ? self::getProfileSelectorTypes() : $configs ); + extract((is_null($configs)) ? self::getProfileSelectorTypes() : $configs); $element = $prefix . "custom_post_id_multiple[$count]"; $label .= '
'.ts('(bottom of page)'); - $form->addProfileSelector( $element, $label, $allowCoreTypes, $allowSubTypes, $profileEntities, TRUE); + $form->addProfileSelector($element, $label, $allowCoreTypes, $allowSubTypes, $profileEntities, TRUE); } /** @@ -378,7 +378,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent $configs['allowCoreTypes'] = array_merge(array('Contact', 'Individual'), CRM_Contact_BAO_ContactType::subTypes('Individual')); $configs['allowCoreTypes'][] = 'Participant'; //CRM-15427 - $id = CRM_Utils_Request::retrieve( 'id', 'Integer' ); + $id = CRM_Utils_Request::retrieve('id', 'Integer'); if ($id) { $participantEventType = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Event", $id, 'event_type_id', 'id'); $participantRole = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $id, 'default_role_id'); diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 24e5b742b4..b59b617799 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -1319,7 +1319,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $contributionParams['non_deductible_amount'] = 'null'; $contributionParams['receipt_date'] = !empty($params['send_receipt']) ? CRM_Utils_Array::value('receive_date', $params) : 'null'; - $recordContribution = array( 'contact_id', 'financial_type_id', + $recordContribution = array('contact_id', 'financial_type_id', 'payment_instrument_id', 'trxn_id', 'contribution_status_id', 'receive_date', 'check_number', 'campaign_id', @@ -1516,7 +1516,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment if (isset($contributionParams['partial_payment_total'])) { // balance amount $balanceAmount = $contributionParams['partial_payment_total'] - $contributionParams['partial_amount_pay']; - $this->assign('balanceAmount', $balanceAmount ); + $this->assign('balanceAmount', $balanceAmount); } $this->assign('isPrimary', 1); $this->assign('checkNumber', CRM_Utils_Array::value('check_number', $params)); @@ -1669,7 +1669,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment } //send email with pdf invoice - $template = CRM_Core_Smarty::singleton( ); + $template = CRM_Core_Smarty::singleton(); $taxAmt = $template->get_template_vars('dataArray'); $contributionId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment', $this->_id, 'contribution_id', 'participant_id' diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index ddb881f571..9f668d3245 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -681,7 +681,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { if (property_exists($form, '_context') && ($form->_context == 'standalone' || $form->_context == 'participant')) { $discountedEvent = CRM_Core_BAO_Discount::getOptionGroup($eventID, 'civicrm_event'); - if (is_array( $discountedEvent)) { + if (is_array($discountedEvent)) { foreach ($discountedEvent as $key => $priceSetId) { $priceSet = CRM_Price_BAO_PriceSet::getSetDetail($priceSetId); $priceSet = CRM_Utils_Array::value($priceSetId, $priceSet); diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 406cce15c4..730aa276fa 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -681,7 +681,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { // handle register date CRM-4320 if ($this->_allowConfirmation) { - $registerDate = CRM_Utils_Array::value( 'participant_register_date', $params ); + $registerDate = CRM_Utils_Array::value('participant_register_date', $params); } elseif (!empty($params['participant_register_date']) && is_array($params['participant_register_date']) && @@ -1272,7 +1272,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { } $form->_fields = $profileFields; } - if (!empty($formattedValues) ) { + if (!empty($formattedValues)) { $form->assign('primaryParticipantProfile', $formattedValues[1]); $form->set('primaryParticipantProfile', $formattedValues[1]); if ($count > 2) { diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php index 2f671b2997..7cc862ad43 100644 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/Form/Search.php @@ -195,7 +195,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { //convert form values to clause. $seatClause = array(); // Filter on is_test if specified in search form - if (CRM_Utils_Array::value('participant_test', $this->_formValues) == '1' || CRM_Utils_Array::value('participant_test', $this->_formValues) == '0' ) { + if (CRM_Utils_Array::value('participant_test', $this->_formValues) == '1' || CRM_Utils_Array::value('participant_test', $this->_formValues) == '0') { $seatClause[] = "( participant.is_test = {$this->_formValues['participant_test']} )"; } if (!empty($this->_formValues['participant_status_id'])) { diff --git a/CRM/Event/Task.php b/CRM/Event/Task.php index fa9b877582..5328030121 100644 --- a/CRM/Event/Task.php +++ b/CRM/Event/Task.php @@ -139,7 +139,7 @@ class CRM_Event_Task { unset(self::$_tasks[1]); } //CRM-12920 - check for edit permission - if (!CRM_Core_Permission::check('edit event participants') ) { + if (!CRM_Core_Permission::check('edit event participants')) { unset(self::$_tasks[4], self::$_tasks[5], self::$_tasks[15]); } } diff --git a/CRM/Export/Form/Select.php b/CRM/Export/Form/Select.php index 585dd09917..cb5c94d35e 100644 --- a/CRM/Export/Form/Select.php +++ b/CRM/Export/Form/Select.php @@ -142,7 +142,7 @@ class CRM_Export_Form_Select extends CRM_Core_Form { } $className = "CRM_{$componentName[1]}_Form_Task"; - $className::preProcessCommon( $this, TRUE ); + $className::preProcessCommon($this, TRUE); $values = $this->controller->exportValues('Search'); } else { diff --git a/CRM/Extension/Manager/Payment.php b/CRM/Extension/Manager/Payment.php index 92bfff20f7..f34cd08b1d 100644 --- a/CRM/Extension/Manager/Payment.php +++ b/CRM/Extension/Manager/Payment.php @@ -285,8 +285,8 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base { break; default: - CRM_Core_Session::setStatus(ts( "Unrecognized payment hook (%1) in %2::%3", - array(1 => $method, 2 => __CLASS__ , 3 => __METHOD__) ), + CRM_Core_Session::setStatus(ts("Unrecognized payment hook (%1) in %2::%3", + array(1 => $method, 2 => __CLASS__ , 3 => __METHOD__)), '', 'error'); } } diff --git a/CRM/Financial/BAO/ExportFormat.php b/CRM/Financial/BAO/ExportFormat.php index 4c29baf2ea..bd8a1b8155 100644 --- a/CRM/Financial/BAO/ExportFormat.php +++ b/CRM/Financial/BAO/ExportFormat.php @@ -55,7 +55,7 @@ class CRM_Financial_BAO_ExportFormat { * Class constructor */ public function __construct() { - if ( !isset( self::$_template ) ) { + if (!isset(self::$_template)) { self::$_template = CRM_Core_Smarty::singleton(); } } diff --git a/CRM/Financial/BAO/ExportFormat/CSV.php b/CRM/Financial/BAO/ExportFormat/CSV.php index 8cc6eed97f..69f80bf158 100644 --- a/CRM/Financial/BAO/ExportFormat/CSV.php +++ b/CRM/Financial/BAO/ExportFormat/CSV.php @@ -63,7 +63,7 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat // Save the file in the public directory $fileName = self::putFile($export); - foreach ( self::$complementaryTables as $rct ) { + foreach (self::$complementaryTables as $rct) { $func = "export{$rct}"; $this->$func(); } @@ -122,7 +122,7 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat WHERE eb.batch_id = ( %1 )"; $params = array(1 => array($batchId, 'String')); - $dao = CRM_Core_DAO::executeQuery( $sql, $params ); + $dao = CRM_Core_DAO::executeQuery($sql, $params); return $dao; } diff --git a/CRM/Financial/BAO/ExportFormat/IIF.php b/CRM/Financial/BAO/ExportFormat/IIF.php index bbb82aa04e..56a8315b02 100644 --- a/CRM/Financial/BAO/ExportFormat/IIF.php +++ b/CRM/Financial/BAO/ExportFormat/IIF.php @@ -62,9 +62,9 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat * @param array $exportParams */ public function export($exportParams) { - parent::export( $exportParams ); + parent::export($exportParams); - foreach (self::$complementaryTables as $rct ) { + foreach (self::$complementaryTables as $rct) { $func = "export{$rct}"; $this->$func(); } @@ -139,7 +139,7 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat WHERE eb.batch_id = ( %1 )"; $params = array(1 => array($batchId, 'String')); - $dao = CRM_Core_DAO::executeQuery( $sql, $params ); + $dao = CRM_Core_DAO::executeQuery($sql, $params); return $dao; } @@ -236,9 +236,9 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat WHERE eft.entity_table = 'civicrm_financial_item' AND eft.financial_trxn_id = %1"; - $itemParams = array( 1 => array( $dao->financial_trxn_id, 'Integer' ) ); + $itemParams = array(1 => array($dao->financial_trxn_id, 'Integer')); - $itemDAO = CRM_Core_DAO::executeQuery( $item_sql, $itemParams ); + $itemDAO = CRM_Core_DAO::executeQuery($item_sql, $itemParams); while ($itemDAO->fetch()) { // add to running list of accounts if (!empty($itemDAO->account_id) && !isset($accounts[$itemDAO->account_id])) { @@ -299,15 +299,15 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat } public function exportACCNT() { - self::assign( 'accounts', $this->_exportParams['accounts'] ); + self::assign('accounts', $this->_exportParams['accounts']); } public function exportCUST() { - self::assign( 'contacts', $this->_exportParams['contacts'] ); + self::assign('contacts', $this->_exportParams['contacts']); } public function exportTRANS() { - self::assign( 'journalEntries', $this->_exportParams['journalEntries'] ); + self::assign('journalEntries', $this->_exportParams['journalEntries']); } /** @@ -347,10 +347,10 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat // Date handling has changed over the years. It used to only understand mm/dd/yy but I think now it might depend on your OS settings. Sometimes mm/dd/yyyy works but sometimes it wants yyyy/mm/dd, at least where I had used it. // In all cases need to do something with tabs in the input. - $s1 = str_replace( self::$SEPARATOR, '\t', $s ); - switch ($type ) { + $s1 = str_replace(self::$SEPARATOR, '\t', $s); + switch ($type) { case 'date': - $sout = date( 'Y/m/d', strtotime( $s1 ) ); + $sout = date('Y/m/d', strtotime($s1)); break; case 'money': @@ -359,9 +359,9 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat case 'string': case 'notepad': - $s2 = str_replace( "\n", '\n', $s1 ); - $s3 = str_replace( "\r", '', $s2 ); - $s4 = str_replace( '"', "'", $s3 ); + $s2 = str_replace("\n", '\n', $s1); + $s3 = str_replace("\r", '', $s2); + $s4 = str_replace('"', "'", $s3); if ($type == 'notepad') { $sout = '"' . $s4 . '"'; } diff --git a/CRM/Financial/BAO/FinancialItem.php b/CRM/Financial/BAO/FinancialItem.php index f20377d20a..d5d81bc621 100644 --- a/CRM/Financial/BAO/FinancialItem.php +++ b/CRM/Financial/BAO/FinancialItem.php @@ -39,7 +39,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem { * Class constructor */ public function __construct() { - parent::__construct( ); + parent::__construct(); } /** @@ -97,7 +97,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem { 'currency' => $contribution->currency, 'entity_table' => 'civicrm_line_item', 'entity_id' => $lineItem->id, - 'description' => ( $lineItem->qty != 1 ? $lineItem->qty . ' of ' : ''). ' ' . $lineItem->label, + 'description' => ($lineItem->qty != 1 ? $lineItem->qty . ' of ' : ''). ' ' . $lineItem->label, 'status_id' => $itemStatus, ); @@ -119,8 +119,8 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem { ); $result = array(); - CRM_Financial_BAO_FinancialTypeAccount::retrieve( $searchParams, $result ); - $params['financial_account_id'] = CRM_Utils_Array::value( 'financial_account_id', $result ); + CRM_Financial_BAO_FinancialTypeAccount::retrieve($searchParams, $result); + $params['financial_account_id'] = CRM_Utils_Array::value('financial_account_id', $result); } $trxn = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($contribution->id, 'ASC', TRUE); $trxnId['id'] = $trxn['financialTrxnId']; diff --git a/CRM/Financial/BAO/FinancialType.php b/CRM/Financial/BAO/FinancialType.php index d0fcc8179b..72a1216b8f 100644 --- a/CRM/Financial/BAO/FinancialType.php +++ b/CRM/Financial/BAO/FinancialType.php @@ -45,7 +45,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { * Class constructor */ public function __construct() { - parent::__construct( ); + parent::__construct(); } /** @@ -60,10 +60,10 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { * @static */ public static function retrieve(&$params, &$defaults) { - $financialType = new CRM_Financial_DAO_FinancialType( ); - $financialType->copyValues( $params ); + $financialType = new CRM_Financial_DAO_FinancialType(); + $financialType->copyValues($params); if ($financialType->find(TRUE)) { - CRM_Core_DAO::storeValues( $financialType, $defaults ); + CRM_Core_DAO::storeValues($financialType, $defaults); return $financialType; } return NULL; @@ -81,7 +81,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { * @static */ public static function setIsActive($id, $is_active) { - return CRM_Core_DAO::setFieldValue( 'CRM_Financial_DAO_FinancialType', $id, 'is_active', $is_active ); + return CRM_Core_DAO::setFieldValue('CRM_Financial_DAO_FinancialType', $id, 'is_active', $is_active); } /** @@ -126,7 +126,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { * @static */ public static function del($financialTypeId) { - $financialType = new CRM_Financial_DAO_FinancialType( ); + $financialType = new CRM_Financial_DAO_FinancialType(); $financialType->id = $financialTypeId; $financialType->find(TRUE); // tables to ingore checks for financial_type_id @@ -157,7 +157,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { //delete from financial Type table $financialType->delete(); - $entityFinancialType = new CRM_Financial_DAO_EntityFinancialAccount( ); + $entityFinancialType = new CRM_Financial_DAO_EntityFinancialAccount(); $entityFinancialType->entity_id = $financialTypeId; $entityFinancialType->entity_table = 'civicrm_financial_type'; $entityFinancialType->delete(); diff --git a/CRM/Financial/BAO/FinancialTypeAccount.php b/CRM/Financial/BAO/FinancialTypeAccount.php index ba33aedf38..ed86a63148 100644 --- a/CRM/Financial/BAO/FinancialTypeAccount.php +++ b/CRM/Financial/BAO/FinancialTypeAccount.php @@ -39,7 +39,7 @@ class CRM_Financial_BAO_FinancialTypeAccount extends CRM_Financial_DAO_EntityFin * Class constructor */ public function __construct() { - parent::__construct( ); + parent::__construct(); } /** @@ -116,7 +116,7 @@ class CRM_Financial_BAO_FinancialTypeAccount extends CRM_Financial_DAO_EntityFin $check = FALSE; $relationValues = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', 'account_relationship'); - $financialTypeId = CRM_Core_DAO::getFieldValue( 'CRM_Financial_DAO_EntityFinancialAccount', $financialTypeAccountId, 'entity_id' ); + $financialTypeId = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_EntityFinancialAccount', $financialTypeAccountId, 'entity_id'); //check dependencies // FIXME more table containing financial_type_id to come $dependancy = array( @@ -148,11 +148,11 @@ class CRM_Financial_BAO_FinancialTypeAccount extends CRM_Financial_DAO_EntityFin $accountRelationShipId = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_EntityFinancialAccount', $financialTypeAccountId, 'account_relationship'); CRM_Core_Session::setStatus(ts('You cannot remove an account with a %1 relationship because it is being referenced by one or more of the following types of records: Contributions, Contribution Pages, or Membership Types. Consider disabling this type instead if you no longer want it used.', array(1 => $relationValues[$accountRelationShipId])), NULL, 'error'); } - return CRM_Utils_System::redirect( CRM_Utils_System::url( 'civicrm/admin/financial/financialType/accounts', "reset=1&action=browse&aid={$accountId}" )); + return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/financial/financialType/accounts', "reset=1&action=browse&aid={$accountId}")); } //delete from financial Type table - $financialType = new CRM_Financial_DAO_EntityFinancialAccount( ); + $financialType = new CRM_Financial_DAO_EntityFinancialAccount(); $financialType->id = $financialTypeAccountId; $financialType->find(TRUE); $financialType->delete(); diff --git a/CRM/Financial/BAO/PaymentProcessor.php b/CRM/Financial/BAO/PaymentProcessor.php index 6b9354bfa9..d9d1165003 100644 --- a/CRM/Financial/BAO/PaymentProcessor.php +++ b/CRM/Financial/BAO/PaymentProcessor.php @@ -192,7 +192,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces CRM_Core_Error::fatal(ts('Invalid value passed to getPayment function')); } - $dao = new CRM_Financial_DAO_PaymentProcessor( ); + $dao = new CRM_Financial_DAO_PaymentProcessor(); $dao->id = $paymentProcessorID; $dao->is_active = 1; if (!$dao->find(TRUE)) { @@ -200,7 +200,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces } if ($mode == 'test') { - $testDAO = new CRM_Financial_DAO_PaymentProcessor( ); + $testDAO = new CRM_Financial_DAO_PaymentProcessor(); $testDAO->name = $dao->name; $testDAO->is_active = 1; $testDAO->is_test = 1; diff --git a/CRM/Financial/Form/BatchTransaction.php b/CRM/Financial/Form/BatchTransaction.php index 18e8ac9c89..bbd3c7006b 100644 --- a/CRM/Financial/Form/BatchTransaction.php +++ b/CRM/Financial/Form/BatchTransaction.php @@ -48,7 +48,7 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form { protected $_batchStatusId; public function preProcess() { - self::$_entityID = CRM_Utils_Request::retrieve( 'bid', 'Positive' ) ? CRM_Utils_Request::retrieve( 'bid', 'Positive' ) : $_POST['batch_id']; + self::$_entityID = CRM_Utils_Request::retrieve('bid', 'Positive') ? CRM_Utils_Request::retrieve('bid', 'Positive') : $_POST['batch_id']; $this->assign('entityID', self::$_entityID); if (isset(self::$_entityID)) { $this->_batchStatusId = CRM_Core_DAO::getFieldValue('CRM_Batch_BAO_Batch', self::$_entityID, 'status_id'); @@ -83,7 +83,7 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form { } // do not build rest of form unless it is open batch - if ($this->_batchStatusId != 1 ) { + if ($this->_batchStatusId != 1) { return; } @@ -118,10 +118,10 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form { CRM_Contribute_BAO_Query::buildSearchForm($this); $this->addElement('checkbox', 'toggleSelects', NULL, NULL); - $this->add( 'select', + $this->add('select', 'trans_remove', ts('Task'), - array( '' => ts( '- actions -' )) + array( 'Remove' => ts('Remove from Batch'))); + array('' => ts('- actions -')) + array('Remove' => ts('Remove from Batch'))); $this->add('submit', 'rSubmit', ts('Go'), array( @@ -142,10 +142,10 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form { ); $this->addElement('checkbox', 'toggleSelect', NULL, NULL); - $this->add( 'select', + $this->add('select', 'trans_assign', ts('Task'), - array( '' => ts( '- actions -' )) + array( 'Assign' => ts( 'Assign to Batch' ))); + array('' => ts('- actions -')) + array('Assign' => ts('Assign to Batch'))); $this->add('submit', 'submit', ts('Go'), array( @@ -161,7 +161,7 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form { public function setDefaultValues() { // do not setdefault unless it is open batch - if ($this->_batchStatusId != 1 ) { + if ($this->_batchStatusId != 1) { return; } if (isset(self::$_entityID)) { diff --git a/CRM/Financial/Form/Export.php b/CRM/Financial/Form/Export.php index 1bce20cb85..e459d0cf38 100644 --- a/CRM/Financial/Form/Export.php +++ b/CRM/Financial/Form/Export.php @@ -71,7 +71,7 @@ class CRM_Financial_Form_Export extends CRM_Core_Form { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); // this mean it's a batch action - if (!$this->_id ) { + if (!$this->_id) { if (!empty($_GET['batch_id'])) { //validate batch ids $batchIds = explode(',', $_GET['batch_id']); @@ -99,7 +99,7 @@ class CRM_Financial_Form_Export extends CRM_Core_Form { //check if batch status is valid, do not allow exported batches to export again $batchStatus = CRM_Batch_BAO_Batch::getBatchStatuses($this->_batchIds); - foreach ($batchStatus as $batchStatusId ) { + foreach ($batchStatus as $batchStatusId) { if ($batchStatusId == $this->_exportStatusId) { CRM_Core_Error::fatal(ts('You cannot exported the batches which were exported earlier.')); } diff --git a/CRM/Financial/Form/FinancialAccount.php b/CRM/Financial/Form/FinancialAccount.php index 6ab82eaed7..bdc0406a5c 100644 --- a/CRM/Financial/Form/FinancialAccount.php +++ b/CRM/Financial/Form/FinancialAccount.php @@ -79,7 +79,7 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form { * @return void */ public function buildQuickForm() { - parent::buildQuickForm( ); + parent::buildQuickForm(); $this->setPageTitle(ts('Financial Account')); if ($this->_action & CRM_Core_Action::DELETE) { @@ -166,7 +166,7 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form { } } } - return CRM_Utils_Array::crmIsEmptyArray( $errorMsg ) ? TRUE : $errorMsg; + return CRM_Utils_Array::crmIsEmptyArray($errorMsg) ? TRUE : $errorMsg; } /** @@ -192,7 +192,7 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form { public function postProcess() { if ($this->_action & CRM_Core_Action::DELETE) { CRM_Financial_BAO_FinancialAccount::del($this->_id); - CRM_Core_Session::setStatus( ts('Selected Financial Account has been deleted.') ); + CRM_Core_Session::setStatus(ts('Selected Financial Account has been deleted.')); } else { $ids = array(); diff --git a/CRM/Financial/Form/FinancialBatch.php b/CRM/Financial/Form/FinancialBatch.php index 4801df5a66..5d75a9b3e5 100644 --- a/CRM/Financial/Form/FinancialBatch.php +++ b/CRM/Financial/Form/FinancialBatch.php @@ -75,7 +75,7 @@ class CRM_Financial_Form_FinancialBatch extends CRM_Contribute_Form { $createdID = CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $this->_id, 'created_id'); if (!empty($permissions[$this->_action])) { - $this->checkPermissions($this->_action, $permissions[$this->_action]['permission'], $createdID, $session->get('userID'), $permissions[$this->_action]['actionName'] ); + $this->checkPermissions($this->_action, $permissions[$this->_action]['permission'], $createdID, $session->get('userID'), $permissions[$this->_action]['actionName']); } } } @@ -89,9 +89,9 @@ class CRM_Financial_Form_FinancialBatch extends CRM_Contribute_Form { parent::buildQuickForm(); $this->setPageTitle(ts('Financial Batch')); - if (isset( $this->_id)) { + if (isset($this->_id)) { $this->_title = CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $this->_id, 'title'); - CRM_Utils_System::setTitle($this->_title .' - '.ts( 'Accounting Batch')); + CRM_Utils_System::setTitle($this->_title .' - '.ts('Accounting Batch')); $this->assign('batchTitle', $this->_title); $contactID = CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $this->_id, 'created_id'); $contactName = CRM_Contact_BAO_Contact::displayName($contactID); @@ -123,7 +123,7 @@ class CRM_Financial_Form_FinancialBatch extends CRM_Contribute_Form { $batchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id'); //unset exported status - $exportedStatusId = CRM_Utils_Array::key('Exported', $batchStatus ); + $exportedStatusId = CRM_Utils_Array::key('Exported', $batchStatus); unset($batchStatus[$exportedStatusId]); $this->add('select', 'status_id', ts('Batch Status'), array('' => ts('- select -')) + $batchStatus, TRUE); $this->freeze(array('status_id')); @@ -274,7 +274,7 @@ class CRM_Financial_Form_FinancialBatch extends CRM_Contribute_Form { $session->replaceUserContext(CRM_Utils_System::url('civicrm', 'reset=1')); } elseif (($buttonName == $this->getButtonName('next') & $this->_action == CRM_Core_Action::UPDATE) || - ($buttonName == $this->getButtonName('next') & $this->_action == CRM_Core_Action::ADD & $context == 1 )) { + ($buttonName == $this->getButtonName('next') & $this->_action == CRM_Core_Action::ADD & $context == 1)) { $session->replaceUserContext(CRM_Utils_System::url('civicrm/financial/financialbatches', "reset=1&batchStatus=1")); } diff --git a/CRM/Financial/Form/FinancialType.php b/CRM/Financial/Form/FinancialType.php index f222b3cac1..ba94904f56 100644 --- a/CRM/Financial/Form/FinancialType.php +++ b/CRM/Financial/Form/FinancialType.php @@ -101,7 +101,7 @@ class CRM_Financial_Form_FinancialType extends CRM_Contribute_Form { $financialType = CRM_Financial_BAO_FinancialType::add($params, $ids); if ($this->_action & CRM_Core_Action::UPDATE) { $url = CRM_Utils_System::url('civicrm/admin/financial/financialType', 'reset=1&action=browse'); - CRM_Core_Session::setStatus(ts('The financial type "%1" has been updated.', array( 1 => $financialType->name)), ts('Saved'), 'success'); + CRM_Core_Session::setStatus(ts('The financial type "%1" has been updated.', array(1 => $financialType->name)), ts('Saved'), 'success'); } else { $url = CRM_Utils_System::url('civicrm/admin/financial/financialType/accounts', 'reset=1&action=browse&aid=' . $financialType->id); diff --git a/CRM/Financial/Form/Search.php b/CRM/Financial/Form/Search.php index 45dfb11ecb..df27a3b326 100644 --- a/CRM/Financial/Form/Search.php +++ b/CRM/Financial/Form/Search.php @@ -66,7 +66,7 @@ class CRM_Financial_Form_Search extends CRM_Core_Form { 'status_id', ts('Batch Status'), array( - '' => ts('- any -' ), + '' => ts('- any -'), array_search('Open', $batchStatus) => ts('Open'), array_search('Closed', $batchStatus) => ts('Closed'), array_search('Exported', $batchStatus) => ts('Exported'), @@ -78,7 +78,7 @@ class CRM_Financial_Form_Search extends CRM_Core_Form { 'select', 'payment_instrument_id', ts('Payment Instrument'), - array('' => ts('- any -' )) + CRM_Contribute_PseudoConstant::paymentInstrument(), + array('' => ts('- any -')) + CRM_Contribute_PseudoConstant::paymentInstrument(), FALSE ); @@ -98,7 +98,7 @@ class CRM_Financial_Form_Search extends CRM_Core_Form { $this->add('select', 'batch_update', - ts('Task' ), + ts('Task'), array('' => ts('- actions -')) + $batchAction); $this->add('submit', 'submit', ts('Go'), diff --git a/CRM/Financial/Page/AJAX.php b/CRM/Financial/Page/AJAX.php index 65d9682fbc..26c0f4aefa 100644 --- a/CRM/Financial/Page/AJAX.php +++ b/CRM/Financial/Page/AJAX.php @@ -214,7 +214,7 @@ class CRM_Financial_Page_AJAX { ); } else { - $response = array('status' => ts("This batch is configured to include only transactions using %1 payment method. If you want to include other transactions, please edit the batch first and modify the Payment Method.", array( 1 => $paymentInstrument))); + $response = array('status' => ts("This batch is configured to include only transactions using %1 payment method. If you want to include other transactions, please edit the batch first and modify the Payment Method.", array(1 => $paymentInstrument))); } break; @@ -493,7 +493,7 @@ class CRM_Financial_Page_AJAX { $status = array('status' => 'record-updated-success'); } else { - $status = array('status' => ts("This batch is configured to include only transactions using %1 payment method. If you want to include other transactions, please edit the batch first and modify the Payment Method.", array( 1 => $paymentInstrument))); + $status = array('status' => ts("This batch is configured to include only transactions using %1 payment method. If you want to include other transactions, please edit the batch first and modify the Payment Method.", array(1 => $paymentInstrument))); } CRM_Utils_JSON::output($status); } diff --git a/CRM/Financial/Page/FinancialAccount.php b/CRM/Financial/Page/FinancialAccount.php index ab83098bee..80e66f871f 100644 --- a/CRM/Financial/Page/FinancialAccount.php +++ b/CRM/Financial/Page/FinancialAccount.php @@ -135,7 +135,7 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic { while ($dao->fetch()) { $contributionType[$dao->id] = array(); - CRM_Core_DAO::storeValues( $dao, $contributionType[$dao->id]); + CRM_Core_DAO::storeValues($dao, $contributionType[$dao->id]); $contributionType[$dao->id]['financial_account_type_id'] = $financialAccountType[$dao->financial_account_type_id]; // form all action links $action = array_sum(array_keys($this->links())); diff --git a/CRM/Financial/Page/FinancialType.php b/CRM/Financial/Page/FinancialType.php index 15269c3827..5903c2ebc5 100644 --- a/CRM/Financial/Page/FinancialType.php +++ b/CRM/Financial/Page/FinancialType.php @@ -140,7 +140,7 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic { while ($dao->fetch()) { $financialType[$dao->id] = array(); - CRM_Core_DAO::storeValues( $dao, $financialType[$dao->id]); + CRM_Core_DAO::storeValues($dao, $financialType[$dao->id]); $defaults = $financialAccountId = array(); $financialAccounts = CRM_Contribute_PseudoConstant::financialAccount(); $financialAccountIds = array(); @@ -152,12 +152,12 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic { foreach ($financialAccountIds as $key => $values) { if (!empty($financialAccounts[$values['financial_account_id']])) { $financialAccountId[$values['financial_account_id']] = CRM_Utils_Array::value( - $values['financial_account_id'], $financialAccounts ); + $values['financial_account_id'], $financialAccounts); } } if (!empty($financialAccountId)) { - $financialType[$dao->id]['financial_account'] = implode( ',', $financialAccountId ); + $financialType[$dao->id]['financial_account'] = implode(',', $financialAccountId); } // form all action links diff --git a/CRM/Financial/Page/FinancialTypeAccount.php b/CRM/Financial/Page/FinancialTypeAccount.php index 5c2303fb6d..cd58c099ee 100644 --- a/CRM/Financial/Page/FinancialTypeAccount.php +++ b/CRM/Financial/Page/FinancialTypeAccount.php @@ -134,7 +134,7 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page { if ($this->_aid) { $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Accounts Receivable Account is' ")); $this->_title = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $this->_aid, 'name'); - CRM_Utils_System::setTitle($this->_title .' - '.ts( 'Assigned Financial Accounts')); + CRM_Utils_System::setTitle($this->_title .' - '.ts('Assigned Financial Accounts')); $financialAccountType = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialAccount', 'financial_account_type_id'); $accountRelationship = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', 'account_relationship'); $dao->copyValues($params); @@ -185,11 +185,11 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page { ); } $this->assign('rows', $financialType); - $this->assign( 'aid', $this->_aid ); + $this->assign('aid', $this->_aid); $this->assign('financialTypeTitle', $this->_title); } else { - CRM_Core_Error::fatal( ); + CRM_Core_Error::fatal(); return NULL; } } @@ -207,15 +207,15 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page { */ public function edit($action) { // create a simple controller for editing CiviCRM Profile data - $controller = new CRM_Core_Controller_Simple( 'CRM_Financial_Form_FinancialTypeAccount', ts('Financial Account Types'), $action ); + $controller = new CRM_Core_Controller_Simple('CRM_Financial_Form_FinancialTypeAccount', ts('Financial Account Types'), $action); // set the userContext stack $session = CRM_Core_Session::singleton(); - $session->pushUserContext( CRM_Utils_System::url( 'civicrm/admin/financial/financialType/accounts', - 'reset=1&action=browse&aid=' . $this->_aid ) ); - $controller->set( 'aid', $this->_aid ); + $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/financial/financialType/accounts', + 'reset=1&action=browse&aid=' . $this->_aid)); + $controller->set('aid', $this->_aid); - $controller->setEmbedded( TRUE ); + $controller->setEmbedded(TRUE); $controller->process(); $controller->run(); } diff --git a/CRM/Friend/Form.php b/CRM/Friend/Form.php index 67dd29e3db..4337dd0415 100644 --- a/CRM/Friend/Form.php +++ b/CRM/Friend/Form.php @@ -305,16 +305,16 @@ class CRM_Friend_Form extends CRM_Core_Form { $this->assign('linkText', $linkText); } } - elseif ( $this->_entityTable == 'civicrm_event' ) { + elseif ($this->_entityTable == 'civicrm_event') { // If this is tell a friend after registering for an event, give donor link to create their own fundraising page require_once 'CRM/PCP/BAO/PCP.php'; - if ( $linkText = CRM_PCP_BAO_PCP::getPcpBlockStatus( $defaults['entity_id'], $defaults['entity_table'] ) ) { - $linkTextUrl = CRM_Utils_System::url( 'civicrm/contribute/campaign', + if ($linkText = CRM_PCP_BAO_PCP::getPcpBlockStatus($defaults['entity_id'], $defaults['entity_table'])) { + $linkTextUrl = CRM_Utils_System::url('civicrm/contribute/campaign', "action=add&reset=1&pageId={$defaults['entity_id']}&component=event", FALSE, NULL, TRUE, - TRUE ); - $this->assign( 'linkTextUrl', $linkTextUrl ); - $this->assign( 'linkText', $linkText ); + TRUE); + $this->assign('linkTextUrl', $linkTextUrl); + $this->assign('linkText', $linkText); } } diff --git a/CRM/Grant/Form/Task.php b/CRM/Grant/Form/Task.php index a0fd862c4a..a0b3b8221a 100644 --- a/CRM/Grant/Form/Task.php +++ b/CRM/Grant/Form/Task.php @@ -102,8 +102,8 @@ class CRM_Grant_Form_Task extends CRM_Core_Form { else { $queryParams = $form->get('queryParams'); $sortOrder = NULL; - if ( $form->get( CRM_Utils_Sort::SORT_ORDER ) ) { - $sortOrder = $form->get( CRM_Utils_Sort::SORT_ORDER ); + if ($form->get(CRM_Utils_Sort::SORT_ORDER )) { + $sortOrder = $form->get(CRM_Utils_Sort::SORT_ORDER); } $query = new CRM_Contact_BAO_Query($queryParams, NULL, NULL, FALSE, FALSE, CRM_Contact_BAO_Query::MODE_GRANT diff --git a/CRM/Import/DataSource/SQL.php b/CRM/Import/DataSource/SQL.php index ca4eb2a7cc..ea1db8fbcc 100644 --- a/CRM/Import/DataSource/SQL.php +++ b/CRM/Import/DataSource/SQL.php @@ -94,7 +94,7 @@ class CRM_Import_DataSource_SQL extends CRM_Import_DataSource { */ public function postProcess(&$params, &$db, &$form) { $importJob = new CRM_Contact_Import_ImportJob( - CRM_Utils_Array::value( 'import_table_name', $params ), + CRM_Utils_Array::value('import_table_name', $params), $params['sqlQuery'], TRUE ); diff --git a/CRM/Logging/Differ.php b/CRM/Logging/Differ.php index f75b638394..abd7ae4567 100644 --- a/CRM/Logging/Differ.php +++ b/CRM/Logging/Differ.php @@ -85,7 +85,7 @@ class CRM_Logging_Differ { $addressCustomTables = $logging->entityCustomDataLogTables('Address'); $contactIdClause = $join = ''; - if ( $contactID ) { + if ($contactID) { $params[3] = array($contactID, 'Integer'); switch ($table) { case 'civicrm_contact': @@ -128,7 +128,7 @@ LEFT JOIN civicrm_activity_contact source ON source.activity_id = lt.id AND sour if (empty($contactIdClause)) { $contactIdClause = "AND contact_id = %3"; } - if ( strpos($table, 'civicrm_value') !== false ) { + if (strpos($table, 'civicrm_value') !== false) { $contactIdClause = "AND entity_id = %3"; } } @@ -169,7 +169,7 @@ WHERE lt.log_conn_id = %1 AND $changedSQL = "SELECT * FROM `{$this->db}`.`log_$table` WHERE log_conn_id = %1 AND log_date >= %2 AND log_date < DATE_ADD(%2, INTERVAL {$this->interval}) AND id = %3 ORDER BY log_date DESC LIMIT 1"; $changedDAO = CRM_Core_DAO::executeQuery($changedSQL, $params); - while ($changedDAO->fetch( )) { + while ($changedDAO->fetch()) { $changed = $changedDAO->toArray(); // return early if nothing found @@ -298,7 +298,7 @@ WHERE lt.log_conn_id = %1 AND $values[$table]['status_id'] = CRM_Case_PseudoConstant::caseStatus('label', FALSE); break; case 'civicrm_activity': - $values[$table]['status_id'] = CRM_Core_PseudoConstant::activityStatus( ); + $values[$table]['status_id'] = CRM_Core_PseudoConstant::activityStatus(); break; } diff --git a/CRM/Logging/Schema.php b/CRM/Logging/Schema.php index 17846862a9..670a754e16 100644 --- a/CRM/Logging/Schema.php +++ b/CRM/Logging/Schema.php @@ -439,7 +439,7 @@ WHERE table_schema IN ('{$this->db}', '{$civiDB}')"; // NOTE: we consider only those columns for modifications where there is a spec change, and that the column definition // wasn't deliberately modified by fixTimeStampAndNotNullSQL() method. foreach ($civiTableSpecs as $col => $colSpecs) { - if (!isset($logTableSpecs[$col]) || !is_array($logTableSpecs[$col]) ) { + if (!isset($logTableSpecs[$col]) || !is_array($logTableSpecs[$col])) { $logTableSpecs[$col] = array(); } @@ -591,7 +591,7 @@ COLS; $columns = $this->columnsOf($table, $force); // only do the change if any data has changed - $cond = array( ); + $cond = array(); foreach ($columns as $column) { // ignore modified_date changes if ($column != 'modified_date' && !in_array($column, CRM_Utils_Array::value($table, $this->exceptions, array()))) { @@ -599,7 +599,7 @@ COLS; } } $suppressLoggingCond = "@civicrm_disable_logging IS NULL OR @civicrm_disable_logging = 0"; - $updateSQL = "IF ( (" . implode( ' OR ', $cond ) . ") AND ( $suppressLoggingCond ) ) THEN "; + $updateSQL = "IF ( (" . implode(' OR ', $cond) . ") AND ( $suppressLoggingCond ) ) THEN "; if ($this->useDBPrefix) { $sqlStmt = "INSERT INTO `{$this->db}`.log_{tableName} ("; @@ -659,11 +659,11 @@ COLS; * * @static */ - public static function disableLoggingForThisConnection( ) { + public static function disableLoggingForThisConnection() { // do this only if logging is enabled - $config = CRM_Core_Config::singleton( ); - if ( $config->logging ) { - CRM_Core_DAO::executeQuery( 'SET @civicrm_disable_logging = 1' ); + $config = CRM_Core_Config::singleton(); + if ($config->logging) { + CRM_Core_DAO::executeQuery('SET @civicrm_disable_logging = 1'); } } diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 94a4c3f8c0..1e0f2afe9b 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -1707,7 +1707,7 @@ ORDER BY civicrm_email.is_bulkmail DESC $job->status = 'Scheduled'; $job->is_test = 0; - if ( !$job->find(TRUE) ) { + if (!$job->find(TRUE)) { $job->scheduled_date = $params['scheduled_date']; $job->save(); } @@ -2910,7 +2910,7 @@ WHERE g.is_hidden = 1 AND mg.group_type = 'Include' AND m.id = %1 "; - $params = array( 1 => array( $mid, 'Integer' ) ); + $params = array(1 => array($mid, 'Integer')); return CRM_Core_DAO::singleValueQuery($sql, $params); } diff --git a/CRM/Mailing/BAO/Query.php b/CRM/Mailing/BAO/Query.php index 979dbcc302..d7bd9f489a 100644 --- a/CRM/Mailing/BAO/Query.php +++ b/CRM/Mailing/BAO/Query.php @@ -251,8 +251,8 @@ class CRM_Mailing_BAO_Query { return; case 'mailing_name': - $value = strtolower( addslashes( $value ) ); - if ( $wildcard ) { + $value = strtolower(addslashes($value)); + if ($wildcard) { $value = "%$value%"; $op = 'LIKE'; } diff --git a/CRM/Mailing/BAO/Spool.php b/CRM/Mailing/BAO/Spool.php index 05b8a79e19..9da14d2198 100644 --- a/CRM/Mailing/BAO/Spool.php +++ b/CRM/Mailing/BAO/Spool.php @@ -71,7 +71,7 @@ class CRM_Mailing_BAO_Spool extends CRM_Mailing_DAO_Spool { } $headerStr = implode("\n", $headerStr); - if ( is_null( $job_id ) ) { + if (is_null($job_id)) { // This is not a bulk mailing. Create a dummy job for it. $session = CRM_Core_Session::singleton(); @@ -82,14 +82,14 @@ class CRM_Mailing_BAO_Spool extends CRM_Mailing_DAO_Spool { $params['scheduled_date'] = $params['created_date']; $params['is_completed'] = 1; $params['is_archived'] = 1; - $params['body_html'] = htmlspecialchars( $headerStr ) . "\n\n" . $body; + $params['body_html'] = htmlspecialchars($headerStr) . "\n\n" . $body; $params['subject'] = $headers['Subject']; $params['name'] = $headers['Subject']; $ids = array(); $mailing = CRM_Mailing_BAO_Mailing::create($params, $ids); - if ( empty( $mailing ) || is_a( $mailing, 'CRM_Core_Error' ) ) { - return PEAR::raiseError( 'Unable to create spooled mailing.' ); + if (empty($mailing) || is_a($mailing, 'CRM_Core_Error')) { + return PEAR::raiseError('Unable to create spooled mailing.'); } $job = new CRM_Mailing_BAO_MailingJob(); @@ -114,8 +114,8 @@ class CRM_Mailing_BAO_Spool extends CRM_Mailing_DAO_Spool { $job->save(); $job_id = $job->id; // this is the one we want for the spool - if ( is_array( $recipient ) ) { - $recipient = implode( ';', $recipient ); + if (is_array($recipient)) { + $recipient = implode(';', $recipient); } } diff --git a/CRM/Mailing/Event/BAO/Opened.php b/CRM/Mailing/Event/BAO/Opened.php index 5810f76936..3ddef2935e 100755 --- a/CRM/Mailing/Event/BAO/Opened.php +++ b/CRM/Mailing/Event/BAO/Opened.php @@ -160,7 +160,7 @@ class CRM_Mailing_Event_BAO_Opened extends CRM_Mailing_Event_DAO_Opened { $dao->query($query); - while ( $dao->fetch() ) { + while ($dao->fetch()) { $openedCount[$dao->mailingID] = $dao->opened; } return $openedCount; @@ -201,7 +201,7 @@ class CRM_Mailing_Event_BAO_Opened extends CRM_Mailing_Event_DAO_Opened { $dao->query($query); - while ( $dao->fetch() ) { + while ($dao->fetch()) { $openedCount[$dao->mailingID] = $dao->opened; } diff --git a/CRM/Mailing/Event/BAO/TrackableURLOpen.php b/CRM/Mailing/Event/BAO/TrackableURLOpen.php index 42641297f6..dbb19e056a 100755 --- a/CRM/Mailing/Event/BAO/TrackableURLOpen.php +++ b/CRM/Mailing/Event/BAO/TrackableURLOpen.php @@ -191,7 +191,7 @@ class CRM_Mailing_Event_BAO_TrackableURLOpen extends CRM_Mailing_Event_DAO_Track $dao->query($query); - while ( $dao->fetch() ) { + while ($dao->fetch()) { $clickCount[$dao->mailingID] = $dao->opened; } return $clickCount; @@ -232,7 +232,7 @@ class CRM_Mailing_Event_BAO_TrackableURLOpen extends CRM_Mailing_Event_DAO_Track $dao->query($query); - while ( $dao->fetch() ) { + while ($dao->fetch()) { $clickCount[$dao->mailingID] = $dao->opened; } diff --git a/CRM/Mailing/Form/Optout.php b/CRM/Mailing/Form/Optout.php index 06038bcb2c..a2b2c4240d 100644 --- a/CRM/Mailing/Form/Optout.php +++ b/CRM/Mailing/Form/Optout.php @@ -111,7 +111,7 @@ class CRM_Mailing_Form_Optout extends CRM_Core_Form { array(1 => $values['email_confirm']) ); - CRM_Core_Session::setStatus( $statusMsg, '', 'success' ); + CRM_Core_Session::setStatus($statusMsg, '', 'success'); } elseif ($result == FALSE) { // Email address not verified @@ -120,7 +120,7 @@ class CRM_Mailing_Form_Optout extends CRM_Core_Form { array(1 => $values['email_confirm']) ); - CRM_Core_Session::setStatus( $statusMsg, '', 'fail' ); + CRM_Core_Session::setStatus($statusMsg, '', 'fail'); } } diff --git a/CRM/Mailing/Form/Task.php b/CRM/Mailing/Form/Task.php index de298f6e8c..b49e260fca 100644 --- a/CRM/Mailing/Form/Task.php +++ b/CRM/Mailing/Form/Task.php @@ -94,8 +94,8 @@ class CRM_Mailing_Form_Task extends CRM_Core_Form { else { $queryParams = $form->get('queryParams'); $sortOrder = NULL; - if ( $form->get( CRM_Utils_Sort::SORT_ORDER ) ) { - $sortOrder = $form->get( CRM_Utils_Sort::SORT_ORDER ); + if ($form->get(CRM_Utils_Sort::SORT_ORDER )) { + $sortOrder = $form->get(CRM_Utils_Sort::SORT_ORDER); } $query = new CRM_Contact_BAO_Query($queryParams, NULL, NULL, FALSE, FALSE, diff --git a/CRM/Mailing/Form/Unsubscribe.php b/CRM/Mailing/Form/Unsubscribe.php index 92bd3c767b..76d1964691 100644 --- a/CRM/Mailing/Form/Unsubscribe.php +++ b/CRM/Mailing/Form/Unsubscribe.php @@ -74,7 +74,7 @@ class CRM_Mailing_Form_Unsubscribe extends CRM_Core_Form { $statusMsg = ts('Email: %1 has been successfully unsubscribed from this Mailing List/Group.', array(1 => $email) ); - CRM_Core_Session::setStatus( $statusMsg, '', 'fail' ); + CRM_Core_Session::setStatus($statusMsg, '', 'fail'); } $this->assign('groupExist', $groupExist); @@ -131,7 +131,7 @@ class CRM_Mailing_Form_Unsubscribe extends CRM_Core_Form { array(1 => $values['email_confirm']) ); - CRM_Core_Session::setStatus( $statusMsg, '', 'success' ); + CRM_Core_Session::setStatus($statusMsg, '', 'success'); } elseif ($result == FALSE) { // Email address not verified @@ -140,7 +140,7 @@ class CRM_Mailing_Form_Unsubscribe extends CRM_Core_Form { array(1 => $values['email_confirm']) ); - CRM_Core_Session::setStatus( $statusMsg, '', 'fail' ); + CRM_Core_Session::setStatus($statusMsg, '', 'fail'); } diff --git a/CRM/Mailing/Info.php b/CRM/Mailing/Info.php index cb954343e7..8ca35331d4 100644 --- a/CRM/Mailing/Info.php +++ b/CRM/Mailing/Info.php @@ -106,7 +106,7 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info { )); } $mailGrp = civicrm_api3('MailingGroup', 'get', array()); - $mailTokens = civicrm_api3('Mailing', 'get_token', array( 'usage' => 'Mailing')); + $mailTokens = civicrm_api3('Mailing', 'get_token', array('usage' => 'Mailing')); $fromAddress = civicrm_api3('OptionGroup', 'get', array( 'sequential' => 1, 'name' => "from_email_address", diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php index 1edeb1609e..d09f7d7274 100644 --- a/CRM/Member/BAO/MembershipType.php +++ b/CRM/Member/BAO/MembershipType.php @@ -522,7 +522,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { switch ($membershipTypeDetails['duration_unit']) { case 'year': //need to check if the upsell is from rolling to fixed and adjust accordingly - if ($membershipTypeDetails['period_type'] == 'fixed' && $oldPeriodType == 'rolling' ) { + if ($membershipTypeDetails['period_type'] == 'fixed' && $oldPeriodType == 'rolling') { $month = substr($membershipTypeDetails['fixed_period_start_day'], 0, strlen($membershipTypeDetails['fixed_period_start_day']) - 2); $day = substr($membershipTypeDetails['fixed_period_start_day'], -2); $year += 1; @@ -656,7 +656,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { $query = 'SELECT memType.id, memType.name, memType.member_of_contact_id, c.sort_name FROM civicrm_membership_type memType INNER JOIN civicrm_contact c ON c.id = memType.member_of_contact_id WHERE memType.is_active = 1 '; - $dao = CRM_Core_DAO::executeQuery( $query ); + $dao = CRM_Core_DAO::executeQuery($query); while ($dao->fetch()) { $orgs[$dao->member_of_contact_id] = $dao->sort_name; $types[$dao->member_of_contact_id][$dao->id] = $dao->name; diff --git a/CRM/Member/BAO/Query.php b/CRM/Member/BAO/Query.php index 753a4f8172..1d14d1ca45 100644 --- a/CRM/Member/BAO/Query.php +++ b/CRM/Member/BAO/Query.php @@ -206,7 +206,7 @@ class CRM_Member_BAO_Query { if (!is_array($value)) { $status = $value; if (!empty($value)) { - $value = array_flip(explode(",", str_replace(array( '(', ')' ), '', $value))); + $value = array_flip(explode(",", str_replace(array('(', ')'), '', $value))); } else { $value = array(); @@ -287,7 +287,7 @@ class CRM_Member_BAO_Query { if (!is_array($value)) { $mType = $value; if (!empty($value)) { - $value = array_flip(explode(",", str_replace(array( '(', ')' ), '', $value))); + $value = array_flip(explode(",", str_replace(array('(', ')'), '', $value))); } else { $value = array(); diff --git a/CRM/Member/Form.php b/CRM/Member/Form.php index 36b2284077..5e58261d08 100644 --- a/CRM/Member/Form.php +++ b/CRM/Member/Form.php @@ -212,8 +212,8 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment { // here we store details in order to do that if (!empty($formValues['soft_credit_contact_id'])) { $this->_receiptContactId = $this->_contributorContactID = $formValues['soft_credit_contact_id']; - list( $this->_contributorDisplayName, - $this->_contributorEmail ) = CRM_Contact_BAO_Contact_Location::getEmailDetails( $this->_contributorContactID ); + list($this->_contributorDisplayName, + $this->_contributorEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contributorContactID); } else { $this->_receiptContactId = $this->_contributorContactID = $this->_contactID; diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 519e078f56..7a6eb5d91c 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -887,7 +887,7 @@ WHERE id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )'; foreach ($tmp_statuses as $cur_stat) { $status_ids[] = $cur_stat['id']; } - if (empty($params['status_id']) || in_array( $params['status_id'], $status_ids) == FALSE) { + if (empty($params['status_id']) || in_array($params['status_id'], $status_ids) == FALSE) { $errors['status_id'] = ts('Please enter a status that does NOT represent a current membership status.'); $errors['is_override'] = ts('This must be checked because you set an End Date for a lifetime membership'); } @@ -1836,7 +1836,7 @@ WHERE id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )'; $form->_receiptContactId = $formValues['contact_id']; } } - $template = CRM_Core_Smarty::singleton( ); + $template = CRM_Core_Smarty::singleton(); $taxAmt = $template->get_template_vars('dataArray'); $eventTaxAmt = $template->get_template_vars('totalTaxAmount'); $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings'); diff --git a/CRM/Member/Form/MembershipBlock.php b/CRM/Member/Form/MembershipBlock.php index 1a8a3e123c..5291faa142 100644 --- a/CRM/Member/Form/MembershipBlock.php +++ b/CRM/Member/Form/MembershipBlock.php @@ -364,14 +364,14 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa } $setParams['is_quick_config'] = 1; $setParams['extends'] = CRM_Core_Component::getComponentID('CiviMember'); - $setParams['financial_type_id'] = CRM_Utils_Array::value( 'financial_type_id', $this->_values ); + $setParams['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $this->_values); $priceSet = CRM_Price_BAO_PriceSet::create($setParams); $priceSetID = $priceSet->id; $fieldParams['price_set_id'] = $priceSet->id; } elseif ($usedPriceSetId) { $setParams['extends'] = CRM_Core_Component::getComponentID('CiviMember'); - $setParams['financial_type_id'] = CRM_Utils_Array::value( 'financial_type_id', $this->_values ); + $setParams['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $this->_values); $setParams['id'] = $usedPriceSetId; $priceSet = CRM_Price_BAO_PriceSet::create($setParams); $priceSetID = $priceSet->id; @@ -441,7 +441,7 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa if ($priceSetID) { $params['membership_types'] = 'null'; $params['membership_type_default'] = CRM_Utils_Array::value('membership_type_default', $params, 'null'); - $params['membership_types'] = serialize( $membershipTypes ); + $params['membership_types'] = serialize($membershipTypes); $params['display_min_fee'] = CRM_Utils_Array::value('display_min_fee', $params, FALSE); $params['is_separate_payment'] = CRM_Utils_Array::value('is_separate_payment', $params, FALSE); } diff --git a/CRM/Member/Form/MembershipRenewal.php b/CRM/Member/Form/MembershipRenewal.php index 56c3879ef0..4e621ff87e 100644 --- a/CRM/Member/Form/MembershipRenewal.php +++ b/CRM/Member/Form/MembershipRenewal.php @@ -267,7 +267,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form { // auto renew options if enabled for the membership $options = CRM_Core_SelectValues::memberAutoRenew(); - foreach ($allMemberships as $key => $values ) { + foreach ($allMemberships as $key => $values) { if (!empty($values['is_active'])) { $membershipType[$key] = CRM_Utils_Array::value('name', $values); if ($this->_mode && empty($values['minimum_fee'])) { @@ -506,7 +506,7 @@ WHERE id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )'; ); } - $now = CRM_Utils_Date::getToday( NULL, 'YmdHis'); + $now = CRM_Utils_Date::getToday(NULL, 'YmdHis'); $this->convertDateFieldsToMySQL($formValues); $this->assign('receive_date', $formValues['receive_date']); diff --git a/CRM/Member/Form/MembershipType.php b/CRM/Member/Form/MembershipType.php index 2b62a415de..4d680144fc 100644 --- a/CRM/Member/Form/MembershipType.php +++ b/CRM/Member/Form/MembershipType.php @@ -45,7 +45,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig { const MAX_CONTACTS = 50; public function preProcess() { - $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0 ); + $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0); $this->_BAOName = 'CRM_Member_BAO_MembershipType'; $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add'); $this->assign('action', $this->_action); @@ -169,7 +169,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig { CRM_Core_SelectValues::date(NULL, 'd'), FALSE ); - $this->add('select', 'financial_type_id', ts( 'Financial Type' ), + $this->add('select', 'financial_type_id', ts('Financial Type'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType(), TRUE, array('class' => 'crm-select2') ); @@ -225,7 +225,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig { $errors['name'] = ts('Please enter a membership type name.'); } - if (($params['minimum_fee'] > 0 ) && !$params['financial_type_id'] ) { + if (($params['minimum_fee'] > 0) && !$params['financial_type_id']) { $errors['financial_type_id'] = ts('Please enter the financial Type.'); } diff --git a/CRM/Member/Form/Task.php b/CRM/Member/Form/Task.php index 2da2220560..61f061a91e 100644 --- a/CRM/Member/Form/Task.php +++ b/CRM/Member/Form/Task.php @@ -109,8 +109,8 @@ class CRM_Member_Form_Task extends CRM_Core_Form { else { $queryParams = $form->get('queryParams'); $sortOrder = NULL; - if ( $form->get( CRM_Utils_Sort::SORT_ORDER ) ) { - $sortOrder = $form->get( CRM_Utils_Sort::SORT_ORDER ); + if ($form->get(CRM_Utils_Sort::SORT_ORDER )) { + $sortOrder = $form->get(CRM_Utils_Sort::SORT_ORDER); } $query = new CRM_Contact_BAO_Query($queryParams, NULL, NULL, FALSE, FALSE, CRM_Contact_BAO_Query::MODE_MEMBER diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index 3c4a41721a..28893d64d5 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -316,11 +316,11 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { break; } if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) { - if ( $customFields[$customFieldID]['data_type'] == 'Date' ) { + if ($customFields[$customFieldID]['data_type'] == 'Date') { CRM_Contact_Import_Parser_Contact::formatCustomDate($params, $formatted, $dateType, $key); unset($params[$key]); } - elseif ( $customFields[$customFieldID]['data_type'] == 'Boolean' ) { + elseif ($customFields[$customFieldID]['data_type'] == 'Boolean') { $params[$key] = CRM_Utils_String::strtoboolstr($val); } } @@ -636,7 +636,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { $fields = CRM_Member_DAO_Membership::fields(); _civicrm_api3_store_values($fields, $params, $values); - $customFields = CRM_Core_BAO_CustomField::getFields( 'Membership'); + $customFields = CRM_Core_BAO_CustomField::getFields('Membership'); foreach ($params as $key => $value) { // ignore empty values or empty arrays etc @@ -649,15 +649,15 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { $values[$key] = $value; $type = $customFields[$customFieldID]['html_type']; if ($type == 'CheckBox' || $type == 'Multi-Select' || $type == 'AdvMulti-Select') { - $mulValues = explode( ',', $value ); + $mulValues = explode(',', $value); $customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, TRUE); $values[$key] = array(); - foreach ($mulValues as $v1 ) { + foreach ($mulValues as $v1) { foreach ($customOption as $customValueID => $customLabel) { $customValue = $customLabel['value']; - if (( strtolower($customLabel['label']) == strtolower(trim($v1)) ) || - ( strtolower($customValue) == strtolower(trim($v1)) )) { - if ( $type == 'CheckBox' ) { + if ((strtolower($customLabel['label']) == strtolower(trim($v1))) || + (strtolower($customValue) == strtolower(trim($v1)))) { + if ($type == 'CheckBox') { $values[$key][$customValue] = 1; } else { diff --git a/CRM/Member/Page/AJAX.php b/CRM/Member/Page/AJAX.php index 7c0aad0d9e..580840eb87 100644 --- a/CRM/Member/Page/AJAX.php +++ b/CRM/Member/Page/AJAX.php @@ -56,7 +56,7 @@ FROM civicrm_membership_type WHERE id = %1"; $dao = CRM_Core_DAO::executeQuery($query, array(1 => array($memType, 'Positive'))); - $properties = array( 'financial_type_id', 'total_amount', 'name', 'auto_renew' ); + $properties = array('financial_type_id', 'total_amount', 'name', 'auto_renew'); while ($dao->fetch()) { foreach ($properties as $property) { $details[$property] = $dao->$property; diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php index 5004305d44..506944d823 100644 --- a/CRM/Member/Page/Tab.php +++ b/CRM/Member/Page/Tab.php @@ -366,7 +366,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { * @param int $contactId */ public static function setContext(&$form, $contactId = NULL) { - $context = CRM_Utils_Request::retrieve('context', 'String', $form, FALSE, 'search' ); + $context = CRM_Utils_Request::retrieve('context', 'String', $form, FALSE, 'search'); $qfKey = CRM_Utils_Request::retrieve('key', 'String', $form); diff --git a/CRM/Member/Page/UserDashboard.php b/CRM/Member/Page/UserDashboard.php index 4bc2cd536a..d1c0ad4aeb 100644 --- a/CRM/Member/Page/UserDashboard.php +++ b/CRM/Member/Page/UserDashboard.php @@ -73,9 +73,9 @@ class CRM_Member_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard if ($defaultRenewPageId) { //CRM-14831 - check if membership type is present in contrib page $memBlock = CRM_Member_BAO_Membership::getMembershipBlock($defaultRenewPageId); - if ( !empty($memBlock['membership_types']) ) { + if (!empty($memBlock['membership_types'])) { $memTypes = explode(',', $memBlock['membership_types']); - if ( in_array($dao->membership_type_id, $memTypes) ) { + if (in_array($dao->membership_type_id, $memTypes)) { $membership[$dao->id]['renewPageId'] = $defaultRenewPageId; } } diff --git a/CRM/Member/Task.php b/CRM/Member/Task.php index 6032645fb8..fad45d85e5 100644 --- a/CRM/Member/Task.php +++ b/CRM/Member/Task.php @@ -118,7 +118,7 @@ class CRM_Member_Task { unset(self::$_tasks[1]); } //CRM-12920 - check for edit permission - if (!CRM_Core_Permission::check('edit memberships') ) { + if (!CRM_Core_Permission::check('edit memberships')) { unset(self::$_tasks[5]); } } diff --git a/CRM/PCP/BAO/PCP.php b/CRM/PCP/BAO/PCP.php index 66b74e8e9d..47d008585b 100644 --- a/CRM/PCP/BAO/PCP.php +++ b/CRM/PCP/BAO/PCP.php @@ -526,7 +526,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; } // define redirect url back to contrib page or event if needed - $url = CRM_Utils_System::url($urlBase, "reset=1&id={$pcpBlock['entity_id']}", FALSE, NULL, FALSE, TRUE ); + $url = CRM_Utils_System::url($urlBase, "reset=1&id={$pcpBlock['entity_id']}", FALSE, NULL, FALSE, TRUE); if ($pcpBlock['target_entity_id'] != $entity['id']) { $statusMessage = ts('This page is not related to the Personal Campaign Page you have just visited. However you can still make a contribution here.'); diff --git a/CRM/PCP/Form/Campaign.php b/CRM/PCP/Form/Campaign.php index 24bcf2ca53..53ca89d3dc 100644 --- a/CRM/PCP/Form/Campaign.php +++ b/CRM/PCP/Form/Campaign.php @@ -120,7 +120,7 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form { } $attrib = array('rows' => 8, 'cols' => 60); - $this->add('textarea', 'page_text', ts('Your Message'), NULL, FALSE ); + $this->add('textarea', 'page_text', ts('Your Message'), NULL, FALSE); $maxAttachments = 1; CRM_Core_BAO_File::buildAttachment($this, 'civicrm_pcp', $this->_pageId, $maxAttachments); @@ -176,7 +176,7 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form { * @return void */ public function postProcess() { - $params = $this->controller->exportValues( $this->_name ); + $params = $this->controller->exportValues($this->_name); $checkBoxes = array('is_thermometer', 'is_honor_roll', 'is_active'); foreach ($checkBoxes as $key) { @@ -197,9 +197,9 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form { // since we are allowing html input from the user // we also need to purify it, so lets clean it up - $htmlFields = array( 'intro_text', 'page_text', 'title' ); - foreach ( $htmlFields as $field ) { - if ( ! empty($params[$field]) ) { + $htmlFields = array('intro_text', 'page_text', 'title'); + foreach ($htmlFields as $field) { + if (! empty($params[$field])) { $params[$field] = CRM_Utils_String::purifyHTML($params[$field]); } } diff --git a/CRM/Pledge/BAO/Query.php b/CRM/Pledge/BAO/Query.php index d3c66d5416..d8a748c9bf 100644 --- a/CRM/Pledge/BAO/Query.php +++ b/CRM/Pledge/BAO/Query.php @@ -294,7 +294,7 @@ class CRM_Pledge_BAO_Query { } } else { - if (!empty($value) ) { + if (!empty($value)) { $names[] = $statusValues[$value]; } } @@ -336,7 +336,7 @@ class CRM_Pledge_BAO_Query { } } else { - if (!empty($value) ) { + if (!empty($value)) { $names[] = $statusValues[$value]; } } @@ -373,7 +373,7 @@ class CRM_Pledge_BAO_Query { $value, 'Integer' ); - $query->_qill[$grouping][] = ts( 'Financial Type - %1', array( 1 => $type ) ); + $query->_qill[$grouping][] = ts('Financial Type - %1', array(1 => $type)); $query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1; return; @@ -575,7 +575,7 @@ class CRM_Pledge_BAO_Query { $form->addGroup($paymentStatus, 'pledge_payment_status_id', ts('Pledge Payment Status')); $form->add('select', 'pledge_financial_type_id', - ts( 'Financial Type' ), + ts('Financial Type'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType(), FALSE, array('class' => 'crm-select2') ); diff --git a/CRM/Pledge/Form/Pledge.php b/CRM/Pledge/Form/Pledge.php index 39a2830f9e..37218ae44c 100644 --- a/CRM/Pledge/Form/Pledge.php +++ b/CRM/Pledge/Form/Pledge.php @@ -183,7 +183,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $defaults['max_reminders'] = 1; $defaults['additional_reminder_day'] = 5; $defaults['frequency_unit'] = array_search('month', $this->_freqUnits); - $defaults['financial_type_id'] = array_search( 'Donation', CRM_Contribute_PseudoConstant::financialType() ); + $defaults['financial_type_id'] = array_search('Donation', CRM_Contribute_PseudoConstant::financialType()); } $pledgeStatus = CRM_Contribute_PseudoConstant::contributionStatus(); @@ -379,8 +379,8 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $this->addDate('acknowledge_date', ts('Acknowledgment Date')); $this->add('select', 'financial_type_id', - ts( 'Financial Type' ), - array('' => ts( '- select -' )) + CRM_Contribute_PseudoConstant::financialType( ), + ts('Financial Type'), + array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType(), TRUE ); diff --git a/CRM/Pledge/Form/PledgeView.php b/CRM/Pledge/Form/PledgeView.php index 12bf4918e9..17968e93e0 100644 --- a/CRM/Pledge/Form/PledgeView.php +++ b/CRM/Pledge/Form/PledgeView.php @@ -75,7 +75,7 @@ class CRM_Pledge_Form_PledgeView extends CRM_Core_Form { $values['contribution_page'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $values['contribution_page_id'], 'title'); } - $values['financial_type'] = CRM_Utils_Array::value( $values['financial_type_id'], CRM_Contribute_PseudoConstant::financialType() ); + $values['financial_type'] = CRM_Utils_Array::value($values['financial_type_id'], CRM_Contribute_PseudoConstant::financialType()); if ($values['status_id']) { $values['pledge_status'] = CRM_Utils_Array::value($values['status_id'], CRM_Contribute_PseudoConstant::contributionStatus()); @@ -101,7 +101,7 @@ class CRM_Pledge_Form_PledgeView extends CRM_Core_Form { $this->assign('displayName', $displayName); $title = $displayName . - ' - (' . ts('Pledged') . ' ' . CRM_Utils_Money::format( $values['pledge_amount'] ) . + ' - (' . ts('Pledged') . ' ' . CRM_Utils_Money::format($values['pledge_amount']) . ' - ' . $values['financial_type'] . ')'; // add Pledge to Recent Items diff --git a/CRM/Pledge/Form/Task.php b/CRM/Pledge/Form/Task.php index 7960c30a96..72a4ff6bc4 100644 --- a/CRM/Pledge/Form/Task.php +++ b/CRM/Pledge/Form/Task.php @@ -102,8 +102,8 @@ class CRM_Pledge_Form_Task extends CRM_Core_Form { else { $queryParams = $form->get('queryParams'); $sortOrder = NULL; - if ( $form->get( CRM_Utils_Sort::SORT_ORDER ) ) { - $sortOrder = $form->get( CRM_Utils_Sort::SORT_ORDER ); + if ($form->get(CRM_Utils_Sort::SORT_ORDER )) { + $sortOrder = $form->get(CRM_Utils_Sort::SORT_ORDER); } $query = new CRM_Contact_BAO_Query($queryParams, NULL, NULL, FALSE, FALSE, CRM_Contact_BAO_Query::MODE_PLEDGE diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index 130a509d5b..8730182b90 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -146,7 +146,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $options['membership_num_terms'] = CRM_Utils_Array::value($index, CRM_Utils_Array::value('membership_num_terms', $params), 1); } - if (CRM_Utils_Array::value( $index, CRM_Utils_Array::value('option_financial_type_id', $params))) { + if (CRM_Utils_Array::value($index, CRM_Utils_Array::value('option_financial_type_id', $params))) { $options['financial_type_id'] = $params['option_financial_type_id'][$index]; } elseif (!empty($params['financial_type_id'])) { @@ -266,7 +266,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $is_pay_later = 1; } elseif (isset($qf->_values)) { - $is_pay_later = CRM_Utils_Array::value( 'is_pay_later', $qf->_values); + $is_pay_later = CRM_Utils_Array::value('is_pay_later', $qf->_values); } $otherAmount = $qf->get('values'); @@ -340,7 +340,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $useRequired && $field->is_required ); if ($is_pay_later) { - $qf->add( 'text', 'txt-'.$elementName, $label, array( 'size' => '4')); + $qf->add('text', 'txt-'.$elementName, $label, array('size' => '4')); } // CRM-6902 - Add "max" option for a price set field @@ -412,7 +412,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $choice[$opId] = $qf->createElement('radio', NULL, '', $opt['label'], $opt['id'], $extra); if ($is_pay_later) { - $qf->add( 'text', 'txt-'.$elementName, $label, array( 'size' => '4')); + $qf->add('text', 'txt-'.$elementName, $label, array('size' => '4')); } // CRM-6902 - Add "max" option for a price set field @@ -492,7 +492,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $selectOption[$opt['id']] = $opt['label']; if ($is_pay_later) { - $qf->add( 'text', 'txt-'.$elementName, $label, array( 'size' => '4')); + $qf->add('text', 'txt-'.$elementName, $label, array('size' => '4')); } } @@ -535,7 +535,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { ) ); if ($is_pay_later) { - $txtcheck[$opId] =& $qf->createElement( 'text', $opId, $opt['label'], array( 'size' => '4' ) ); + $txtcheck[$opId] =& $qf->createElement('text', $opId, $opt['label'], array('size' => '4')); $qf->addGroup($txtcheck, 'txt-'.$elementName, $label); } // CRM-6902 - Add "max" option for a price set field diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index 2ce05eb47b..a6c79179f7 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -882,7 +882,7 @@ WHERE id = %1"; unset($autoRenew[$dontCare]); } } - if (count($autoRenew) > 1 ) { + if (count($autoRenew) > 1) { $params['autoRenew'] = $autoRenew; } } diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 2bd9c42560..3bcc0e73d9 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -358,7 +358,7 @@ class CRM_Profile_Form extends CRM_Core_Form { } elseif (!empty($this->_multiRecordFields) - && (!$this->_multiRecord || !in_array($this->_multiRecord, array(CRM_Core_Action::DELETE, CRM_Core_Action::UPDATE)) )) { + && (!$this->_multiRecord || !in_array($this->_multiRecord, array(CRM_Core_Action::DELETE, CRM_Core_Action::UPDATE)))) { CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header'); //multirecord listing page $multiRecordFieldListing = TRUE; diff --git a/CRM/Profile/Page/MultipleRecordFieldsListing.php b/CRM/Profile/Page/MultipleRecordFieldsListing.php index 5e2bd8bef1..00ad9c2876 100644 --- a/CRM/Profile/Page/MultipleRecordFieldsListing.php +++ b/CRM/Profile/Page/MultipleRecordFieldsListing.php @@ -80,17 +80,17 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { // names and titles $links[CRM_Core_Action::VIEW] = array( 'name' => ts('View'), - 'title' => ts('View %1', array( 1 => $this->_customGroupTitle . ' record')), + 'title' => ts('View %1', array(1 => $this->_customGroupTitle . ' record')), ); $links[CRM_Core_Action::UPDATE] = array( 'name' => ts('Edit'), - 'title' => ts('Edit %1', array( 1 => $this->_customGroupTitle . ' record')), + 'title' => ts('Edit %1', array(1 => $this->_customGroupTitle . ' record')), ); $links[CRM_Core_Action::DELETE] = array( 'name' => ts('Delete'), - 'title' => ts('Delete %1', array( 1 => $this->_customGroupTitle . ' record')), + 'title' => ts('Delete %1', array(1 => $this->_customGroupTitle . ' record')), ); // urls and queryStrings @@ -118,7 +118,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { // copy action $links[CRM_Core_Action::COPY] = array( 'name' => ts('Copy'), - 'title' => ts('Copy %1', array( 1 => $this->_customGroupTitle . ' record')), + 'title' => ts('Copy %1', array(1 => $this->_customGroupTitle . ' record')), 'url' => 'civicrm/contact/view/cd/edit', 'qs' => 'reset=1&type=%%type%%&groupID=%%groupID%%&entityID=%%entityID%%&cgcount=%%newCgCount%%&multiRecordDisplay=single©ValueId=%%cgcount%%&mode=copy' ); diff --git a/CRM/Report/Form/Contact/LoggingSummary.php b/CRM/Report/Form/Contact/LoggingSummary.php index 5cde591ab1..607bda814e 100644 --- a/CRM/Report/Form/Contact/LoggingSummary.php +++ b/CRM/Report/Form/Contact/LoggingSummary.php @@ -40,7 +40,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { parent::__construct(); $logTypes = array(); - foreach ( array_keys($this->_logTables) as $table ) { + foreach (array_keys($this->_logTables) as $table) { $type = $this->getLogType($table); $logTypes[$type] = $type; } @@ -189,7 +189,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { } if ('Contact' == CRM_Utils_Array::value('log_type', $this->_logTables[$row['log_civicrm_entity_log_type']]) && - CRM_Utils_Array::value('log_civicrm_entity_log_action', $row) == 'Insert' ) { + CRM_Utils_Array::value('log_civicrm_entity_log_action', $row) == 'Insert') { $row['log_civicrm_entity_log_action'] = ts('Update'); } @@ -238,7 +238,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { */ public function from($logTable = NULL) { static $entity = NULL; - if ( $logTable ) { + if ($logTable) { $entity = $logTable; } diff --git a/CRM/Report/Form/Instance.php b/CRM/Report/Form/Instance.php index 52cb666737..0e47961d23 100644 --- a/CRM/Report/Form/Instance.php +++ b/CRM/Report/Form/Instance.php @@ -215,7 +215,7 @@ class CRM_Report_Form_Instance { $navigationDefaults = array(); if (!isset($defaults['permission'])) { - $permissions = array_flip(CRM_Core_Permission::basicPermissions( )); + $permissions = array_flip(CRM_Core_Permission::basicPermissions()); $defaults['permission'] = $permissions['CiviReport: access CiviReport']; } @@ -323,7 +323,7 @@ class CRM_Report_Form_Instance { } CRM_Core_Session::setStatus($statusMsg); - if ( $redirect ) { + if ($redirect) { CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/report/instance/{$instance->id}", "reset=1")); } } diff --git a/CRM/Report/Page/InstanceList.php b/CRM/Report/Page/InstanceList.php index 1352a22446..7b872697e5 100644 --- a/CRM/Report/Page/InstanceList.php +++ b/CRM/Report/Page/InstanceList.php @@ -41,7 +41,7 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { static $_links = NULL; - static $_exceptions = array( 'logging/contact/detail' ); + static $_exceptions = array('logging/contact/detail'); /** * Name of component if report list is filtered diff --git a/CRM/Report/Utils/Report.php b/CRM/Report/Utils/Report.php index 765bb47271..f32b631a9a 100644 --- a/CRM/Report/Utils/Report.php +++ b/CRM/Report/Utils/Report.php @@ -544,7 +544,7 @@ WHERE inst.report_id = %1"; public static function getInstanceList($reportUrl) { static $instanceDetails = array(); - if (!array_key_exists($reportUrl, $instanceDetails )) { + if (!array_key_exists($reportUrl, $instanceDetails)) { $instanceDetails[$reportUrl] = array(); $sql = " diff --git a/CRM/Upgrade/Incremental/php/FourFour.php b/CRM/Upgrade/Incremental/php/FourFour.php index 8f08205e46..7746f1bbcf 100644 --- a/CRM/Upgrade/Incremental/php/FourFour.php +++ b/CRM/Upgrade/Incremental/php/FourFour.php @@ -550,7 +550,7 @@ WHERE option_group_id = {$optionGroupID} AND value IN ($ovValues)"; $value[] = "({$optionGroupID}, 'Activity Targets', 3, 'Activity Targets', 3, 1, 1)"; } - if (!$assigneeID || !$sourceID || !$targetID ) { + if (!$assigneeID || !$sourceID || !$targetID) { $insert = " INSERT INTO civicrm_option_value (option_group_id, label, value, name, weight, is_reserved, is_active) @@ -792,7 +792,7 @@ CREATE TABLE IF NOT EXISTS `civicrm_word_replacement` ( $res = CRM_Core_DAO::singleValueQuery($sql); - if ($res <= 0 ) { + if ($res <= 0) { $sql = "ALTER TABLE civicrm_report_instance ADD `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'when combined with report_id/template uniquely identifies the instance'"; $res = CRM_Core_DAO::executeQuery($sql); } @@ -803,7 +803,7 @@ CREATE TABLE IF NOT EXISTS `civicrm_word_replacement` ( $res = CRM_Core_DAO::singleValueQuery($sql); - if ($res <= 0 ) { + if ($res <= 0) { $sql = "ALTER TABLE civicrm_report_instance ADD `args` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'arguments that are passed in the url when invoking the instance'"; $res = CRM_Core_DAO::executeQuery($sql); diff --git a/CRM/Upgrade/Incremental/php/FourThree.php b/CRM/Upgrade/Incremental/php/FourThree.php index 46f7eb32db..c0d63cbe38 100644 --- a/CRM/Upgrade/Incremental/php/FourThree.php +++ b/CRM/Upgrade/Incremental/php/FourThree.php @@ -222,12 +222,12 @@ WHERE ceft.entity_id IS NULL; if ($isOrphanData) { $postUpgradeMessage .= "
" . ts('Your database contains extraneous financial records related to deleted contacts and contributions. These records should not affect the site and will not appear in reports, search results or exports. However you may wish to clean them up. Refer to this wiki page for details. - ', array( 1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Clean+up+extraneous+financial+data+-+4.3+upgrades')) . ""; + ', array(1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Clean+up+extraneous+financial+data+-+4.3+upgrades')) . ""; } } if ($rev == '4.3.4') { $postUpgradeMessage .= '
' . ts('System Administrator Alert: If you are running scheduled jobs using CLI.php, you will need to reconfigure cron tasks to include a password. Scheduled jobs will no longer run if the password is not provided (learn more).', - array( 1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs')); + array(1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs')); } if ($rev == '4.3.5') { $postUpgradeMessage .= '
' . ts('Default versions of the following System Workflow Message Templates have been modified to handle new functionality: If you have modified these templates, please review the new default versions and implement updates as needed to your copies (Administer > Communications > Message Templates > System Workflow Messages).'); @@ -238,7 +238,7 @@ INNER JOIN civicrm_product cp ON ccp.product_id = cp.id WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); if ($flag) { $postUpgradeMessage .= '
' . ts('Your database contains one or more premiums which have a cost but are not linked to a financial type. If you are exporting transations to an accounting package, this will result in unbalanced transactions. You can review steps to correct this situation on the wiki.', - array( 1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Issues+Caused+by+Missing+Cost+of+Goods+Account+-+4.3+Upgrades')); + array(1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Issues+Caused+by+Missing+Cost+of+Goods+Account+-+4.3+Upgrades')); } } } @@ -272,9 +272,9 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); // CRM-10893 // fix WP access control - $config = CRM_Core_Config::singleton( ); + $config = CRM_Core_Config::singleton(); if ($config->userFramework == 'WordPress') { - civicrm_wp_set_capabilities( ); + civicrm_wp_set_capabilities(); } // Update phones CRM-11292. @@ -545,7 +545,7 @@ AND financial_account_type_id = {$accountType} $validCurrencyCodes = implode("','", $validCurrencyCodes); $config = CRM_Core_Config::singleton(); $defaultCurrency = $config->defaultCurrency; - $now = date( 'YmdHis' ); + $now = date('YmdHis'); //adding financial_trxn records and entity_financial_trxn records related to contribution //Add temp column for easy entry in entity_financial_trxn diff --git a/CRM/Upgrade/Incremental/php/FourTwo.php b/CRM/Upgrade/Incremental/php/FourTwo.php index 5761a637ee..ec4141b05b 100644 --- a/CRM/Upgrade/Incremental/php/FourTwo.php +++ b/CRM/Upgrade/Incremental/php/FourTwo.php @@ -83,7 +83,7 @@ ORDER BY mp.contribution_id, mp.membership_id"; $invalidData = CRM_Core_DAO::executeQuery($query); if ($invalidData->N) { $invalidDataMessage = "
" . ts('The upgrade is being aborted due to data integrity issues in your database. There are multiple membership records linked to the same contribution record. This is unexpected, and some of the membership records may be duplicates. The problem record sets are listed below. Refer to this wiki page for instructions on repairing your database so that you can run the upgrade successfully. - ', array( 1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC42/Repair+database+script+for+4.2+upgrades')) . ""; + ', array(1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC42/Repair+database+script+for+4.2+upgrades')) . ""; $membershipType = CRM_Member_PseudoConstant::membershipType(); $membershipStatus = CRM_Member_PseudoConstant::membershipStatus(); $invalidDataMessage .= ""; @@ -434,7 +434,7 @@ WHERE cpse.price_set_id IS NULL"; $addTo[2] = $dao->contribution_page_id; $options = array( 'otherAmount' => $dao->is_allow_other_amount, - 'membership' => $dao->membership_block_id ); + 'membership' => $dao->membership_block_id); self::createPriceSet($daoName, $addTo, $options); } @@ -469,7 +469,7 @@ WHERE cpse.price_set_id IS NULL"; // an event or contrib page has been deleted but left the option group behind - (this may be fixed in later versions?) // we should probably delete the option group - but at least early exit here as the code following it does not fatal // CRM-10298 - if ( empty($pageTitle)) { + if (empty($pageTitle)) { return; } @@ -960,10 +960,10 @@ VALUES } } - if ( !empty($processedRecords) ) { + if (!empty($processedRecords)) { CRM_Core_Error::debug_log_message("deleteInvalidPairs() - The following records have been processed. Membership records with action:"); - CRM_Core_Error::debug_log_message( "Contact ID, ContributionID, Contribution Status, MembershipID, Membership Type, Start Date, End Date, Membership Status, Action" ); - foreach ( $processedRecords as $record ) { + CRM_Core_Error::debug_log_message("Contact ID, ContributionID, Contribution Status, MembershipID, Membership Type, Start Date, End Date, Membership Status, Action"); + foreach ($processedRecords as $record) { CRM_Core_Error::debug_log_message(implode(', ', $record)); } } diff --git a/CRM/Upgrade/Page/Upgrade.php b/CRM/Upgrade/Page/Upgrade.php index a65a45cf79..8422fdd4ff 100644 --- a/CRM/Upgrade/Page/Upgrade.php +++ b/CRM/Upgrade/Page/Upgrade.php @@ -159,7 +159,7 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page { 'queue' => CRM_Upgrade_Form::buildQueue($currentVer, $latestVer, $this->get('postUpgradeMessageFile')), 'isMinimal' => TRUE, 'pathPrefix' => 'civicrm/upgrade/queue', - 'onEndUrl' => CRM_Utils_System::url('civicrm/upgrade', 'action=finish', FALSE, NULL, FALSE ), + 'onEndUrl' => CRM_Utils_System::url('civicrm/upgrade', 'action=finish', FALSE, NULL, FALSE), 'buttons' => array('retry' => $config->debug, 'skip' => $config->debug), )); $queueRunner->runAllViaWeb(); diff --git a/CRM/Utils/Address/BatchUpdate.php b/CRM/Utils/Address/BatchUpdate.php index fa36f8a666..6233294052 100644 --- a/CRM/Utils/Address/BatchUpdate.php +++ b/CRM/Utils/Address/BatchUpdate.php @@ -193,7 +193,7 @@ class CRM_Utils_Address_BatchUpdate { } $className = $config->geocodeMethod; - $className::format( $params, TRUE ); + $className::format($params, TRUE); // see if we got a geocode error, in this case we'll trigger a fatal // CRM-13760 diff --git a/CRM/Utils/Cache/Memcached.php b/CRM/Utils/Cache/Memcached.php index 7c36fd3aeb..732aa831df 100644 --- a/CRM/Utils/Cache/Memcached.php +++ b/CRM/Utils/Cache/Memcached.php @@ -119,8 +119,8 @@ class CRM_Utils_Cache_Memcached { public function set($key, &$value) { $key = $this->cleanKey($key); if (!$this->_cache->set($key, $value, $this->_timeout)) { - CRM_Core_Error::debug( 'Result Code: ', $this->_cache->getResultMessage()); - CRM_Core_Error::fatal("memcached set failed, wondering why?, $key", $value ); + CRM_Core_Error::debug('Result Code: ', $this->_cache->getResultMessage()); + CRM_Core_Error::fatal("memcached set failed, wondering why?, $key", $value); return FALSE; } return TRUE; @@ -154,7 +154,7 @@ class CRM_Utils_Cache_Memcached { */ public function cleanKey($key) { $key = preg_replace('/\s+|\W+/', '_', $this->_prefix . $key); - if ( strlen($key) > self::MAX_KEY_LEN ) { + if (strlen($key) > self::MAX_KEY_LEN) { $md5Key = md5($key); // this should be 32 characters in length $subKeyLen = self::MAX_KEY_LEN - 1 - strlen($md5Key); $key = substr($key, 0, $subKeyLen) . "_" . $md5Key; diff --git a/CRM/Utils/DeprecatedUtils.php b/CRM/Utils/DeprecatedUtils.php index 9de2dd94bf..58331fe973 100644 --- a/CRM/Utils/DeprecatedUtils.php +++ b/CRM/Utils/DeprecatedUtils.php @@ -1002,7 +1002,7 @@ function _civicrm_api3_deprecated_add_formatted_location_blocks(&$values, &$para if (!array_key_exists($block, $fields)) { $className = "CRM_Core_DAO_$block"; - $fields[$block] =& $className::fields( ); + $fields[$block] =& $className::fields(); } $blockCnt = count($params[$name]); @@ -1061,20 +1061,20 @@ function _civicrm_api3_deprecated_add_formatted_location_blocks(&$values, &$para // mark an entry in fields array since we want the value of custom field to be copied $fields['Address'][$key] = NULL; - $htmlType = CRM_Utils_Array::value( 'html_type', $customFields[$customFieldID] ); - switch ( $htmlType ) { + $htmlType = CRM_Utils_Array::value('html_type', $customFields[$customFieldID]); + switch ($htmlType) { case 'CheckBox': case 'AdvMulti-Select': case 'Multi-Select': - if ( $val ) { - $mulValues = explode( ',', $val ); - $customOption = CRM_Core_BAO_CustomOption::getCustomOption( $customFieldID, TRUE ); + if ($val) { + $mulValues = explode(',', $val); + $customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, TRUE); $newValues[$key] = array(); - foreach ( $mulValues as $v1 ) { - foreach ( $customOption as $v2 ) { - if ( ( strtolower( $v2['label'] ) == strtolower( trim( $v1 ) ) ) || - ( strtolower( $v2['value'] ) == strtolower( trim( $v1 ) ) ) ) { - if ( $htmlType == 'CheckBox' ) { + foreach ($mulValues as $v1) { + foreach ($customOption as $v2) { + if ((strtolower($v2['label']) == strtolower(trim($v1))) || + (strtolower($v2['value']) == strtolower(trim($v1)))) { + if ($htmlType == 'CheckBox') { $newValues[$key][$v2['value']] = 1; } else { diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index fa932a9b26..6a1d710cf0 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -249,9 +249,9 @@ abstract class CRM_Utils_Hook { foreach ($civiModules as $civiModule) { if (!file_exists($civiModule['filePath'])) { CRM_Core_Session::setStatus( - ts( 'Error loading module file (%1). Please restore the file or disable the module.', - array(1 => $civiModule['filePath']) ), - ts( 'Warning'), 'error'); + ts('Error loading module file (%1). Please restore the file or disable the module.', + array(1 => $civiModule['filePath'])), + ts('Warning'), 'error'); continue; } include_once $civiModule['filePath']; diff --git a/CRM/Utils/Hook/UnitTests.php b/CRM/Utils/Hook/UnitTests.php index af2f01c4f2..da5ee49a0b 100644 --- a/CRM/Utils/Hook/UnitTests.php +++ b/CRM/Utils/Hook/UnitTests.php @@ -111,7 +111,7 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook { &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6, $fnSuffix) { - $params = array( &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6); + $params = array(&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6); if ($this->civiModules === NULL) { $this->civiModules = array(); @@ -123,7 +123,7 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook { call_user_func(array($this->mockObject, $fnSuffix), $arg1, $arg2, $arg3, $arg4, $arg5, $arg6); } if (!empty($this->adhocHooks[$fnSuffix])) { - call_user_func_array($this->adhocHooks[$fnSuffix], $params ); + call_user_func_array($this->adhocHooks[$fnSuffix], $params); } } } diff --git a/CRM/Utils/Hook/WordPress.php b/CRM/Utils/Hook/WordPress.php index e63d817a95..4ba46aa454 100644 --- a/CRM/Utils/Hook/WordPress.php +++ b/CRM/Utils/Hook/WordPress.php @@ -109,11 +109,11 @@ class CRM_Utils_Hook_WordPress extends CRM_Utils_Hook { */ // distinguish between types of hook - if ( ! in_array( $fnSuffix, $this->hooksThatReturn ) ) { + if (! in_array($fnSuffix, $this->hooksThatReturn)) { // only pass the arguments that have values $args = array_slice( - array( &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6 ), + array(&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6), 0, $numParams ); @@ -127,7 +127,7 @@ class CRM_Utils_Hook_WordPress extends CRM_Utils_Hook { // protect from REST calls if (function_exists('do_action_ref_array')) { - do_action_ref_array( $fnSuffix, $args ); + do_action_ref_array($fnSuffix, $args); } } diff --git a/CRM/Utils/Mail.php b/CRM/Utils/Mail.php index 365e7dcd03..eb6b49db56 100644 --- a/CRM/Utils/Mail.php +++ b/CRM/Utils/Mail.php @@ -161,7 +161,7 @@ class CRM_Utils_Mail { $to = array($params['toEmail']); $result = NULL; - $mailer =& CRM_Core_Config::getMailer( ); + $mailer =& CRM_Core_Config::getMailer(); // Mail_smtp and Mail_sendmail mailers require Bcc anc Cc emails // be included in both $to and $headers['Cc', 'Bcc'] @@ -169,10 +169,10 @@ class CRM_Utils_Mail { //get emails from headers, since these are //combination of name and email addresses. if (!empty($headers['Cc'])) { - $to[] = CRM_Utils_Array::value( 'Cc', $headers ); + $to[] = CRM_Utils_Array::value('Cc', $headers); } if (!empty($headers['Bcc'])) { - $to[] = CRM_Utils_Array::value( 'Bcc', $headers ); + $to[] = CRM_Utils_Array::value('Bcc', $headers); } } if (is_object($mailer)) { diff --git a/CRM/Utils/OpenFlashChart.php b/CRM/Utils/OpenFlashChart.php index 8f953fea4f..dbeef70de5 100644 --- a/CRM/Utils/OpenFlashChart.php +++ b/CRM/Utils/OpenFlashChart.php @@ -105,7 +105,7 @@ class CRM_Utils_OpenFlashChart { $bars[$barCount]->set_values($yValues); if ($barCount > 0) { // FIXME: for bars > 2, we'll need to come out with other colors - $bars[$barCount]->colour( '#BF3B69'); + $bars[$barCount]->colour('#BF3B69'); } if ($barKey = CRM_Utils_Array::value($barCount, CRM_Utils_Array::value('barKeys', $params))) { diff --git a/CRM/Utils/PDF/Utils.php b/CRM/Utils/PDF/Utils.php index 1332284b7e..59ec9c5295 100644 --- a/CRM/Utils/PDF/Utils.php +++ b/CRM/Utils/PDF/Utils.php @@ -131,18 +131,18 @@ class CRM_Utils_PDF_Utils { require_once 'tcpdf/tcpdf.php'; require_once 'FPDI/fpdi.php'; // This library is only in the 'packages' area as of version 4.5 - $paper_size_arr = array( $paper_size[2], $paper_size[3]); + $paper_size_arr = array($paper_size[2], $paper_size[3]); $pdf = new TCPDF($orientation, 'pt', $paper_size_arr); $pdf->Open(); if (is_readable($stationery_path)) { - $pdf->SetStationery( $stationery_path ); + $pdf->SetStationery($stationery_path); } $pdf->SetAuthor(''); $pdf->SetKeywords('CiviCRM.org'); - $pdf->setPageUnit( $margins[0] ); + $pdf->setPageUnit($margins[0]); $pdf->SetMargins($margins[4], $margins[1], $margins[2], TRUE); $pdf->setJPEGQuality('100'); diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index 09abcf5e3b..546ad41986 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -278,7 +278,7 @@ class CRM_Utils_REST { $q = $r; } $entity = CRM_Utils_array::value('entity', $requestParams); - if ( empty($entity) && !empty($q)) { + if (empty($entity) && !empty($q)) { $args = explode('/', $q); // If the function isn't in the civicrm namespace, reject the request. if ($args[0] != 'civicrm') { @@ -377,7 +377,7 @@ class CRM_Utils_REST { return $result; } - if ($_SERVER['REQUEST_METHOD'] == 'GET' && strtolower(substr( $args[2], 0, 3)) != 'get') { + if ($_SERVER['REQUEST_METHOD'] == 'GET' && strtolower(substr($args[2], 0, 3)) != 'get') { // get only valid for non destructive methods require_once 'api/v3/utils.php'; return civicrm_api3_create_error("SECURITY: All requests that modify the database must be http POST, not GET.", @@ -471,7 +471,7 @@ class CRM_Utils_REST { /** used to load a template "inline", eg. for ajax, without having to build a menu for each template */ static function loadTemplate () { - $request = CRM_Utils_Request::retrieve( 'q', 'String'); + $request = CRM_Utils_Request::retrieve('q', 'String'); if (FALSE !== strpos($request, '..')) { die ("SECURITY FATAL: the url can't contain '..'. Please report the issue on the forum at civicrm.org"); } @@ -481,9 +481,9 @@ class CRM_Utils_REST { $tplfile = _civicrm_api_get_camel_name($request[3]); $tpl = 'CRM/'.$entity.'/Page/Inline/'.$tplfile.'.tpl'; - $smarty = CRM_Core_Smarty::singleton( ); - CRM_Utils_System::setTitle( "$entity::$tplfile inline $tpl" ); - if (!$smarty->template_exists($tpl) ) { + $smarty = CRM_Core_Smarty::singleton(); + CRM_Utils_System::setTitle("$entity::$tplfile inline $tpl"); + if (!$smarty->template_exists($tpl)) { header("Status: 404 Not Found"); die ("Can't find the requested template file templates/$tpl"); } @@ -495,30 +495,30 @@ class CRM_Utils_REST { if ($pos !== FALSE) { die ("SECURITY FATAL: one of the param names contains <"); } - $param = array_map( 'htmlentities', $_GET); + $param = array_map('htmlentities', $_GET); unset($param['q']); $smarty->assign_by_ref("request", $param); - if ( ! array_key_exists( 'HTTP_X_REQUESTED_WITH', $_SERVER ) || - $_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest" ) { + if (! array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) || + $_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest" ) { - $smarty->assign( 'tplFile', $tpl ); + $smarty->assign('tplFile', $tpl); $config = CRM_Core_Config::singleton(); - $content = $smarty->fetch( 'CRM/common/'. strtolower($config->userFramework) .'.tpl' ); + $content = $smarty->fetch('CRM/common/'. strtolower($config->userFramework) .'.tpl'); if (!defined('CIVICRM_UF_HEAD') && $region = CRM_Core_Region::instance('html-header', FALSE)) { CRM_Utils_System::addHTMLHead($region->render('')); } - CRM_Utils_System::appendTPLFile( $tpl, $content ); + CRM_Utils_System::appendTPLFile($tpl, $content); return CRM_Utils_System::theme($content); } else { $content = "\n"; - CRM_Utils_System::appendTPLFile( $tpl, $content ); + CRM_Utils_System::appendTPLFile($tpl, $content); echo $content . $smarty->fetch($tpl); - CRM_Utils_System::civiExit( ); + CRM_Utils_System::civiExit(); } } diff --git a/CRM/Utils/ReCAPTCHA.php b/CRM/Utils/ReCAPTCHA.php index 3b1be1a1c0..a8d470872b 100644 --- a/CRM/Utils/ReCAPTCHA.php +++ b/CRM/Utils/ReCAPTCHA.php @@ -81,7 +81,7 @@ class CRM_Utils_ReCAPTCHA { $error = NULL; $config = CRM_Core_Config::singleton(); $useSSL = FALSE; - if ( !function_exists( 'recaptcha_get_html' ) ) { + if (!function_exists('recaptcha_get_html')) { require_once 'packages/recaptcha/recaptchalib.php'; } diff --git a/CRM/Utils/SoapServer.php b/CRM/Utils/SoapServer.php index 9287b9e127..92e7173dde 100644 --- a/CRM/Utils/SoapServer.php +++ b/CRM/Utils/SoapServer.php @@ -134,7 +134,7 @@ class CRM_Utils_SoapServer { } $className = $this->ufClass; - $result =& $className::authenticate($name, $pass, $loadCMSBootstrap ); + $result =& $className::authenticate($name, $pass, $loadCMSBootstrap); if (empty($result)) { throw new SoapFault('Client', 'Invalid login'); diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index 015af31dd0..0bc5170e59 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -632,7 +632,7 @@ class CRM_Utils_System { list($userID, $ufID, $randomNumber) = $result; if ($userID && $ufID) { $config = CRM_Core_Config::singleton(); - $config->userSystem->setUserSession( array($userID, $ufID) ); + $config->userSystem->setUserSession(array($userID, $ufID)); } else { return self::authenticateAbort( @@ -670,7 +670,7 @@ class CRM_Utils_System { * process typically done in CLI and cron scripts. See: CRM-12648 */ $session = CRM_Core_Session::singleton(); - $session->set( 'civicrmInitSession', TRUE ); + $session->set('civicrmInitSession', TRUE); $dbDrupal = DB::connect($config->userFrameworkDSN); return $config->userSystem->authenticate($name, $password, $loadCMSBootstrap, $realPath); @@ -963,7 +963,7 @@ class CRM_Utils_System { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // lets capture the return stuff rather than echo - curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE ); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // CRM-13227, CRM-14744: only return the SSL error status return (curl_exec($ch) !== FALSE); diff --git a/CRM/Utils/System/Drupal6.php b/CRM/Utils/System/Drupal6.php index 2adddbf9a1..5d8f9f36eb 100644 --- a/CRM/Utils/System/Drupal6.php +++ b/CRM/Utils/System/Drupal6.php @@ -934,7 +934,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * Drupal User ID. */ public function og_membership_create($ogID, $drupalID) { - og_save_subscription( $ogID, $drupalID, array( 'is_active' => 1 ) ); + og_save_subscription($ogID, $drupalID, array('is_active' => 1)); } /** @@ -946,7 +946,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * Drupal User ID. */ public function og_membership_delete($ogID, $drupalID) { - og_delete_subscription( $ogID, $drupalID ); + og_delete_subscription($ogID, $drupalID); } /** diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index f4f6bde225..a96fff7e29 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -512,7 +512,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { } $joomlaBase = dirname(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))))); - if ( !defined('JVERSION') ) { + if (!defined('JVERSION')) { require $joomlaBase . '/libraries/cms/version/version.php'; $jversion = new JVersion; define('JVERSION', $jversion->getShortVersion()); @@ -523,8 +523,8 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { $dbId = $row->id; $dbEmail = $row->email; - if ( version_compare(JVERSION, '2.5.18', 'lt') || - ( version_compare(JVERSION, '3.0', 'ge') && version_compare(JVERSION, '3.2.1', 'lt') ) + if (version_compare(JVERSION, '2.5.18', 'lt') || + (version_compare(JVERSION, '3.0', 'ge') && version_compare(JVERSION, '3.2.1', 'lt')) ) { // now check password if (strpos($dbPassword, ':') === FALSE) { @@ -546,7 +546,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { } //include additional files required by Joomla 3.2.1+ - if ( version_compare(JVERSION, '3.2.1', 'ge') ) { + if (version_compare(JVERSION, '3.2.1', 'ge')) { require_once $joomlaBase . '/libraries/cms/application/helper.php'; require_once $joomlaBase . '/libraries/cms/application/cms.php'; require_once $joomlaBase . '/libraries/cms/application/administrator.php'; @@ -573,7 +573,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { */ public function setUserSession($data) { list($userID, $ufID) = $data; - $user = new JUser( $ufID ); + $user = new JUser($ufID); $session = JFactory::getSession(); $session->set('user', $user); @@ -655,7 +655,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { // load BootStrap here if needed // We are a valid Joomla entry point. - if ( ! defined( '_JEXEC' ) && $loadDefines ) { + if (! defined('_JEXEC') && $loadDefines) { define('_JEXEC', 1); define('DS', DIRECTORY_SEPARATOR); define('JPATH_BASE', $joomlaBase . '/administrator'); @@ -671,13 +671,13 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { require $joomlaBase . '/configuration.php'; // Files may be in different places depending on Joomla version - if ( !defined('JVERSION') ) { + if (!defined('JVERSION')) { require $joomlaBase . '/libraries/cms/version/version.php'; $jversion = new JVersion; define('JVERSION', $jversion->getShortVersion()); } - if (version_compare(JVERSION, '3.0', 'lt') ) { + if (version_compare(JVERSION, '3.0', 'lt')) { require $joomlaBase . '/libraries/joomla/environment/uri.php'; require $joomlaBase . '/libraries/joomla/application/component/helper.php'; } @@ -784,7 +784,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { $loginURL .= 'index.php?option=com_users&view=login'; //CRM-14872 append destination - if ( !empty($destination) ) { + if (!empty($destination)) { $loginURL .= '&return='.urlencode(base64_encode($destination)); } return $loginURL; diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 588cb56d6a..918f4ea8bc 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -75,7 +75,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { // yes, set page title, depending on context $context = civi_wp()->civicrm_context_get(); - switch ( $context ) { + switch ($context) { case 'admin': case 'shortcode': $template = CRM_Core_Smarty::singleton(); @@ -317,7 +317,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { // when shortcode is included in page // also make sure we have valid query object global $wp_query; - if ( method_exists( $wp_query, 'get' ) ) { + if (method_exists($wp_query, 'get')) { if (get_query_var('page_id')) { $wpPageParam = "page_id=" . get_query_var('page_id'); } @@ -628,8 +628,8 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { $ufName = CRM_Utils_Type::escape($ufName, 'String'); $values = array('ID' => $ufID, 'user_email' => $ufName); - if ($ufID ) { - wp_update_user( $values ); + if ($ufID) { + wp_update_user($values); } } } diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index 08a9c9558f..660df752bd 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -84,10 +84,10 @@ class CRM_Utils_Token { 'id', 'description', ), - 'subscribe' => array( 'group' ), - 'unsubscribe' => array( 'group' ), - 'resubscribe' => array( 'group' ), - 'welcome' => array( 'group' ), + 'subscribe' => array('group'), + 'unsubscribe' => array('group'), + 'resubscribe' => array('group'), + 'welcome' => array('group'), ); /** @@ -1437,7 +1437,7 @@ class CRM_Utils_Token { $remainingTokens = self::getTokens($tokenString); // contact related $greetingTokens not empty, there are customized or hook tokens to replace - if (!empty($remainingTokens['contact']) ) { + if (!empty($remainingTokens['contact'])) { // Fill the return properties array $greetingTokens = $remainingTokens['contact']; reset($greetingTokens); diff --git a/CRM/Utils/Weight.php b/CRM/Utils/Weight.php index 519eb96612..5abd4c4c13 100644 --- a/CRM/Utils/Weight.php +++ b/CRM/Utils/Weight.php @@ -433,7 +433,7 @@ class CRM_Utils_Weight { } public static function fixOrder() { - $signature = CRM_Utils_Request::retrieve( '_sgn', 'String', CRM_Core_DAO::$_nullObject); + $signature = CRM_Utils_Request::retrieve('_sgn', 'String', CRM_Core_DAO::$_nullObject); $signer = new CRM_Utils_Signer(CRM_Core_Key::privateKey(), self::$SIGNABLE_FIELDS); // Validate $_GET values b/c subsequent code reads $_GET (via CRM_Utils_Request::retrieve) diff --git a/api/v3/Domain.php b/api/v3/Domain.php index 0ddaaac26a..ae9ce6498b 100644 --- a/api/v3/Domain.php +++ b/api/v3/Domain.php @@ -73,11 +73,11 @@ function civicrm_api3_domain_get($params) { 'geo_code_1', 'geo_code_2', ); - if ( !empty( $values['location']['email'] ) ) { + if (!empty($values['location']['email'])) { $domain['domain_email'] = CRM_Utils_Array::value('email', $values['location']['email'][1]); } - if ( !empty( $values['location']['phone'] ) ) { + if (!empty($values['location']['phone'])) { $domain['domain_phone'] = array( 'phone_type' => CRM_Core_OptionGroup::getLabel( 'phone_type', @@ -93,7 +93,7 @@ function civicrm_api3_domain_get($params) { ); } - if ( !empty( $values['location']['address'] ) ) { + if (!empty($values['location']['address'])) { foreach ($address_array as $value) { $domain['domain_address'][$value] = CRM_Utils_Array::value($value, $values['location']['address'][1] diff --git a/api/v3/Event.php b/api/v3/Event.php index 687f2655a4..0c25b11577 100644 --- a/api/v3/Event.php +++ b/api/v3/Event.php @@ -178,7 +178,7 @@ function _civicrm_api3_event_get_spec(&$params) { function _civicrm_api3_event_get_legacy_support_42(&$event, $event_id) { if (!empty($event[$event_id]['payment_processor'])) { $processors = explode(CRM_Core_DAO::VALUE_SEPARATOR, $event[$event_id]['payment_processor']); - if (count($processors) == 3 ) { + if (count($processors) == 3) { $event[$event_id]['payment_processor_id'] = $processors[1]; } } diff --git a/api/v3/Generic.php b/api/v3/Generic.php index 80ea3f3d95..17556f86f3 100644 --- a/api/v3/Generic.php +++ b/api/v3/Generic.php @@ -29,7 +29,7 @@ function civicrm_api3_generic_getfields($apiRequest) { CRM_Utils_PseudoConstant::flushConstant($apiRequest['params']['fieldname']); } if (!empty($apiRequest['params']['option_group_id'])) { - $optionGroupName = civicrm_api('option_group', 'getvalue', array('version' => 3, 'id' => $apiRequest['params']['option_group_id'], 'return' => 'name') ); + $optionGroupName = civicrm_api('option_group', 'getvalue', array('version' => 3, 'id' => $apiRequest['params']['option_group_id'], 'return' => 'name')); if (is_string($optionGroupName)) { CRM_Utils_PseudoConstant::flushConstant(_civicrm_api_get_camel_name($optionGroupName)); } diff --git a/api/v3/Job.php b/api/v3/Job.php index 4a64c92854..f69c1ebd69 100644 --- a/api/v3/Job.php +++ b/api/v3/Job.php @@ -403,7 +403,7 @@ function civicrm_api3_job_fetch_activities($params) { try { CRM_Utils_Mail_EmailProcessor::processActivities(); - $values = array( ); + $values = array(); $lock->release(); return civicrm_api3_create_success($values, $params,'mailing','activities'); } @@ -567,28 +567,28 @@ function civicrm_api3_job_run_payment_cron($params) { * @static void * @access public */ -function civicrm_api3_job_cleanup( $params ) { - $session = CRM_Utils_Array::value( 'session' , $params, true ); - $tempTable = CRM_Utils_Array::value( 'tempTables', $params, true ); - $jobLog = CRM_Utils_Array::value( 'jobLog' , $params, true ); - $prevNext = CRM_Utils_Array::value( 'prevNext' , $params, true ); - $dbCache = CRM_Utils_Array::value( 'dbCache' , $params, false ); - $memCache = CRM_Utils_Array::value( 'memCache' , $params, false ); +function civicrm_api3_job_cleanup($params) { + $session = CRM_Utils_Array::value('session' , $params, true ); + $tempTable = CRM_Utils_Array::value('tempTables', $params, true ); + $jobLog = CRM_Utils_Array::value('jobLog' , $params, true ); + $prevNext = CRM_Utils_Array::value('prevNext' , $params, true ); + $dbCache = CRM_Utils_Array::value('dbCache' , $params, false); + $memCache = CRM_Utils_Array::value('memCache' , $params, false); - if ( $session || $tempTable || $prevNext ) { - CRM_Core_BAO_Cache::cleanup( $session, $tempTable, $prevNext ); + if ($session || $tempTable || $prevNext) { + CRM_Core_BAO_Cache::cleanup($session, $tempTable, $prevNext); } - if ( $jobLog ) { - CRM_Core_BAO_Job::cleanup( ); + if ($jobLog) { + CRM_Core_BAO_Job::cleanup(); } - if ( $dbCache ) { - CRM_Core_Config::clearDBCache( ); + if ($dbCache) { + CRM_Core_Config::clearDBCache(); } - if ( $memCache ) { - CRM_Utils_System::flushCache( ); + if ($memCache) { + CRM_Utils_System::flushCache(); } } @@ -625,7 +625,7 @@ function civicrm_api3_job_group_rebuild($params) { return civicrm_api3_create_error('Could not acquire lock, another EmailProcessor process is running'); } - $limit = CRM_Utils_Array::value( 'limit', $params, 0 ); + $limit = CRM_Utils_Array::value('limit', $params, 0); CRM_Contact_BAO_GroupContactCache::loadAll(null, $limit); $lock->release(); diff --git a/api/v3/Mailing.php b/api/v3/Mailing.php index 72447c0b6c..f32f4a2fa5 100755 --- a/api/v3/Mailing.php +++ b/api/v3/Mailing.php @@ -432,7 +432,7 @@ function _civicrm_api3_mailing_send_test_spec(&$spec) { function civicrm_api3_mailing_send_test($params) { if (!array_key_exists('test_group', $params) && !array_key_exists('test_email', $params)) { - throw new API_Exception("Mandatory key(s) missing from params array: test_group and/or test_email field are required" ); + throw new API_Exception("Mandatory key(s) missing from params array: test_group and/or test_email field are required"); } civicrm_api3_verify_mandatory($params, 'CRM_Mailing_DAO_MailingJob', diff --git a/api/v3/MailingEventQueue.php b/api/v3/MailingEventQueue.php index 2746fd081e..d2d03032f7 100644 --- a/api/v3/MailingEventQueue.php +++ b/api/v3/MailingEventQueue.php @@ -48,7 +48,7 @@ */ function civicrm_api3_mailing_event_queue_create($params) { if (!array_key_exists('id', $params) && !array_key_exists('email_id', $params) && !array_key_exists('phone_id', $params)) { - throw new API_Exception("Mandatory key missing from params array: id, email_id, or phone_id field is required" ); + throw new API_Exception("Mandatory key missing from params array: id, email_id, or phone_id field is required"); } civicrm_api3_verify_mandatory($params, 'CRM_Mailing_DAO_MailingJob', diff --git a/api/v3/Membership.php b/api/v3/Membership.php index d50c025f98..125d77db8d 100644 --- a/api/v3/Membership.php +++ b/api/v3/Membership.php @@ -221,7 +221,7 @@ function civicrm_api3_membership_get($params) { return civicrm_api3_create_success($membershipValues, $params, 'membership', 'get'); } - $members = _civicrm_api3_membership_relationsship_get_customv2behaviour($params, $membershipValues, $contactID ); + $members = _civicrm_api3_membership_relationsship_get_customv2behaviour($params, $membershipValues, $contactID); return civicrm_api3_create_success($members, $params, 'membership', 'get'); } diff --git a/api/v3/utils.php b/api/v3/utils.php index 2807a75c74..aa19df80ae 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -1817,7 +1817,7 @@ function _civicrm_api3_validate_integer(&$params, &$fieldName, &$fieldInfo, $ent // Check our field length if (is_string($params[$fieldName]) && !empty($fieldInfo['maxlength']) && strlen($params[$fieldName]) > $fieldInfo['maxlength'] ) { - throw new API_Exception( $params[$fieldName] . " is " . strlen($params[$fieldName]) . " characters - longer than $fieldName length" . $fieldInfo['maxlength'] . ' characters', + throw new API_Exception($params[$fieldName] . " is " . strlen($params[$fieldName]) . " characters - longer than $fieldName length" . $fieldInfo['maxlength'] . ' characters', 2100, array('field' => $fieldName, "max_length" => $fieldInfo['maxlength']) ); } @@ -1893,7 +1893,7 @@ function _civicrm_api3_validate_string(&$params, &$fieldName, &$fieldInfo, $enti // the missing piece of functionality is separating them to a separated string // & many save incorrectly. But can we change them wholesale? } - if ($value ) { + if ($value) { if (!CRM_Utils_Rule::xssString($value)) { throw new Exception(ts('Illegal characters in input (potential scripting attack)')); } diff --git a/bin/cleanup42.php b/bin/cleanup42.php index 1c5f86792c..1756e0b4e1 100644 --- a/bin/cleanup42.php +++ b/bin/cleanup42.php @@ -53,7 +53,7 @@ function run() { $fh = fopen('php://output', 'w'); $rows = CRM_Upgrade_Incremental_php_FourTwo::deleteInvalidPairs(); - if ( !empty($rows)) { + if (!empty($rows)) { echo "The following records have been processed. If action = Un-linked, that membership has been disconnected from the contribution record.\n"; echo "Contact ID, ContributionID, Contribution Status, MembershipID, Membership Type, Start Date, End Date, Membership Status, Action \n"; } @@ -61,7 +61,7 @@ function run() { echo "Could not find any records to process.\n"; } - foreach ( $rows as $row ) { + foreach ($rows as $row) { fputcsv($fh, $row); } } diff --git a/bin/cli.class.php b/bin/cli.class.php index d64802efb5..9b8823472f 100644 --- a/bin/cli.class.php +++ b/bin/cli.class.php @@ -213,7 +213,7 @@ class civicrm_cli { chdir($civicrm_root); require_once 'civicrm.config.php'; // autoload - if ( !class_exists('CRM_Core_ClassLoader') ) { + if (!class_exists('CRM_Core_ClassLoader')) { require_once $civicrm_root . '/CRM/Core/ClassLoader.php'; } CRM_Core_ClassLoader::singleton()->register(); diff --git a/bin/cli.php b/bin/cli.php index 21a8e15acf..db2d622c5f 100644 --- a/bin/cli.php +++ b/bin/cli.php @@ -27,5 +27,5 @@ require_once 'cli.class.php'; $cli = new civicrm_Cli(); -$cli->initialize() || die( 'Died during initialization' ); -$cli->callApi() || die( 'Died during callApi' ); +$cli->initialize() || die('Died during initialization'); +$cli->callApi() || die('Died during callApi'); diff --git a/install/index.php b/install/index.php index 55028d6c45..e9268edc9b 100644 --- a/install/index.php +++ b/install/index.php @@ -21,11 +21,11 @@ ini_set('max_execution_time', 3000); if (stristr(PHP_OS, 'WIN')) { define('CIVICRM_DIRECTORY_SEPARATOR', '/'); - define('CIVICRM_WINDOWS', 1 ); + define('CIVICRM_WINDOWS', 1); } else { define('CIVICRM_DIRECTORY_SEPARATOR', DIRECTORY_SEPARATOR); - define('CIVICRM_WINDOWS', 0 ); + define('CIVICRM_WINDOWS', 0); } // set installation type - drupal diff --git a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php index 309c3571f3..1a77612a01 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php @@ -146,7 +146,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { // Assert $c1 not in $parent CRM_Contact_BAO_GroupContactCache::load($parent, TRUE); $this->assertCacheMatches( - array( /* deceased[0], */ $deceased[1]->id, $deceased[2]->id), + array(/* deceased[0], */ $deceased[1]->id, $deceased[2]->id), $parent->id ); diff --git a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php index 8c466560c4..09563970e3 100644 --- a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php +++ b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php @@ -43,7 +43,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { require_once 'CiviTest/CiviMailUtils.php'; $this->mut = new CiviMailUtils($this, TRUE); - $this->fixtures['rolling_membership'] = array( // createTestObject + $this->fixtures['rolling_membership'] = array(// createTestObject 'membership_type_id' => array( 'period_type' => 'rolling', 'duration_unit' => 'month', @@ -56,7 +56,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { 'is_override' => 0, ); - $this->fixtures['rolling_membership_past'] = array( // createTestObject + $this->fixtures['rolling_membership_past'] = array(// createTestObject 'membership_type_id' => array( 'period_type' => 'rolling', 'duration_unit' => 'month', @@ -69,25 +69,25 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { 'is_override' => 'NULL', ); - $this->fixtures['phonecall'] = array( // createTestObject + $this->fixtures['phonecall'] = array(// createTestObject 'status_id' => 1, 'activity_type_id' => 2, 'activity_date_time' => '20120615100000', 'is_current_revision' => 1, 'is_deleted' => 0, ); - $this->fixtures['contact'] = array( // API + $this->fixtures['contact'] = array(// API 'is_deceased' => 0, 'contact_type' => 'Individual', 'email' => 'test-member@example.com', ); - $this->fixtures['contact_birthdate'] = array( // API + $this->fixtures['contact_birthdate'] = array(// API 'is_deceased' => 0, 'contact_type' => 'Individual', 'email' => 'test-bday@example.com', 'birth_date' => '20050707', ); - $this->fixtures['sched_activity_1day'] = array( // create() + $this->fixtures['sched_activity_1day'] = array(// create() 'name' => 'One_Day_Phone_Call_Notice', 'title' => 'One Day Phone Call Notice', 'limit_to' => '1', @@ -147,7 +147,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { 'start_action_unit' => 'day', 'subject' => '1-Day (repeating)', ); - $this->fixtures['sched_membership_join_2week'] = array( // create() + $this->fixtures['sched_membership_join_2week'] = array(// create() 'name' => 'sched_membership_join_2week', 'title' => 'sched_membership_join_2week', 'absolute_date' => '', @@ -176,7 +176,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { 'start_action_unit' => 'week', 'subject' => 'subject sched_membership_join_2week', ); - $this->fixtures['sched_membership_end_2week'] = array( // create() + $this->fixtures['sched_membership_end_2week'] = array(// create() 'name' => 'sched_membership_end_2week', 'title' => 'sched_membership_end_2week', 'absolute_date' => '', @@ -206,7 +206,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { 'subject' => 'subject sched_membership_end_2week', ); - $this->fixtures['sched_membership_end_2month'] = array( // create() + $this->fixtures['sched_membership_end_2month'] = array(// create() 'name' => 'sched_membership_end_2month', 'title' => 'sched_membership_end_2month', 'absolute_date' => '', @@ -236,7 +236,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { 'subject' => 'subject sched_membership_end_2month', ); - $this->fixtures['sched_contact_bday_yesterday'] = array( // create() + $this->fixtures['sched_contact_bday_yesterday'] = array(// create() 'name' => 'sched_contact_bday_yesterday', 'title' => 'sched_contact_bday_yesterday', 'absolute_date' => '', @@ -266,7 +266,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { 'subject' => 'subject sched_contact_bday_yesterday', ); - $this->fixtures['sched_contact_bday_anniv'] = array( // create() + $this->fixtures['sched_contact_bday_anniv'] = array(// create() 'name' => 'sched_contact_bday_anniv', 'title' => 'sched_contact_bday_anniv', 'absolute_date' => '', @@ -296,7 +296,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { 'subject' => 'subject sched_contact_bday_anniv', ); - $this->fixtures['sched_contact_grad_tomorrow'] = array( // create() + $this->fixtures['sched_contact_grad_tomorrow'] = array(// create() 'name' => 'sched_contact_grad_tomorrow', 'title' => 'sched_contact_grad_tomorrow', 'absolute_date' => '', @@ -325,7 +325,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { 'subject' => 'subject sched_contact_grad_tomorrow', ); - $this->fixtures['sched_contact_grad_anniv'] = array( // create() + $this->fixtures['sched_contact_grad_anniv'] = array(// create() 'name' => 'sched_contact_grad_anniv', 'title' => 'sched_contact_grad_anniv', 'absolute_date' => '', @@ -353,7 +353,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { 'start_action_unit' => 'week', 'subject' => 'subject sched_contact_grad_anniv', ); - $this->fixtures['sched_membership_end_2month_repeat_twice_4_weeks'] = array( // create() + $this->fixtures['sched_membership_end_2month_repeat_twice_4_weeks'] = array(// create() 'name' => 'sched_membership_end_2month', 'title' => 'sched_membership_end_2month', 'absolute_date' => '', @@ -382,7 +382,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { 'start_action_unit' => 'month', 'subject' => 'subject sched_membership_end_2month', ); - $this->fixtures['sched_membership_end_limit_to_none'] = array( // create() + $this->fixtures['sched_membership_end_limit_to_none'] = array(// create() 'name' => 'limit to none', 'title' => 'limit to none', 'absolute_date' => '', @@ -446,15 +446,15 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { $activityContact->save(); $this->assertCronRuns(array( - array( // Before the 24-hour mark, no email + array(// Before the 24-hour mark, no email 'time' => '2012-06-14 04:00:00', 'recipients' => array(), ), - array( // After the 24-hour mark, an email + array(// After the 24-hour mark, an email 'time' => '2012-06-14 15:00:00', 'recipients' => array(array('test-member@example.com')), ), - array( // Run cron again; message already sent + array(// Run cron again; message already sent 'time' => '', 'recipients' => array(), ), @@ -477,19 +477,19 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { $activityContact->save(); $this->assertCronRuns(array( - array( // Before the 24-hour mark, no email + array(// Before the 24-hour mark, no email 'time' => '012-06-14 04:00:00', 'recipients' => array(), ), - array( // After the 24-hour mark, an email + array(// After the 24-hour mark, an email 'time' => '2012-06-14 15:00:00', 'recipients' => array(array('test-member@example.com')), ), - array( // Run cron 4 hours later; first message already sent + array(// Run cron 4 hours later; first message already sent 'time' => '2012-06-14 20:00:00', 'recipients' => array(), ), - array( // Run cron 6 hours later; send second message + array(// Run cron 6 hours later; send second message 'time' => '2012-06-14 21:00:01', 'recipients' => array(array('test-member@example.com')), ), @@ -524,11 +524,11 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { // start_date=2012-03-15 ; schedule is 2 weeks after start_date $this->assertCronRuns(array( - array( // Before the 2-week mark, no email + array(// Before the 2-week mark, no email 'time' => '2012-03-28 01:00:00', 'recipients' => array(), ), - array( // After the 2-week mark, send an email + array(// After the 2-week mark, send an email 'time' => '2012-03-29 01:00:00', 'recipients' => array(array('test-member@example.com')), ), @@ -558,7 +558,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { // start_date=2012-03-15 ; schedule is 2 weeks after start_date $this->assertCronRuns(array( - array( // After the 2-week mark, don't send email because we have different membership type + array(// After the 2-week mark, don't send email because we have different membership type 'time' => '2012-03-29 01:00:00', 'recipients' => array(), ), @@ -584,11 +584,11 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { // end_date=2012-06-15 ; schedule is 2 weeks before end_date $this->assertCronRuns(array( - array( // After the 2-week mark, send an email + array(// After the 2-week mark, send an email 'time' => '2012-08-15 01:00:00', 'recipients' => array(array('test-member@example.com')), ), - array( // After the 2-week mark, send an email + array(// After the 2-week mark, send an email 'time' => '2012-09-12 01:00:00', 'recipients' => array(array('test-member@example.com')), ), @@ -614,7 +614,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { $this->callAPISuccess('action_schedule', 'create', $actionSchedule); // end_date=2012-06-15 ; schedule is 2 weeks before end_date $this->assertCronRuns(array( - array( // After the 2-week mark, send an email + array(// After the 2-week mark, send an email 'time' => '2012-08-15 01:00:00', 'recipients' => array(array('test-member@example.com')), ), @@ -623,7 +623,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { //extend membership - reminder should NOT go out $this->callAPISuccess('membership', 'create', array('id' => $membership->id, 'end_date' => '2014-01-01')); $this->assertCronRuns(array( - array( // After the 2-week mark, send an email + array(// After the 2-week mark, send an email 'time' => '2012-09-12 01:00:00', 'recipients' => array(), ), @@ -651,12 +651,12 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { // end_date=2012-06-15 ; schedule is 2 weeks before end_date $this->assertCronRuns(array( - array( // Before the 2-week mark, no email + array(// Before the 2-week mark, no email 'time' => '2012-05-31 01:00:00', // 'time' => '2012-06-01 01:00:00', // FIXME: Is this the right boundary? 'recipients' => array(), ), - array( // After the 2-week mark, send an email + array(// After the 2-week mark, send an email 'time' => '2012-06-01 01:00:00', 'recipients' => array(array('test-member@example.com')), ), @@ -685,12 +685,12 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { // end_date=2012-06-15 ; schedule is 2 weeks before end_date $this->assertCronRuns(array( - array( // Before the 2-week mark, no email + array(// Before the 2-week mark, no email 'time' => '2012-05-31 01:00:00', // 'time' => '2012-06-01 01:00:00', // FIXME: Is this the right boundary? 'recipients' => array(), ), - array( // After the 2-week mark, send an email + array(// After the 2-week mark, send an email 'time' => '2013-05-01 01:00:00', 'recipients' => array(), ), @@ -704,11 +704,11 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($actionSchedule); $this->assertTrue(is_numeric($actionScheduleDao->id)); $this->assertCronRuns(array( - array( // On the birthday, no email + array(// On the birthday, no email 'time' => '2005-07-07 01:00:00', 'recipients' => array(), ), - array( // The next day, send an email + array(// The next day, send an email 'time' => '2005-07-08 20:00:00', 'recipients' => array(array('test-bday@example.com')), ), @@ -722,11 +722,11 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($actionSchedule); $this->assertTrue(is_numeric($actionScheduleDao->id)); $this->assertCronRuns(array( - array( // On some random day, no email + array(// On some random day, no email 'time' => '2014-03-07 01:00:00', 'recipients' => array(), ), - array( // On the eve of their 9th birthday, send an email + array(// On the eve of their 9th birthday, send an email 'time' => '2014-07-06 20:00:00', 'recipients' => array(array('test-bday@example.com')), ), @@ -759,11 +759,11 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($actionSchedule); $this->assertTrue(is_numeric($actionScheduleDao->id)); $this->assertCronRuns(array( - array( // On some random day, no email + array(// On some random day, no email 'time' => '2014-03-07 01:00:00', 'recipients' => array(), ), - array( // On the eve of their graduation, send an email + array(// On the eve of their graduation, send an email 'time' => '2013-12-15 20:00:00', 'recipients' => array(array('test-member@example.com')), ), @@ -794,7 +794,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { // end_date=2012-06-15 ; schedule is 2 weeks before end_date $this->assertCronRuns(array( - array( // Before the 2-week mark, no email + array(// Before the 2-week mark, no email 'time' => '2012-05-31 01:00:00', // 'time' => '2012-06-01 01:00:00', // FIXME: Is this the right boundary? 'recipients' => array(), @@ -831,11 +831,11 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($actionSchedule); $this->assertTrue(is_numeric($actionScheduleDao->id)); $this->assertCronRuns(array( - array( // On some random day, no email + array(// On some random day, no email 'time' => '2014-03-07 01:00:00', 'recipients' => array(), ), - array( // A week after their 5th anniversary of graduation, send an email + array(// A week after their 5th anniversary of graduation, send an email 'time' => '2018-12-23 20:00:00', 'recipients' => array(array('test-member@example.com')), ), diff --git a/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php b/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php index 932621265f..092f2ee1be 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php @@ -72,13 +72,13 @@ class CRM_Core_BAO_CustomValueTableSetGetTest extends CiviUnitTestCase { try { $result = CRM_Core_BAO_CustomValueTable::setValues($params); } - catch ( Exception $e ) { + catch (Exception $e) { $message = $e->getMessage(); } $errorScope = NULL; // Check that an exception has been thrown - $this->assertNotNull( $message, 'Verify than an exception is thrown when bad date is passed' ); + $this->assertNotNull($message, 'Verify than an exception is thrown when bad date is passed'); $params = array( 'entityID' => $contactID, @@ -180,7 +180,7 @@ class CRM_Core_BAO_CustomValueTableSetGetTest extends CiviUnitTestCase { $errorScope = NULL; // Check that an exception has been thrown - $this->assertNotNull( $message, 'Verify than an exception is thrown when bad boolean is passed' ); + $this->assertNotNull($message, 'Verify than an exception is thrown when bad boolean is passed'); $params = array( 'entityID' => $contactID, diff --git a/tests/phpunit/CRM/Core/BAO/EmailTest.php b/tests/phpunit/CRM/Core/BAO/EmailTest.php index 314ea9ec60..bdabdfa5ad 100644 --- a/tests/phpunit/CRM/Core/BAO/EmailTest.php +++ b/tests/phpunit/CRM/Core/BAO/EmailTest.php @@ -9,7 +9,7 @@ class CRM_Core_BAO_EmailTest extends CiviUnitTestCase { public function setUp() { parent::setUp(); - $this->quickCleanup( array( 'civicrm_contact', 'civicrm_email' ) ); + $this->quickCleanup(array('civicrm_contact', 'civicrm_email')); } /** diff --git a/tests/phpunit/CRM/Core/BAO/LocationTest.php b/tests/phpunit/CRM/Core/BAO/LocationTest.php index e545631432..cdd71734da 100644 --- a/tests/phpunit/CRM/Core/BAO/LocationTest.php +++ b/tests/phpunit/CRM/Core/BAO/LocationTest.php @@ -44,7 +44,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { public function setUp() { parent::setUp(); - $this->quickCleanup( array( 'civicrm_contact', 'civicrm_address', 'civicrm_loc_block', 'civicrm_email', 'civicrm_phone', 'civicrm_im' ) ); + $this->quickCleanup(array('civicrm_contact', 'civicrm_address', 'civicrm_loc_block', 'civicrm_email', 'civicrm_phone', 'civicrm_im')); } /** diff --git a/tests/phpunit/CRM/Core/BAO/SettingTest.php b/tests/phpunit/CRM/Core/BAO/SettingTest.php index a7ef13af41..8e40c24fc0 100644 --- a/tests/phpunit/CRM/Core/BAO/SettingTest.php +++ b/tests/phpunit/CRM/Core/BAO/SettingTest.php @@ -220,7 +220,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { 'is_contact' => 0, 'description' => NULL, 'help_text' => NULL, - 'on_change' => array( // list of callbacks + 'on_change' => array(// list of callbacks array(__CLASS__, '_testOnChange_onChangeExample') ), ), diff --git a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php index 3125eb1f25..c34f9c0c60 100644 --- a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php @@ -121,7 +121,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { $this->assertFalse(empty($this->objects['membership']), 'in line ' . __LINE__); $this->assertArrayHasKey($this->_membershipTypeID, $this->objects['membership'], 'in line ' . __LINE__); $this->assertTrue(is_a($this->objects['membership'][$this->_membershipTypeID], 'CRM_Member_BAO_Membership')); - $this->assertTrue(is_a( $this->objects['contributionType'],'CRM_Financial_BAO_FinancialType')); + $this->assertTrue(is_a($this->objects['contributionType'],'CRM_Financial_BAO_FinancialType')); $this->assertFalse(empty($this->objects['contributionRecur']), __LINE__); $this->assertFalse(empty($this->objects['paymentProcessor']), __LINE__); } @@ -181,7 +181,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, $this->_processorId); $this->assertFalse(empty($this->objects['participant']), 'in line ' . __LINE__); $this->assertTrue(is_a($this->objects['participant'], 'CRM_Event_BAO_Participant')); - $this->assertTrue(is_a( $this->objects['contributionType'],'CRM_Financial_BAO_FinancialType')); + $this->assertTrue(is_a($this->objects['contributionType'],'CRM_Financial_BAO_FinancialType')); $this->assertFalse(empty($this->objects['event'])); $this->assertTrue(is_a($this->objects['event'], 'CRM_Event_BAO_Event')); $this->assertTrue(is_a($this->objects['contribution'], 'CRM_Contribute_BAO_Contribution')); @@ -221,7 +221,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { $this->_setUpParticipantObjects(); $values = array(); require_once 'CiviTest/CiviMailUtils.php'; - $mut = new CiviMailUtils( $this, true ); + $mut = new CiviMailUtils($this, true); $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, $this->_processorId); $this->IPN->sendMail($this->input, $this->ids, $this->objects, $values, FALSE, FALSE); $mut->checkMailLog(array( @@ -247,7 +247,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { ); $this->quickCleanup($tablesToTruncate, FALSE); require_once 'CiviTest/CiviMailUtils.php'; - $mut = new CiviMailUtils( $this, true ); + $mut = new CiviMailUtils($this, true); $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, $this->_processorId); $this->IPN->sendMail($this->input, $this->ids, $this->objects, $values, FALSE, FALSE); $mut->assertMailLogEmpty('no mail should have been send as event set to no confirm'); @@ -261,7 +261,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { $this->_setUpPledgeObjects(); $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, $this->_processorId); $this->assertFalse(empty($this->objects['pledge_payment'][0]), 'in line ' . __LINE__); - $this->assertTrue(is_a( $this->objects['contributionType'],'CRM_Financial_BAO_FinancialType')); + $this->assertTrue(is_a($this->objects['contributionType'],'CRM_Financial_BAO_FinancialType')); $this->assertTrue(is_a($this->objects['contribution'], 'CRM_Contribute_BAO_Contribution')); $this->assertTrue(is_a($this->objects['pledge_payment'][0], 'CRM_Pledge_BAO_PledgePayment')); $this->assertFalse(empty($this->objects['pledge_payment'][0]->id)); diff --git a/tests/phpunit/CRM/Core/RegionTest.php b/tests/phpunit/CRM/Core/RegionTest.php index fe869627d4..31b08724c8 100644 --- a/tests/phpunit/CRM/Core/RegionTest.php +++ b/tests/phpunit/CRM/Core/RegionTest.php @@ -13,7 +13,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase { // Templates injected into regions should normally be file names, but for unit-testing it's handy to use "string:" notation require_once 'CRM/Core/Smarty/resources/String.php'; - civicrm_smarty_register_string_resource( ); + civicrm_smarty_register_string_resource(); } /** diff --git a/tests/phpunit/CRM/Core/ResourcesTest.php b/tests/phpunit/CRM/Core/ResourcesTest.php index 640b94fc82..177302cd0d 100644 --- a/tests/phpunit/CRM/Core/ResourcesTest.php +++ b/tests/phpunit/CRM/Core/ResourcesTest.php @@ -53,7 +53,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { // Templates injected into regions should normally be file names, but for unit-testing it's handy to use "string:" notation require_once 'CRM/Core/Smarty/resources/String.php'; - civicrm_smarty_register_string_resource( ); + civicrm_smarty_register_string_resource(); } public function testAddScriptFile() { diff --git a/tests/phpunit/CRM/Dedupe/DedupeFinderTest.php b/tests/phpunit/CRM/Dedupe/DedupeFinderTest.php index 3b8c19d813..7c6928507f 100644 --- a/tests/phpunit/CRM/Dedupe/DedupeFinderTest.php +++ b/tests/phpunit/CRM/Dedupe/DedupeFinderTest.php @@ -191,7 +191,7 @@ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase { 'location_type_id' => 1, 'version' => 3, ); - $result = civicrm_api( 'address', 'create', $params ); + $result = civicrm_api('address', 'create', $params); $contactIds[$count++] = $contact['id']; } diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php index 4e0e79f384..36897ca951 100644 --- a/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php @@ -137,6 +137,6 @@ class CRM_Financial_BAO_FinancialAccountTest extends CiviUnitTestCase { $financialAccountid = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialAccount', 'Donations', 'id', 'name'); CRM_Core_DAO::setFieldValue('CRM_Financial_DAO_FinancialAccount', $financialAccountid, 'accounting_code', '4800'); $accountingCode = CRM_Financial_BAO_FinancialAccount::getAccountingCode($financialType->id); - $this->assertEquals( $accountingCode, 4800, 'Verify accounting code.'); + $this->assertEquals($accountingCode, 4800, 'Verify accounting code.'); } } diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php index a6df900deb..c6d5eeb8d9 100755 --- a/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php @@ -83,7 +83,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase { 'entity_id', 'Database check on added financial item record.' ); - $this->assertEquals( $result, $price, 'Verify Amount for Financial Item'); + $this->assertEquals($result, $price, 'Verify Amount for Financial Item'); } /** @@ -130,7 +130,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase { 'entity_table' => 'civicrm_line_item', ); $financialItem = CRM_Financial_BAO_FinancialItem::retrieve($fParams, $values); - $this->assertEquals( $financialItem->amount, $price, 'Verify financial item amount.'); + $this->assertEquals($financialItem->amount, $price, 'Verify financial item amount.'); } /** @@ -198,7 +198,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase { 'Database check on added financial item record.' ); - $this->assertEquals( $result, $price, 'Verify Amount for Financial Item'); + $this->assertEquals($result, $price, 'Verify Amount for Financial Item'); $entityResult = $this->assertDBNotNull( 'CRM_Financial_DAO_EntityFinancialTrxn', $entityId, @@ -206,7 +206,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase { 'entity_id', 'Database check on added entity financial trxn record.' ); - $this->assertEquals( $entityResult, $price, 'Verify Amount for Financial Item'); + $this->assertEquals($entityResult, $price, 'Verify Amount for Financial Item'); } /** @@ -241,7 +241,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase { 'financial_trxn_id', 'Database check on added entity financial trxn record.' ); - $this->assertEquals( $entityResult, $amount, 'Verify Amount for Financial Item'); + $this->assertEquals($entityResult, $amount, 'Verify Amount for Financial Item'); return $entityTrxn; } @@ -265,6 +265,6 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase { 'financial_trxn_id', 'Database check on added entity financial trxn record.' ); - $this->assertEquals( $entityResult, $entityTrxn->amount, 'Verify Amount for Financial Item'); + $this->assertEquals($entityResult, $entityTrxn->amount, 'Verify Amount for Financial Item'); } } diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php index f6c16c81c2..2f760ee827 100755 --- a/tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php @@ -69,7 +69,7 @@ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase { 'financial_account_id', 'Database check on added financial type record.' ); - $this->assertEquals( $result, $financialType->id, 'Verify Account Type'); + $this->assertEquals($result, $financialType->id, 'Verify Account Type'); } /** @@ -97,9 +97,9 @@ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase { ); $financialAccountType = CRM_Financial_BAO_FinancialTypeAccount::add($financialParams, $ids); CRM_Financial_BAO_FinancialTypeAccount::del($financialAccountType->id); - $params = array('id' => $financialAccountType->id ); + $params = array('id' => $financialAccountType->id); $result = CRM_Financial_BAO_FinancialType::retrieve($params, $defaults); - $this->assertEquals( empty($result), TRUE, 'Verify financial types record deletion.'); + $this->assertEquals(empty($result), TRUE, 'Verify financial types record deletion.'); } /** @@ -127,8 +127,8 @@ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase { CRM_Financial_BAO_FinancialTypeAccount::add($financialParams, $ids); $defaults = array(); $financialAccountType = CRM_Financial_BAO_FinancialTypeAccount::retrieve($financialParams, $defaults); - $this->assertEquals( $financialAccountType['entity_id'], $financialType->id, 'Verify Entity Id.'); - $this->assertEquals( $financialAccountType['financial_account_id'], $financialAccount->id, 'Verify Financial Account Id.'); + $this->assertEquals($financialAccountType['entity_id'], $financialType->id, 'Verify Entity Id.'); + $this->assertEquals($financialAccountType['financial_account_id'], $financialAccount->id, 'Verify Financial Account Id.'); } /** @@ -188,6 +188,6 @@ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase { CRM_Financial_BAO_FinancialTypeAccount::add($financialParams, $ids); $financialAccountId = CRM_Financial_BAO_FinancialTypeAccount::getInstrumentFinancialAccount($paymentInstrumentValue); - $this->assertEquals( $financialAccountId, $financialAccount->id, 'Verify Payment Instrument'); + $this->assertEquals($financialAccountId, $financialAccount->id, 'Verify Payment Instrument'); } } diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php index 7124a26277..0a242c358c 100755 --- a/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php @@ -58,7 +58,7 @@ class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase { 'id', 'Database check on added financial type record.' ); - $this->assertEquals( $result, 'Donations', 'Verify Name for Financial Type'); + $this->assertEquals($result, 'Donations', 'Verify Name for Financial Type'); } /** diff --git a/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php b/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php index f990ad5996..a42a61bd67 100755 --- a/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php +++ b/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php @@ -55,7 +55,7 @@ class CRM_Financial_BAO_PaymentProcessorTypeTest extends CiviUnitTestCase { 'name', 'Database check on added payment processor type record.' ); - $this->assertEquals( $result, 'Test Payment Processor', 'Verify Payment Processor Type'); + $this->assertEquals($result, 'Test Payment Processor', 'Verify Payment Processor Type'); } /** @@ -70,7 +70,7 @@ class CRM_Financial_BAO_PaymentProcessorTypeTest extends CiviUnitTestCase { $defaults = array(); CRM_Financial_BAO_PaymentProcessorType::create($params); $result = CRM_Financial_BAO_PaymentProcessorType::retrieve($params, $defaults); - $this->assertEquals( $result->name, 'Test_Retrieve_Payment_Processor', 'Verify Payment Processor Type'); + $this->assertEquals($result->name, 'Test_Retrieve_Payment_Processor', 'Verify Payment Processor Type'); } /** diff --git a/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php b/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php index 30df7dd12b..cdd764b3ed 100644 --- a/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php +++ b/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php @@ -17,7 +17,7 @@ class CRM_Mailing_BAO_SpoolTest extends CiviUnitTestCase { public function setUp() { parent::setUp(); - $this->_mut = new CiviMailUtils( $this, TRUE ); + $this->_mut = new CiviMailUtils($this, TRUE); } public function tearDown() { @@ -36,7 +36,7 @@ class CRM_Mailing_BAO_SpoolTest extends CiviUnitTestCase { 'email' => substr(sha1(rand()), 0, 7) . '@example.org', 'contact_type' => 'Individual', ); - $contact_id_1 = $this->individualCreate( $contact_params_1 ); + $contact_id_1 = $this->individualCreate($contact_params_1); $contact_params_2 = array( 'first_name' => substr(sha1(rand()), 0, 7), @@ -44,11 +44,11 @@ class CRM_Mailing_BAO_SpoolTest extends CiviUnitTestCase { 'email' => substr(sha1(rand()), 0, 7) . '@example.org', 'contact_type' => 'Individual', ); - $contact_id_2 = $this->individualCreate( $contact_params_2 ); + $contact_id_2 = $this->individualCreate($contact_params_2); $subject = 'Test spool'; $params = array( - 'from' => CRM_Utils_Mail::formatRFC822Email( $contact_params_1['first_name'] . " " . $contact_params_1['last_name'], $contact_params_1['email'] ), + 'from' => CRM_Utils_Mail::formatRFC822Email($contact_params_1['first_name'] . " " . $contact_params_1['last_name'], $contact_params_1['email']), 'toName' => $contact_params_2['first_name'] . " " . $contact_params_2['last_name'], 'toEmail' => $contact_params_2['email'], 'subject' => $subject, @@ -56,20 +56,20 @@ class CRM_Mailing_BAO_SpoolTest extends CiviUnitTestCase { 'html' => "

\n" . self::$bodytext . '

', ); - CRM_Utils_Mail::send( $params ); + CRM_Utils_Mail::send($params); - $mail = $this->_mut->getMostRecentEmail( 'raw' ); - $this->assertContains( "Subject: $subject", $mail ); - $this->assertContains( self::$bodytext, $mail ); + $mail = $this->_mut->getMostRecentEmail('raw'); + $this->assertContains("Subject: $subject", $mail); + $this->assertContains(self::$bodytext, $mail); - $mail = $this->_mut->getMostRecentEmail( 'ezc' ); + $mail = $this->_mut->getMostRecentEmail('ezc'); - $this->assertEquals( $subject, $mail->subject ); - $this->assertContains( $contact_params_1['email'], $mail->from->email, 'From address incorrect.' ); - $this->assertContains( $contact_params_2['email'], $mail->to[0]->email, 'Recipient incorrect.' ); + $this->assertEquals($subject, $mail->subject); + $this->assertContains($contact_params_1['email'], $mail->from->email, 'From address incorrect.'); + $this->assertContains($contact_params_2['email'], $mail->to[0]->email, 'Recipient incorrect.'); - $context = new ezcMailPartWalkContext( array( get_class($this), 'mailWalkCallback' ) ); - $mail->walkParts( $context, $mail ); + $context = new ezcMailPartWalkContext(array(get_class($this), 'mailWalkCallback')); + $mail->walkParts($context, $mail); } /** @@ -77,14 +77,14 @@ class CRM_Mailing_BAO_SpoolTest extends CiviUnitTestCase { * @param $mailPart */ public static function mailWalkCallback($context, $mailPart) { - if ( $mailPart instanceof ezcMailText ) { - switch ( $mailPart->subType ) { + if ($mailPart instanceof ezcMailText) { + switch ($mailPart->subType) { case 'plain': - self::assertContains( self::$bodytext, $mailPart->generateBody() ); + self::assertContains(self::$bodytext, $mailPart->generateBody()); break; case 'html': - self::assertContains( self::$bodytext . '

', $mailPart->generateBody() ); + self::assertContains(self::$bodytext . '

', $mailPart->generateBody()); break; } } diff --git a/tests/phpunit/CRM/Member/BAO/MembershipTest.php b/tests/phpunit/CRM/Member/BAO/MembershipTest.php index e747af7d69..48826583fb 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipTest.php @@ -69,9 +69,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { * */ public function tearDown() { - $this->membershipTypeDelete( array( 'id' => $this->_membershipTypeID ) ); - $this->membershipStatusDelete( $this->_membershipStatusID ); - Contact::delete( $this->_contactID ); + $this->membershipTypeDelete(array('id' => $this->_membershipTypeID)); + $this->membershipStatusDelete($this->_membershipStatusID); + Contact::delete($this->_contactID); $this->_contactID = $this->_membershipStatusID = $this->_membershipTypeID = NULL; } diff --git a/tests/phpunit/CRM/Utils/JSTest.php b/tests/phpunit/CRM/Utils/JSTest.php index 768f3d625c..d5a43bb545 100644 --- a/tests/phpunit/CRM/Utils/JSTest.php +++ b/tests/phpunit/CRM/Utils/JSTest.php @@ -40,27 +40,27 @@ class CRM_Utils_JSTest extends CiviUnitTestCase { '', array(), ); - $cases[] = array( // missing ts + $cases[] = array(// missing ts 'alert("Hello world")', array(), ); - $cases[] = array( // basic function call + $cases[] = array(// basic function call 'alert(ts("Hello world"));', array('Hello world'), ); - $cases[] = array( // with arg + $cases[] = array(// with arg 'alert(ts("Hello world", {1: "whiz"}));', array('Hello world'), ); - $cases[] = array( // not really ts() + $cases[] = array(// not really ts() 'alert(clients("Hello world"));', array(), ); - $cases[] = array( // not really ts() + $cases[] = array(// not really ts() 'alert(clients("Hello world", {1: "whiz"}));', array(), ); - $cases[] = array( // with arg + $cases[] = array(// with arg ' public function whits() { for (a in b) { @@ -72,15 +72,15 @@ class CRM_Utils_JSTest extends CiviUnitTestCase { ', array('Hello'), ); - $cases[] = array( // duplicate + $cases[] = array(// duplicate 'alert(ts("Hello world") + "-" + ts("Hello world"));', array('Hello world'), ); - $cases[] = array( // two strings, addition + $cases[] = array(// two strings, addition 'alert(ts("Hello world") + "-" + ts("How do you do?"));', array('Hello world', 'How do you do?'), ); - $cases[] = array( // two strings, separate calls + $cases[] = array(// two strings, separate calls 'alert(ts("Hello world");\nalert(ts("How do you do?"));', array('Hello world', 'How do you do?'), ); @@ -88,11 +88,11 @@ class CRM_Utils_JSTest extends CiviUnitTestCase { 'alert(ts(\'Single quoted\'));', array('Single quoted'), ); - $cases[] = array( // unclear string + $cases[] = array(// unclear string 'alert(ts(message));', array(), ); - $cases[] = array( // ts() within a string + $cases[] = array(// ts() within a string 'alert(ts("Does the ts(\'example\') notation work?"));', array('Does the ts(\'example\') notation work?'), ); diff --git a/tests/phpunit/CRM/Utils/SQL/InsertTest.php b/tests/phpunit/CRM/Utils/SQL/InsertTest.php index bb11f4ace9..b82bc0d491 100644 --- a/tests/phpunit/CRM/Utils/SQL/InsertTest.php +++ b/tests/phpunit/CRM/Utils/SQL/InsertTest.php @@ -7,7 +7,7 @@ class CRM_Utils_SQL_InsertTest extends CiviUnitTestCase { public function testRow_twice() { $insert = CRM_Utils_SQL_Insert::into('foo') - ->row(array('first' => '1', 'second' => '2' )) + ->row(array('first' => '1', 'second' => '2')) ->row(array('second' => '2b', 'first' => '1b')); $expected = ' INSERT INTO foo (`first`,`second`) VALUES @@ -19,7 +19,7 @@ class CRM_Utils_SQL_InsertTest extends CiviUnitTestCase { public function testRows() { $insert = CRM_Utils_SQL_Insert::into('foo') - ->row(array('first' => '1', 'second' => '2' )) + ->row(array('first' => '1', 'second' => '2')) ->rows(array( array('second' => '2b', 'first' => '1b'), array('first' => '1c', 'second' => '2c') diff --git a/tests/phpunit/CiviTest/bootstrap.php b/tests/phpunit/CiviTest/bootstrap.php index 31920cc104..a775679e68 100644 --- a/tests/phpunit/CiviTest/bootstrap.php +++ b/tests/phpunit/CiviTest/bootstrap.php @@ -9,13 +9,13 @@ ini_set('include_path', "{$GLOBALS['base_dir']}" . PATH_SEPARATOR . "$tests_dir" . PATH_SEPARATOR . "$civi_pkgs_dir" . PATH_SEPARATOR - . ini_get( 'include_path') ); + . ini_get('include_path')); # Relying on system timezone setting produces a warning, # doing the following prevents the warning message -if ( file_exists( '/etc/timezone' ) ) { - $timezone = trim( file_get_contents( '/etc/timezone' ) ); - if ( ini_set('date.timezone', $timezone ) === FALSE ) { +if (file_exists('/etc/timezone')) { + $timezone = trim(file_get_contents('/etc/timezone')); + if (ini_set('date.timezone', $timezone) === FALSE) { echo "ini_set( 'date.timezone', '$timezone' ) failed\n"; } } diff --git a/tests/phpunit/CiviTest/civicrm.settings.dist.php b/tests/phpunit/CiviTest/civicrm.settings.dist.php index fc50cd20c8..e0647100cf 100644 --- a/tests/phpunit/CiviTest/civicrm.settings.dist.php +++ b/tests/phpunit/CiviTest/civicrm.settings.dist.php @@ -8,12 +8,12 @@ define('CIVICRM_TEST', 1); //--- you shouldn't have to modify anything under this line, but might want to put the compiled templates CIVICRM_TEMPLATE_COMPILEDIR in a different folder than our default location ---------- -if ( ! defined( 'CIVICRM_DSN' ) && ! empty( $GLOBALS['mysql_user'] ) ) { - $dbName = ! empty( $GLOBALS['mysql_db'] ) ? $GLOBALS['mysql_db'] : 'civicrm_tests_dev'; - if ( empty( $GLOBALS['mysql_pass'] ) && $GLOBALS['mysql_pass_need_password'] ) { - $GLOBALS['mysql_pass'] = PHPUnit_TextUI_Command::getPassword( 'Password' ); +if (! defined('CIVICRM_DSN') && ! empty($GLOBALS['mysql_user'])) { + $dbName = ! empty($GLOBALS['mysql_db']) ? $GLOBALS['mysql_db'] : 'civicrm_tests_dev'; + if (empty($GLOBALS['mysql_pass']) && $GLOBALS['mysql_pass_need_password']) { + $GLOBALS['mysql_pass'] = PHPUnit_TextUI_Command::getPassword('Password'); } - define( 'CIVICRM_DSN', "mysql://{$GLOBALS['mysql_user']}:{$GLOBALS['mysql_pass']}@{$GLOBALS['mysql_host']}/{$dbName}?new_link=true" ); + define('CIVICRM_DSN', "mysql://{$GLOBALS['mysql_user']}:{$GLOBALS['mysql_pass']}@{$GLOBALS['mysql_host']}/{$dbName}?new_link=true"); } @@ -61,7 +61,7 @@ define('CIVICRM_UF', 'UnitTests'); global $civicrm_root; if (empty($civicrm_root)) { - $civicrm_root = dirname(dirname(dirname(dirname( __FILE__ ) ))); + $civicrm_root = dirname(dirname(dirname(dirname(__FILE__)))); } #$civicrm_root = '/var/www/drupal7.dev.civicrm.org/public/sites/devel.drupal7.tests.dev.civicrm.org/modules/civicrm'; @@ -70,14 +70,14 @@ if (empty($civicrm_root)) { if (!defined("CIVICRM_TEMPLATE_COMPILEDIR")) { if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - define( 'CIVICRM_TEMPLATE_COMPILEDIR', getenv('TMP') . DIRECTORY_SEPARATOR . 'civi' . DIRECTORY_SEPARATOR ); + define('CIVICRM_TEMPLATE_COMPILEDIR', getenv('TMP') . DIRECTORY_SEPARATOR . 'civi' . DIRECTORY_SEPARATOR); } else { - define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/tmp/civi/' ); + define('CIVICRM_TEMPLATE_COMPILEDIR', '/tmp/civi/'); } } -define( 'CIVICRM_SITE_KEY', 'phpunittestfakekey' ); +define('CIVICRM_SITE_KEY', 'phpunittestfakekey'); /** * Site URLs: @@ -105,7 +105,7 @@ define( 'CIVICRM_SITE_KEY', 'phpunittestfakekey' ); * */ if (!defined('CIVICRM_UF_BASEURL')) { - define( 'CIVICRM_UF_BASEURL', 'http://FIX ME' ); + define('CIVICRM_UF_BASEURL', 'http://FIX ME'); } /** @@ -125,13 +125,13 @@ define('CIVICRM_MYSQL_STRICT', TRUE); $include_path = '.' . PATH_SEPARATOR . $civicrm_root . PATH_SEPARATOR . $civicrm_root . DIRECTORY_SEPARATOR . 'packages' . PATH_SEPARATOR . - get_include_path( ); -set_include_path( $include_path ); + get_include_path(); +set_include_path($include_path); -if ( function_exists( 'variable_get' ) && variable_get('clean_url', '0') != '0' ) { - define( 'CIVICRM_CLEANURL', 1 ); +if (function_exists('variable_get') && variable_get('clean_url', '0') != '0') { + define('CIVICRM_CLEANURL', 1); } else { - define( 'CIVICRM_CLEANURL', 0 ); + define('CIVICRM_CLEANURL', 0); } // force PHP to auto-detect Mac line endings diff --git a/tests/phpunit/WebTest/Activity/ContactContextAddTest.php b/tests/phpunit/WebTest/Activity/ContactContextAddTest.php index 3d448bbe4f..5b3a33ad4d 100644 --- a/tests/phpunit/WebTest/Activity/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Activity/ContactContextAddTest.php @@ -221,7 +221,7 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase { $this->clickLink('_qf_Search_refresh'); - $targetContacts = array("Summerson, ". $firstName1, "Andersonnn, ". $firstName2, "Anderson, ". $firstName3 ); + $targetContacts = array("Summerson, ". $firstName1, "Andersonnn, ". $firstName2, "Anderson, ". $firstName3); //check whether separate activities are created for the target contacts foreach ($targetContacts as $contact) { diff --git a/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php b/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php index 1709421b4c..3a91a90519 100644 --- a/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php @@ -132,7 +132,7 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase { // fill in step 1 (Title and Settings) $contributionPageTitle = "Title $contributionTitle"; $this->type('title', $contributionPageTitle); - $this->select( 'financial_type_id', 'value=1' ); + $this->select('financial_type_id', 'value=1'); // select campaign $this->click("campaign_id"); diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index 52377cbfd5..c5cbb4101e 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -307,13 +307,13 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes public function testAdvanceSearchForLog() { $this->webtestLogin(); - $Pdate = date('F jS, Y h:i:s A', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) - 1, date( 'Y' )) ); - $Ndate = date('F jS, Y h:i:s A', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) + 1, date( 'Y' )) ); + $Pdate = date('F jS, Y h:i:s A', mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'))); + $Ndate = date('F jS, Y h:i:s A', mktime(0, 0, 0, date('m'), date('d') + 1, date('Y'))); //create a contact and return the contact id $firstNameSoft = "John_".substr(sha1(rand()), 0, 5); $lastNameSoft = "Doe_".substr(sha1(rand()), 0, 5); - $this->webtestAddContact( $firstNameSoft, $lastNameSoft ); + $this->webtestAddContact($firstNameSoft, $lastNameSoft); $cid = $this->urlArg('cid'); //advance search for created contacts diff --git a/tests/phpunit/WebTest/Contact/MergeContactsTest.php b/tests/phpunit/WebTest/Contact/MergeContactsTest.php index 4072c16e89..21d8685cd6 100644 --- a/tests/phpunit/WebTest/Contact/MergeContactsTest.php +++ b/tests/phpunit/WebTest/Contact/MergeContactsTest.php @@ -739,7 +739,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->select2('member_of_contact_id', $membershipOrganization); $this->type('minimum_fee', '1'); - $this->select( 'financial_type_id', 'value=2' ); + $this->select('financial_type_id', 'value=2'); $this->type('duration_interval', 1); $this->select('duration_unit', "label=year"); diff --git a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php index 14be822256..04dafd980d 100644 --- a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php @@ -380,7 +380,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE); foreach ($verifyData as $label => $value) { - if ( $label == 'sort_name' ) { + if ($label == 'sort_name') { continue; } $this->verifyText("xpath=//form[@id='ContributionView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td", diff --git a/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php index e66f3207cf..577bef100e 100644 --- a/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php +++ b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php @@ -1207,7 +1207,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->type('minimum_fee', '50'); - $this->select( 'financial_type_id', 'value=2' ); + $this->select('financial_type_id', 'value=2'); $this->type('duration_interval', 1); $this->select('duration_unit', "label=year"); diff --git a/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php index dbc9c02695..ad128bf12f 100644 --- a/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php @@ -195,7 +195,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium $this->createDialogContact(); // select financial type - $this->select( "financial_type_id", "value=1" ); + $this->select("financial_type_id", "value=1"); //Contribution status $this->select("contribution_status_id", "label=Pending"); diff --git a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php index 6ce7c1b187..eaf03ff857 100755 --- a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php @@ -101,8 +101,8 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $search, $compare); $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution')); - $search = array( 'entity_id' => $lineItem ); - $compare = array( 'status_id' => 1 ); + $search = array('entity_id' => $lineItem); + $compare = array('status_id' => 1); $this->assertDBCompareValues("CRM_Financial_DAO_FinancialItem", $search, $compare); $status = $this->_getPremiumActualCost($contId, 'Accounts Receivable', 'Payment Processor Account', NULL, "'civicrm_contribution'", "ft.status_id as status"); @@ -152,7 +152,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { // create new contact using dialog $this->createDialogContact(); // select financial type - $this->select( "financial_type_id", "value=1" ); + $this->select("financial_type_id", "value=1"); // total amount $this->type("total_amount", "100"); // fill Premium information @@ -339,8 +339,8 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $this->waitForText('crm-notification-container', "The contribution record has been saved."); //Assertions - $search = array( 'id' => $contId ); - $compare = array( 'financial_type_id' => 3 ); + $search = array('id' => $contId); + $compare = array('financial_type_id' => 3); $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $search, $compare); $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution')); @@ -460,7 +460,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $contact = $this->createDialogContact(); // select financial type - $this->select( "financial_type_id", "value=1" ); + $this->select("financial_type_id", "value=1"); //Contribution status $this->select("contribution_status_id", "label=$status"); diff --git a/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php index 2d529a7da9..83571a1775 100644 --- a/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php @@ -88,7 +88,7 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC $contact = $this->createDialogContact(); // select financial type - $this->select( "financial_type_id", "value=1" ); + $this->select("financial_type_id", "value=1"); // fill in Received Date $this->webtestFillDate('receive_date'); diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index d008af01d9..750f331043 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -900,7 +900,7 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'"; $this->type('summary', 'This is a great conference. Sign up now!'); // Type description in ckEditor (fieldname, text to type, editor) - $this->fillRichTextField('description', $eventDescription ); + $this->fillRichTextField('description', $eventDescription); $this->type('max_participants', '50'); $this->click('is_map'); $this->click('_qf_EventInfo_upload-bottom'); diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index 0f822a94b7..2b37cf18fa 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -405,7 +405,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->type('summary', 'This is a great conference. Sign up now!'); // Type description in ckEditor (fieldname, text to type, editor) - $this->fillRichTextField('description', $eventDescription ); + $this->fillRichTextField('description', $eventDescription); // Choose Start and End dates. // Using helper webtestFillDate function. diff --git a/tests/phpunit/WebTest/Financial/FinancialBatchExport.php b/tests/phpunit/WebTest/Financial/FinancialBatchExport.php index d6406db601..7a4f5f7bd3 100644 --- a/tests/phpunit/WebTest/Financial/FinancialBatchExport.php +++ b/tests/phpunit/WebTest/Financial/FinancialBatchExport.php @@ -100,7 +100,7 @@ class WebTest_Financial_FinancialBatchExport extends CiviSeleniumTestCase { * @param $numberOfTrxn */ public function _testAssignBatch($numberOfTrxn) { - $this->select( "xpath=//div[@id='crm-transaction-selector-assign_length']/label/select[@name='crm-transaction-selector-assign_length']", "value=$numberOfTrxn" ); + $this->select("xpath=//div[@id='crm-transaction-selector-assign_length']/label/select[@name='crm-transaction-selector-assign_length']", "value=$numberOfTrxn"); // Because it tends to cause problems, all uses of sleep() must be justified in comments // Sleep should never be used for wait for anything to load from the server // Justification for this instance: FIXME diff --git a/tests/phpunit/WebTest/Import/MatchExternalIdTest.php b/tests/phpunit/WebTest/Import/MatchExternalIdTest.php index 2123b58444..4ec33e068d 100644 --- a/tests/phpunit/WebTest/Import/MatchExternalIdTest.php +++ b/tests/phpunit/WebTest/Import/MatchExternalIdTest.php @@ -318,7 +318,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { $this->waitForElementPresent("_qf_Fee_upload-bottom"); $this->click("CIVICRM_QFID_1_is_monetary"); $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']"); - $this->select( "financial_type_id", "value=4" ); + $this->select("financial_type_id", "value=4"); $counter = 1; foreach ($params['fee_level'] as $label => $amount) { diff --git a/tests/phpunit/WebTest/Mailing/MailingTest.php b/tests/phpunit/WebTest/Mailing/MailingTest.php index 0615cb7b70..1666b967a3 100644 --- a/tests/phpunit/WebTest/Mailing/MailingTest.php +++ b/tests/phpunit/WebTest/Mailing/MailingTest.php @@ -214,7 +214,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { $this->clickLink("link=Successful Deliveries"); // check for open page - $this->assertElementContainsText( 'page-title', "Successful Deliveries"); + $this->assertElementContainsText('page-title', "Successful Deliveries"); // verify email $this->verifyText("xpath=//table[@id='mailing_event']/tbody//tr/td[2]", preg_quote("mailino$firstName@mailson.co.in")); diff --git a/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php b/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php index 4347d21770..54c0252a81 100755 --- a/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php +++ b/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php @@ -183,7 +183,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase } elseif ($usedFor == 'Membership') { $this->click('extends[3]'); - $this->waitForElementPresent( 'financial_type_id' ); + $this->waitForElementPresent('financial_type_id'); $this->select("css=select.crm-form-select", "label={$contributionType}"); } diff --git a/tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php b/tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php index 0aa4b8e6b2..8fc4c06104 100644 --- a/tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php +++ b/tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php @@ -62,7 +62,7 @@ class WebTest_Member_FixedMembershipTypeTest extends CiviSeleniumTestCase { $this->select2('member_of_contact_id', $title); $this->type('minimum_fee', '100'); - $this->select( 'financial_type_id', 'value=2' ); + $this->select('financial_type_id', 'value=2'); $this->type('duration_interval', 1); $this->select('duration_unit', "label=year"); @@ -217,7 +217,7 @@ SELECT end_event_adjust_interval $this->select2('member_of_contact_id', $title); $this->type('minimum_fee', '100'); - $this->select( 'financial_type_id', 'value=2' ); + $this->select('financial_type_id', 'value=2'); $this->type('duration_interval', 2); $this->select('duration_unit', "label=year"); @@ -374,7 +374,7 @@ SELECT end_event_adjust_interval $this->select2('member_of_contact_id', $title); $this->type('minimum_fee', '100'); - $this->select( 'financial_type_id', 'value=2' ); + $this->select('financial_type_id', 'value=2'); $this->type('duration_interval', 1); $this->select('duration_unit', "label=year"); @@ -523,7 +523,7 @@ SELECT end_event_adjust_interval $this->select2('member_of_contact_id', $title); $this->type('minimum_fee', '100'); - $this->select( 'financial_type_id', 'value=2' ); + $this->select('financial_type_id', 'value=2'); $this->type('duration_interval', 1); $this->select('duration_unit', "label=year"); diff --git a/tests/phpunit/WebTest/Member/InheritedMembershipTest.php b/tests/phpunit/WebTest/Member/InheritedMembershipTest.php index 6b538de46b..06f387ecbb 100644 --- a/tests/phpunit/WebTest/Member/InheritedMembershipTest.php +++ b/tests/phpunit/WebTest/Member/InheritedMembershipTest.php @@ -57,7 +57,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { $this->select2('member_of_contact_id', $title); $this->type('minimum_fee', '100'); - $this->select( 'financial_type_id', 'value=2' ); + $this->select('financial_type_id', 'value=2'); $this->type('duration_interval', 1); $this->select('duration_unit', 'label=year'); diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php index 37ff8aea7a..f478790972 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php @@ -141,7 +141,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa } $i++; } - $this->waitForElementPresent( 'financial_type_id' ); + $this->waitForElementPresent('financial_type_id'); $this->select("financial_type_id", "label={$contributionType}"); $this->waitForElementPresent('_qf_Field_next-bottom'); $this->click('_qf_Field_next-bottom'); @@ -411,7 +411,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa $this->select('price_set_id', "value={$sid}"); $this->waitForElementPresent('pricesetTotal'); - $i = ($term == 3) ? 3 : (($term == 2) ? 2 : 1 ); + $i = ($term == 3) ? 3 : (($term == 2) ? 2 : 1); $this->waitForElementPresent("xpath=//div[@id='priceset']/div[2]/div[2]/div[$i]/span/input"); $this->click("xpath=//div[@id='priceset']/div[2]/div[2]/div[$i]/span/input"); $amount = $this->getText("xpath=//div[@id='priceset']/div[2]/div[2]/div[$i]/span/label/span[@class='crm-price-amount-amount']"); diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php index d82c6cb003..4a7021191a 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php @@ -355,8 +355,8 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { // Record contribution $this->click('record_contribution'); - $this->waitForElementPresent( 'financial_type_id' ); - $this->select( 'financial_type_id', "label=Member Dues" ); + $this->waitForElementPresent('financial_type_id'); + $this->select('financial_type_id', "label=Member Dues"); $this->select('payment_instrument_id', "label=Check"); $this->waitForElementPresent('check_number'); $this->type('check_number', '1023'); diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php index 9f14229fbe..26c5e13fe3 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php @@ -151,7 +151,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas } $i++; } - $this->waitForElementPresent( 'financial_type_id' ); + $this->waitForElementPresent('financial_type_id'); $this->select("financial_type_id", "label={$contributionType}"); $this->waitForElementPresent('_qf_Field_next-bottom'); $this->clickLink('_qf_Field_next-bottom'); @@ -201,7 +201,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas } elseif ($usedFor == 'Membership') { $this->click('extends[3]'); - $this->waitForElementPresent( 'financial_type_id' ); + $this->waitForElementPresent('financial_type_id'); $this->select("css=select.crm-form-select", "label={$contributionType}"); } @@ -448,7 +448,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas 'joinDate', 'startDate', 'endDate') as $date) { $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull); } - $i = ($term == 3) ? 3 : (($term == 2) ? 2 : 1 ); + $i = ($term == 3) ? 3 : (($term == 2) ? 2 : 1); $this->waitForElementPresent("xpath=//div[@id='priceset']/div[2]/div[2]/div[$i]/span/input"); $this->click("xpath=//div[@id='priceset']/div[2]/div[2]/div[$i]/span/input"); $amount = $this->getText("xpath=//div[@id='priceset']/div[2]/div[2]/div[$i]/span/label/span[@class='crm-price-amount-amount']"); diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php index cc01c2661e..c8f52328d5 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php @@ -394,7 +394,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase { $this->select2('member_of_contact_id', $title); $this->type('minimum_fee', '100'); - $this->select( 'financial_type_id', 'value=2' ); + $this->select('financial_type_id', 'value=2'); $this->type('duration_interval', 1); $this->select('duration_unit', 'label=year'); $this->select('period_type', 'value=rolling'); diff --git a/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php b/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php index 9eae2d513f..0b5bc45bb0 100644 --- a/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php +++ b/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php @@ -111,7 +111,7 @@ class WebTest_Member_UpdateMembershipScriptTest extends CiviSeleniumTestCase { // Membership fees $this->type('minimum_fee', '100'); - $this->select( 'financial_type_id', "value={$memTypeParams['financial_type']}" ); + $this->select('financial_type_id', "value={$memTypeParams['financial_type']}"); // Duration for which the membership will be active $this->type('duration_interval', 1); diff --git a/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php b/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php index 04c2047084..c847d4bde4 100644 --- a/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php +++ b/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php @@ -78,7 +78,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest $this->type("frequency_day", "2"); $this->webtestFillDate('acknowledge_date', 'now'); - $this->select( "financial_type_id", "label=Donation"); + $this->select("financial_type_id", "label=Donation"); $this->select("contribution_page_id", "value=3"); diff --git a/tests/phpunit/WebTest/Report/AddTest.php b/tests/phpunit/WebTest/Report/AddTest.php index 78ed4ce900..3c4ac58bf7 100644 --- a/tests/phpunit/WebTest/Report/AddTest.php +++ b/tests/phpunit/WebTest/Report/AddTest.php @@ -44,7 +44,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { $emailId = "$firstName.anderson@example.org"; $this->webtestAddContact($firstName, "Anderson", $emailId); - $this->openCiviPage('report/contact/summary', 'reset=1', '_qf_Summary_submit' ); + $this->openCiviPage('report/contact/summary', 'reset=1', '_qf_Summary_submit'); // enable email field $this->click("fields[email]"); diff --git a/tests/phpunit/WebTest/Report/LoggingReportTest.php b/tests/phpunit/WebTest/Report/LoggingReportTest.php index 766013bdcb..8a28e6130e 100644 --- a/tests/phpunit/WebTest/Report/LoggingReportTest.php +++ b/tests/phpunit/WebTest/Report/LoggingReportTest.php @@ -283,7 +283,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[2][contains(text(), '{$value['log_type']}')]/../{$contactCheck}/../{$actionPath}"), "The proper record not present for (log type : {$value['log_type']}, altered contact : {$value['altered_contact']}, action as {$value['action']})"); if ($value['action'] == 'Update') { - $this->assertTrue( ($value['action'] == $this->getText("xpath=//table/tbody//tr/td[2][contains(text(), '{$value['log_type']}')]/../td[4]/a[contains(text(), '{$value['altered_contact']}')]/../../{$actionPath}")), "The proper record action {$value['action']} not present for (log type : {$value['log_type']}, altered contact : {$value['altered_contact']} record)"); + $this->assertTrue(($value['action'] == $this->getText("xpath=//table/tbody//tr/td[2][contains(text(), '{$value['log_type']}')]/../td[4]/a[contains(text(), '{$value['altered_contact']}')]/../../{$actionPath}")), "The proper record action {$value['action']} not present for (log type : {$value['log_type']}, altered contact : {$value['altered_contact']} record)"); } } } @@ -313,7 +313,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { //visit the logging contact summary report $this->openCiviPage('report/logging/contact/summary', 'reset=1'); foreach ($filters as $type => $filter) { - if ($type == 'text' ) { + if ($type == 'text') { foreach ($filter as $filterName => $filterValue) { $this->type($filterName, $filterValue); } diff --git a/tests/phpunit/WebTest/Utils/RestTest.php b/tests/phpunit/WebTest/Utils/RestTest.php index fd569b2a86..672d5a40e9 100644 --- a/tests/phpunit/WebTest/Utils/RestTest.php +++ b/tests/phpunit/WebTest/Utils/RestTest.php @@ -84,7 +84,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { // entity,action: omit apiKey, valid entity+action $cases[] = array( - array( // query + array(// query "entity" => "Contact", "action" => "get", "key" => $this->settings->siteKey, @@ -95,7 +95,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { // entity,action: valid apiKey, valid entity+action $cases[] = array( - array( // query + array(// query "entity" => "Contact", "action" => "get", "key" => $this->settings->siteKey, @@ -107,7 +107,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { // entity,action: bad apiKey, valid entity+action $cases[] = array( - array( // query + array(// query "entity" => "Contact", "action" => "get", "key" => $this->settings->siteKey, @@ -119,7 +119,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { // entity,action: valid apiKey, invalid entity+action $cases[] = array( - array( // query + array(// query "entity" => "Contactses", "action" => "get", "key" => $this->settings->siteKey, @@ -131,7 +131,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { // q=civicrm/entity/action: omit apiKey, valid entity+action $cases[] = array( - array( // query + array(// query "q" => "civicrm/contact/get", "key" => $this->settings->siteKey, "json" => "1", @@ -141,7 +141,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { // q=civicrm/entity/action: valid apiKey, valid entity+action $cases[] = array( - array( // query + array(// query "q" => "civicrm/contact/get", "key" => $this->settings->siteKey, "json" => "1", @@ -152,7 +152,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { // q=civicrm/entity/action: invalid apiKey, valid entity+action $cases[] = array( - array( // query + array(// query "q" => "civicrm/contact/get", "key" => $this->settings->siteKey, "json" => "1", @@ -163,7 +163,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { // q=civicrm/entity/action: valid apiKey, invalid entity+action $cases[] = array( - array( // query + array(// query "q" => "civicrm/contactses/get", "key" => $this->settings->siteKey, "json" => "1", @@ -175,7 +175,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { // q=civicrm/entity/action: valid apiKey, invalid entity+action // XXX Actually Ping is valid, no? $cases[] = array( - array( // query + array(// query "q" => "civicrm/ping", "key" => $this->settings->siteKey, "json" => "1", diff --git a/tests/phpunit/api/v3/ActivityTest.php b/tests/phpunit/api/v3/ActivityTest.php index c09d83240f..340ab6e9e8 100644 --- a/tests/phpunit/api/v3/ActivityTest.php +++ b/tests/phpunit/api/v3/ActivityTest.php @@ -935,7 +935,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { 'version' => $this->_apiversion, 'id' => $activityId, ); - $result = $this->callAPISuccess($this->_entity, 'get', $getParams ); + $result = $this->callAPISuccess($this->_entity, 'get', $getParams); $assignee = $result['values'][$result['id']]['assignee_contact_id']; $target = $result['values'][$result['id']]['target_contact_id']; $this->assertEquals(2, count($assignee), ' in line ' . __LINE__); diff --git a/tests/phpunit/api/v3/ContributionSoftTest.php b/tests/phpunit/api/v3/ContributionSoftTest.php index bb208a7633..8ae38e1fdf 100644 --- a/tests/phpunit/api/v3/ContributionSoftTest.php +++ b/tests/phpunit/api/v3/ContributionSoftTest.php @@ -147,7 +147,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { $this->callAPISuccess('contribution_soft', 'getcount', array(), $expectedCount); //check id is same as 2 - $this->assertEquals($this->_softcontribution2['id'], $this->callAPISuccess('contribution_soft', 'getvalue', array('return' => 'id' ))); + $this->assertEquals($this->_softcontribution2['id'], $this->callAPISuccess('contribution_soft', 'getvalue', array('return' => 'id'))); $this->callAPISuccess('ContributionSoft', 'Delete', array( 'id' => $this->_softcontribution2['id'], @@ -361,6 +361,6 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { $this->assertEquals($p2['contribution_id'], $res['contribution_id'], 'In line ' . __LINE__); $this->assertEquals($p2['contact_id'], $res['contact_id'], 'In line ' . __LINE__); $this->assertEquals($p2['amount'], $res['amount'], 'In line ' . __LINE__); - $this->assertEquals($p2['currency'], $res['currency'], 'In line ' . __LINE__ ); + $this->assertEquals($p2['currency'], $res['currency'], 'In line ' . __LINE__); } } diff --git a/tests/phpunit/api/v3/CustomValueContactTypeTest.php b/tests/phpunit/api/v3/CustomValueContactTypeTest.php index 4043b9b854..03aa27a234 100644 --- a/tests/phpunit/api/v3/CustomValueContactTypeTest.php +++ b/tests/phpunit/api/v3/CustomValueContactTypeTest.php @@ -198,7 +198,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { $params = array( 'contact_id' => $this->individualStudent, 'contact_type' => 'Individual', - "custom_{$this->IndiStudentField['id']}" => 'Test String', ); + "custom_{$this->IndiStudentField['id']}" => 'Test String',); $result = $this->callAPISuccess('contact', 'create', $params); @@ -238,7 +238,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { $params = array( 'contact_id' => $this->individual, 'contact_type' => 'Individual', - "custom_" . $this->IndividualField['id'] => 'Test String', ); + "custom_" . $this->IndividualField['id'] => 'Test String',); $contact = $this->callAPISuccess('contact', 'create', $params); @@ -263,7 +263,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { 'contact_id' => $this->individualStudent, 'contact_type' => 'Individual', 'contact_sub_type' => 'Student', - "custom_{$this->IndiStudentField['id']}" => 'Test String', ); + "custom_{$this->IndiStudentField['id']}" => 'Test String',); $contact = $this->callAPISuccess('contact', 'create', $params); $this->assertAPISuccess($contact); diff --git a/tests/phpunit/api/v3/EventTest.php b/tests/phpunit/api/v3/EventTest.php index a9faeaf6bb..038b1ee13a 100644 --- a/tests/phpunit/api/v3/EventTest.php +++ b/tests/phpunit/api/v3/EventTest.php @@ -82,11 +82,11 @@ class api_v3_EventTest extends CiviUnitTestCase { array( 'title' => 'Annual CiviCRM meet', 'event_type_id' => 1, - 'start_date' => 20081021, ), + 'start_date' => 20081021,), array( 'title' => 'Annual CiviCRM meet 2', 'event_type_id' => 1, - 'start_date' => 20101021, ), + 'start_date' => 20101021,), ); $this->events = array(); @@ -139,14 +139,14 @@ class api_v3_EventTest extends CiviUnitTestCase { public function testGetEventByIdSort() { $params = array( 'return.sort' => 'id ASC', - 'return.max_results' => 1, ); + 'return.max_results' => 1,); $result = $this->callAPISuccess('Event', 'Get', $params); $this->assertEquals(1, $result['id'], ' in line ' . __LINE__); $params = array( 'options' => array( 'sort' => 'id DESC', 'limit' => 1, - ), ); + ),); $result = $this->callAPISuccess('Event', 'Get', $params); $this->assertAPISuccess($result, ' in line ' . __LINE__); @@ -155,7 +155,7 @@ class api_v3_EventTest extends CiviUnitTestCase { 'options' => array( 'sort' => 'id ASC', 'limit' => 1, - ), ); + ),); $result = $this->callAPISuccess('Event', 'Get', $params); $this->assertEquals(1, $result['id'], ' in line ' . __LINE__); @@ -207,7 +207,7 @@ class api_v3_EventTest extends CiviUnitTestCase { $params['payment_processor_id'] = 1; $params['sequential'] = 1; $result = $this->callAPISuccess('event', 'create', $params); - $this->assertEquals( 1, $result['values'][0]['payment_processor'][0], "handing of payment processor compatibility"); + $this->assertEquals(1, $result['values'][0]['payment_processor'][0], "handing of payment processor compatibility"); $result = $this->callAPISuccess('event', 'get', $params); $this->assertEquals($result['values'][0]['payment_processor_id'], 1, "handing get payment processor compatibility"); } @@ -388,7 +388,7 @@ class api_v3_EventTest extends CiviUnitTestCase { */ public function testDeleteWithEventId() { $params = array( - 'event_id' => $this->_eventIds[0], ); + 'event_id' => $this->_eventIds[0],); $result = $this->callAPISuccess('Event', 'Delete', $params); $this->assertAPISuccess($result, 'in line ' . __LINE__); } @@ -431,7 +431,7 @@ class api_v3_EventTest extends CiviUnitTestCase { public function testSearchEmptyParams() { $event = $this->callAPISuccess('event', 'create', $this->_params[1]); - $getparams = array( 'sequential' => 1, + $getparams = array( 'sequential' => 1, ); $result = $this->callAPISuccess('event', 'get', $getparams); $this->assertEquals($result['count'], 3, 'In line ' . __LINE__); @@ -448,7 +448,7 @@ class api_v3_EventTest extends CiviUnitTestCase { 'event_type_id' => 1, 'return.title' => 1, 'return.id' => 1, - 'return.start_date' => 1, ); + 'return.start_date' => 1,); $result = $this->callAPISuccess('event', 'get', $params); $this->assertEquals($result['values'][$this->_eventIds[0]]['id'], $this->_eventIds[0], 'In line ' . __LINE__); @@ -489,7 +489,7 @@ class api_v3_EventTest extends CiviUnitTestCase { 'event_type_id' => 1, 'start_date' => '2010-10-03', 'title' => 'le cake is a tie', - 'check_permissions' => TRUE, ); + 'check_permissions' => TRUE,); $config = &CRM_Core_Config::singleton(); $config->userPermissionClass->permissions = array('access CiviCRM'); $result = $this->callAPIFailure('event', 'create', $params); diff --git a/tests/phpunit/api/v3/GrantTest.php b/tests/phpunit/api/v3/GrantTest.php index f3faefa5b3..7ec5aff507 100644 --- a/tests/phpunit/api/v3/GrantTest.php +++ b/tests/phpunit/api/v3/GrantTest.php @@ -61,7 +61,7 @@ class api_v3_GrantTest extends CiviUnitTestCase { public function tearDown() { foreach ($this->ids as $entity => $entities) { foreach ($entities as $id) { - $this->callAPISuccess($entity, 'delete', array( 'id' => $id)); + $this->callAPISuccess($entity, 'delete', array('id' => $id)); } } $this->quickCleanup(array('civicrm_grant')); diff --git a/tests/phpunit/api/v3/GroupContactTest.php b/tests/phpunit/api/v3/GroupContactTest.php index 2eff3c50df..ad4f856379 100644 --- a/tests/phpunit/api/v3/GroupContactTest.php +++ b/tests/phpunit/api/v3/GroupContactTest.php @@ -122,7 +122,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { public function testCreateWithoutGroupIdParams() { $params = array( - 'contact_id' => $this->_contactId, ); + 'contact_id' => $this->_contactId,); $groups = $this->callAPIFailure('group_contact', 'create', $params); $this->assertEquals($groups['error_message'], 'Mandatory key(s) missing from params array: group_id'); @@ -130,7 +130,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { public function testCreateWithoutContactIdParams() { $params = array( - 'group_id' => $this->_groupId1, ); + 'group_id' => $this->_groupId1,); $groups = $this->callAPIFailure('group_contact', 'create', $params); $this->assertEquals($groups['error_message'], 'Mandatory key(s) missing from params array: contact_id'); } @@ -143,7 +143,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { 'prefix_id' => 3, 'suffix_id' => 3, 'email' => 'amiteshwar.prasad@civicrm.org', - 'contact_type' => 'Individual', ); + 'contact_type' => 'Individual',); $this->_contactId1 = $this->individualCreate($cont); $params = array( diff --git a/tests/phpunit/api/v3/GroupNestingTest.php b/tests/phpunit/api/v3/GroupNestingTest.php index 543fc0ce63..bb13dfaeb8 100644 --- a/tests/phpunit/api/v3/GroupNestingTest.php +++ b/tests/phpunit/api/v3/GroupNestingTest.php @@ -121,7 +121,7 @@ class api_v3_GroupNestingTest extends CiviUnitTestCase { */ public function testGetWithChildGroupId() { $params = array( - 'child_group_id' => 4, ); + 'child_group_id' => 4,); $result = $this->callAPISuccess('group_nesting', 'get', $params); @@ -148,7 +148,7 @@ class api_v3_GroupNestingTest extends CiviUnitTestCase { */ public function testGetWithParentGroupId() { $params = array( - 'parent_group_id' => 1, ); + 'parent_group_id' => 1,); $result = $this->callAPISuccess('group_nesting', 'get', $params); @@ -224,7 +224,7 @@ class api_v3_GroupNestingTest extends CiviUnitTestCase { // groups id=1 and id=2 loaded in setUp $getparams = array( 'parent_group_id' => 1, - 'child_group_id' => 2, ); + 'child_group_id' => 2,); $result = $this->callAPISuccess('group_nesting', 'get', $getparams); $params = array('id' => $result['id']); diff --git a/tests/phpunit/api/v3/GroupOrganizationTest.php b/tests/phpunit/api/v3/GroupOrganizationTest.php index 4f3128abf1..6119ec9d9b 100644 --- a/tests/phpunit/api/v3/GroupOrganizationTest.php +++ b/tests/phpunit/api/v3/GroupOrganizationTest.php @@ -59,7 +59,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase { $params = array( 'organization_id' => $this->_orgID, - 'group_id' => $this->_groupID, ); + 'group_id' => $this->_groupID,); $result = $this->callAPISuccess('group_organization', 'create', $params); $paramsGet = array( 'organization_id' => $result['id'], @@ -109,7 +109,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase { */ public function testGroupOrganizationGetWithInvalidKeys() { $params = array( - 'invalid_key' => 1, ); + 'invalid_key' => 1,); $result = $this->callAPISuccess('group_organization', 'get', $params); $this->assertAPISuccess($result); @@ -123,7 +123,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase { public function testGroupOrganizationCreate() { $params = array( 'organization_id' => $this->_orgID, - 'group_id' => $this->_groupID, ); + 'group_id' => $this->_groupID,); $result = $this->callAPIAndDocument('group_organization', 'create', $params, __FUNCTION__, __FILE__); } @@ -133,7 +133,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase { public function testGroupOrganizationCreateTwice() { $params = array( 'organization_id' => $this->_orgID, - 'group_id' => $this->_groupID, ); + 'group_id' => $this->_groupID,); $result = $this->callAPISuccess('group_organization', 'create', $params); $result2 = $this->callAPISuccess('group_organization', 'create', $params); $this->assertEquals($result['values'], $result2['values']); @@ -161,7 +161,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase { */ public function testGroupOrganizationCreateWithInvalidKeys() { $params = array( - 'invalid_key' => 1, ); + 'invalid_key' => 1,); $result = $this->callAPIFailure('group_organization', 'create', $params); $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: group_id, organization_id'); } @@ -192,7 +192,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase { public function testGroupOrganizationDelete() { $paramsC = array( 'organization_id' => $this->_orgID, - 'group_id' => $this->_groupID, ); + 'group_id' => $this->_groupID,); $result = $this->callAPISuccess('group_organization', 'create', $paramsC); $params = array( @@ -206,7 +206,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase { */ public function testGroupOrganizationDeleteWithInvalidKey() { $paramsDelete = array( - 'invalid_key' => 1, ); + 'invalid_key' => 1,); $result = $this->callAPIFailure('group_organization', 'delete', $paramsDelete); $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: id'); } diff --git a/tests/phpunit/api/v3/JobProcessMailingTest.php b/tests/phpunit/api/v3/JobProcessMailingTest.php index 78b29d7cc9..376750492c 100644 --- a/tests/phpunit/api/v3/JobProcessMailingTest.php +++ b/tests/phpunit/api/v3/JobProcessMailingTest.php @@ -68,7 +68,7 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { 'created_id' => 1, 'groups' => array('include' => array($this->_groupID)), ); - $this->_mut = new CiviMailUtils( $this, TRUE ); + $this->_mut = new CiviMailUtils($this, TRUE); $this->callAPISuccess('mail_settings', 'get', array('api.mail_settings.create' => array('domain' => 'chaos.org'))); } @@ -100,7 +100,7 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { * @param int $groupID */ public function createContactsInGroup($count, $groupID) { - for ($i = 1; $i <= $count; $i++ ) { + for ($i = 1; $i <= $count; $i++) { $contactID = $this->individualCreate(array('first_name' => $count, 'email' => 'mail' . $i . '@nul.com')); $this->callAPISuccess('group_contact', 'create', array('contact_id' => $contactID, 'group_id' => $groupID, 'status' => 'Added')); } @@ -114,7 +114,7 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { */ public function getRecipients($start, $count) { $recipients = array(); - for ($i = $start; $i < ($start + $count); $i++ ) { + for ($i = $start; $i < ($start + $count); $i++) { $recipients[][0] = 'mail' . $i . '@nul.com'; } return $recipients; diff --git a/tests/phpunit/api/v3/MembershipStatusTest.php b/tests/phpunit/api/v3/MembershipStatusTest.php index dd90b287ec..d3d0a3a0af 100644 --- a/tests/phpunit/api/v3/MembershipStatusTest.php +++ b/tests/phpunit/api/v3/MembershipStatusTest.php @@ -115,14 +115,14 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { public function testUpdate() { $params = array( - 'name' => 'test membership status', ); + 'name' => 'test membership status',); $result = $this->callAPISuccess('membership_status', 'create', $params); $id = $result['id']; $result = $this->callAPISuccess('membership_status', 'get', $params); $this->assertEquals('test membership status', $result['values'][$id]['name']); $newParams = array( 'id' => $id, - 'name' => 'renamed', ); + 'name' => 'renamed',); $result = $this->callAPISuccess('membership_status', 'create', $newParams); $result = $this->callAPISuccess('membership_status', 'get', array('id' => $id)); $this->assertEquals('renamed', $result['values'][$id]['name']); diff --git a/tests/phpunit/api/v3/MembershipTypeTest.php b/tests/phpunit/api/v3/MembershipTypeTest.php index 103a673b86..ac4d592510 100644 --- a/tests/phpunit/api/v3/MembershipTypeTest.php +++ b/tests/phpunit/api/v3/MembershipTypeTest.php @@ -111,7 +111,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { 'duration_unit' => 'month', 'duration_interval' => '10', 'period_type' => 'rolling', - 'visibility' => 'public', ); + 'visibility' => 'public',); $membershiptype = $this->callAPIFailure('membership_type', 'create', $params); $this->assertEquals($membershiptype['error_message'], 'Mandatory key(s) missing from params array: financial_type_id' @@ -127,7 +127,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { 'domain_id' => '1', 'minimum_fee' => '200', 'duration_interval' => '10', - 'visibility' => 'public', ); + 'visibility' => 'public',); $membershiptype = $this->callAPIFailure('membership_type', 'create', $params); $this->assertEquals($membershiptype['error_message'], @@ -144,7 +144,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { 'minimum_fee' => '200', 'duration_unit' => 'month', 'period_type' => 'rolling', - 'visibility' => 'public', ); + 'visibility' => 'public',); $membershiptype = $this->callAPIFailure('membership_type', 'create', $params); $this->assertEquals($membershiptype['error_message'], 'Mandatory key(s) missing from params array: financial_type_id, duration_interval' @@ -159,7 +159,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { 'minimum_fee' => '200', 'duration_interval' => '10', 'period_type' => 'rolling', - 'visibility' => 'public', ); + 'visibility' => 'public',); $membershiptype = $this->callAPIFailure('membership_type', 'create', $params); $this->assertEquals($membershiptype['error_message'], @@ -177,7 +177,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { 'duration_unit' => 'month', 'duration_interval' => '10', 'period_type' => 'rolling', - 'visibility' => 'public', ); + 'visibility' => 'public',); $membershiptype = $this->callAPIFailure('membership_type', 'create', $params); $this->assertEquals($membershiptype['error_message'], 'Mandatory key(s) missing from params array: name'); @@ -221,7 +221,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { 'duration_unit' => 'month', 'duration_interval' => '10', 'period_type' => 'rolling', - 'visibility' => 'public', ); + 'visibility' => 'public',); $membershiptype = $this->callAPIFailure('membership_type', 'create', $params); $this->assertEquals($membershiptype['error_message'], 'Mandatory key(s) missing from params array: domain_id'); @@ -232,7 +232,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { $newMembOrgParams = array( 'organization_name' => 'New membership organisation', 'contact_type' => 'Organization', - 'visibility' => 1, ); + 'visibility' => 1,); // create a new contact to update this membership type to $newMembOrgID = $this->organizationCreate($newMembOrgParams); @@ -244,7 +244,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { 'duration_unit' => 'month', 'duration_interval' => '10', 'period_type' => 'fixed', - 'domain_id' => 1, ); + 'domain_id' => 1,); $this->callAPISuccess('membership_type', 'update', $params); diff --git a/tests/phpunit/api/v3/NoteTest.php b/tests/phpunit/api/v3/NoteTest.php index 54943ac3f7..0cf6fc488d 100644 --- a/tests/phpunit/api/v3/NoteTest.php +++ b/tests/phpunit/api/v3/NoteTest.php @@ -54,7 +54,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { 'note' => 'Hello!!! m testing Note', 'contact_id' => $this->_contactID, 'modified_date' => '2011-01-31', - 'subject' => 'Test Note', ); + 'subject' => 'Test Note',); $this->_note = $this->noteCreate($this->_contactID); $this->_noteID = $this->_note['id']; } @@ -136,7 +136,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { $this->assertArrayHasKey('id', $result); $note = array( - 'id' => $result['id'], ); + 'id' => $result['id'],); $this->noteDelete($note); } @@ -148,7 +148,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { 'contact_id' => $this->_contactID, 'modified_date' => '2011-01-31', 'subject' => "With a '", - 'sequential' => 1, ); + 'sequential' => 1,); $result = $this->callAPISuccess('Note', 'Create', $params); $this->assertAPISuccess($result, 'in line ' . __LINE__); $this->assertEquals($result['values'][0]['note'], "Hello!!! ' testing Note", 'in line ' . __LINE__); @@ -157,7 +157,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { //CleanUP $note = array( - 'id' => $result['id'], ); + 'id' => $result['id'],); $this->noteDelete($note); } @@ -170,7 +170,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { $this->assertAPISuccess($apiResult); $this->assertEquals(date('Y-m-d'), date('Y-m-d', strtotime($apiResult['values'][$apiResult['id']]['modified_date']))); $this->noteDelete(array( - 'id' => $apiResult['id'], )); + 'id' => $apiResult['id'],)); } @@ -192,7 +192,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { public function testUpdateWithoutContactId() { $params = array( 'entity_id' => $this->_contactID, - 'entity_table' => 'civicrm_contact', ); + 'entity_table' => 'civicrm_contact',); $note = $this->callAPIFailure('note', 'create', $params, 'Mandatory key(s) missing from params array: note' ); @@ -206,7 +206,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { 'id' => $this->_noteID, 'contact_id' => $this->_contactID, 'note' => 'Note1', - 'subject' => 'Hello World', ); + 'subject' => 'Hello World',); //Update Note $this->callAPISuccess('note', 'create', $params); diff --git a/tests/phpunit/api/v3/ParticipantPaymentTest.php b/tests/phpunit/api/v3/ParticipantPaymentTest.php index b81b3511f4..1aa8adaff6 100644 --- a/tests/phpunit/api/v3/ParticipantPaymentTest.php +++ b/tests/phpunit/api/v3/ParticipantPaymentTest.php @@ -87,7 +87,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { public function testPaymentCreateMissingContributionId() { //Without Payment EntityID $params = array( - 'participant_id' => $this->_participantID, ); + 'participant_id' => $this->_participantID,); $participantPayment = $this->callAPIFailure('participant_payment', 'create', $params); } @@ -138,7 +138,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { public function testPaymentUpdateMissingParticipantId() { //WithoutParticipantId $params = array( - 'contribution_id' => '3', ); + 'contribution_id' => '3',); $participantPayment = $this->callAPIFailure('participant_payment', 'create', $params); } @@ -148,7 +148,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { */ public function testPaymentUpdateMissingContributionId() { $params = array( - 'participant_id' => $this->_participantID, ); + 'participant_id' => $this->_participantID,); $participantPayment = $this->callAPIFailure('participant_payment', 'create', $params); } @@ -164,7 +164,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { $params = array( 'id' => $this->_participantPaymentID, 'participant_id' => $this->_participantID, - 'contribution_id' => $contributionID, ); + 'contribution_id' => $contributionID,); // Update Payment $participantPayment = $this->callAPISuccess('participant_payment', 'create', $params); @@ -197,7 +197,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { $params = array( 'id' => $this->_participantPaymentID, 'participant_id' => $this->_participantID, - 'contribution_id' => $contributionID, ); + 'contribution_id' => $contributionID,); // Update Payment $participantPayment = $this->callAPISuccess('participant_payment', 'create', $params); @@ -232,7 +232,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { $params = array( 'id' => $this->_participantPaymentID, 'participant_id' => $this->_participantID, - 'contribution_id' => $contributionID, ); + 'contribution_id' => $contributionID,); // Update Payment $participantPayment = $this->callAPISuccess('participant_payment', 'create', $params); @@ -270,7 +270,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { */ public function testPaymentDeleteWithWrongID() { $params = array( - 'id' => 0, ); + 'id' => 0,); $deletePayment = $this->callAPIFailure('participant_payment', 'delete', $params); $this->assertEquals($deletePayment['error_message'], 'Error while deleting participantPayment'); } diff --git a/tests/phpunit/api/v3/ParticipantTest.php b/tests/phpunit/api/v3/ParticipantTest.php index 60d1bad52a..763cee2fe3 100644 --- a/tests/phpunit/api/v3/ParticipantTest.php +++ b/tests/phpunit/api/v3/ParticipantTest.php @@ -210,7 +210,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { */ public function testGetContactIdOnly() { $params = array( - 'contact_id' => $this->_contactID, ); + 'contact_id' => $this->_contactID,); $participant = $this->callAPISuccess('participant', 'get', $params); $this->assertEquals($this->_participantID, $participant['id'], @@ -237,7 +237,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { public function testGetMultiMatchReturnFirst() { $params = array( 'event_id' => $this->_eventID, - 'rowCount' => 1, ); + 'rowCount' => 1,); $participant = $this->callAPISuccess('participant', 'get', $params); $this->assertNotNull($participant['id']); @@ -580,7 +580,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { 'role_id' => 3, 'register_date' => '2006-01-21', 'source' => 'US Open', - 'event_level' => 'Donation', ); + 'event_level' => 'Donation',); $participant = $this->callAPIFailure('participant', 'create', $params); $this->assertEquals($participant['error_message'], 'Mandatory key(s) missing from params array: event_id'); // Cleanup created participant records. @@ -597,7 +597,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { 'role_id' => 3, 'register_date' => '2006-01-21', 'source' => 'US Open', - 'event_level' => 'Donation', ); + 'event_level' => 'Donation',); $participant = $this->callAPIFailure('Participant', 'update', $params); } @@ -616,7 +616,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { 'role_id' => 3, 'register_date' => '2006-01-21', 'source' => 'US Open', - 'event_level' => 'Donation', ); + 'event_level' => 'Donation',); $participant = $this->callAPIFailure('participant', 'create', $params); $result = $this->participantDelete($participantId); } @@ -644,7 +644,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { */ public function testParticipantDelete() { $params = array( - 'id' => $this->_participantID, ); + 'id' => $this->_participantID,); $participant = $this->callAPISuccess('participant', 'delete', $params); $this->assertAPISuccess($participant); $this->assertDBState('CRM_Event_DAO_Participant', $this->_participantID, NULL, TRUE); @@ -657,7 +657,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { */ public function testParticipantDeleteMissingID() { $params = array( - 'event_id' => $this->_eventID, ); + 'event_id' => $this->_eventID,); $participant = $this->callAPIFailure('participant', 'delete', $params); $this->assertNotNull($participant['error_message']); } diff --git a/tests/phpunit/api/v3/PaymentProcessorTypeTest.php b/tests/phpunit/api/v3/PaymentProcessorTypeTest.php index e66bf7f873..f0387629c9 100644 --- a/tests/phpunit/api/v3/PaymentProcessorTypeTest.php +++ b/tests/phpunit/api/v3/PaymentProcessorTypeTest.php @@ -57,7 +57,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { */ public function testPaymentProcessorTypeCreateWithoutName() { $payProcParams = array( - 'is_active' => 1, ); + 'is_active' => 1,); $result = $this->callAPIFailure('payment_processor_type', 'create', $payProcParams); $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: name, title, class_name, billing_mode' @@ -178,7 +178,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { 'title' => 'API Test Payment Processor 2', 'class_name' => 'CRM_Core_Payment_APITest 2', 'billing_mode' => 2, - 'is_recur' => 0, ); + 'is_recur' => 0,); $result = $this->callAPISuccess('payment_processor_type', 'create', $params); $this->assertNotNull($result['id']); @@ -200,7 +200,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { 'title' => 'API Test Payment Processor', 'class_name' => 'CRM_Core_Payment_APITest', 'billing_mode' => 1, - 'is_recur' => 0, ); + 'is_recur' => 0,); $first = $this->callAPISuccess('PaymentProcessorType', 'Create', $firstRelTypeParams); @@ -209,7 +209,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { 'title' => 'API Test Payment Processor 2', 'class_name' => 'CRM_Core_Payment_APITest 2', 'billing_mode' => 2, - 'is_recur' => 0, ); + 'is_recur' => 0,); $second = $this->callAPISuccess('PaymentProcessorType', 'Create', $secondRelTypeParams); $result = $this->callAPISuccess('payment_processor_type', 'get', array()); @@ -226,7 +226,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { 'title' => 'API Test Payment Processor 11', 'class_name' => 'CRM_Core_Payment_APITest_11', 'billing_mode' => 1, - 'is_recur' => 0, ); + 'is_recur' => 0,); $first = $this->callAPISuccess('PaymentProcessorType', 'Create', $firstRelTypeParams); @@ -235,11 +235,11 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { 'title' => 'API Test Payment Processor 12', 'class_name' => 'CRM_Core_Payment_APITest_12', 'billing_mode' => 2, - 'is_recur' => 0, ); + 'is_recur' => 0,); $second = $this->callAPISuccess('PaymentProcessorType', 'Create', $secondRelTypeParams); $params = array( - 'name' => 'API_Test_PP_12', ); + 'name' => 'API_Test_PP_12',); $result = $this->callAPISuccess('payment_processor_type', 'get', $params); $this->assertAPISuccess($result); diff --git a/tests/phpunit/api/v3/PledgeTest.php b/tests/phpunit/api/v3/PledgeTest.php index f67f9e0e21..52fba65141 100644 --- a/tests/phpunit/api/v3/PledgeTest.php +++ b/tests/phpunit/api/v3/PledgeTest.php @@ -128,7 +128,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { $this->assertEquals($pledge['pledge_next_pay_amount'], 20.00, 'in line' . __LINE__); $params2 = array( - 'pledge_id' => $this->_pledge['id'], ); + 'pledge_id' => $this->_pledge['id'],); $pledge = $this->callAPISuccess('pledge', 'delete', $params2); } /** @@ -190,10 +190,10 @@ class api_v3_PledgeTest extends CiviUnitTestCase { 'start_date' => 'first saturday of march last year', ); $this->_pledge = $this->callAPISuccess('pledge', 'create', array_merge($this->_params, $overdueParams)); - $params = array( 'pledge_status_id' => '6', + $params = array( 'pledge_status_id' => '6', ); $result = $this->callAPISuccess('pledge', 'get', $params); - $emptyResult = $this->callAPISuccess('pledge', 'get', array( 'pledge_status_id' => '1', + $emptyResult = $this->callAPISuccess('pledge', 'get', array( 'pledge_status_id' => '1', )); $pledge = $result['values'][$this->_pledge['id']]; $this->callAPISuccess('pledge', 'delete', $pledge); @@ -380,7 +380,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { $pledgeID = $this->pledgeCreate($this->_individualId); $old_params = array( 'id' => $pledgeID, - 'sequential' => 1, ); + 'sequential' => 1,); $original = $this->callAPISuccess('pledge', 'get', $old_params); //Make sure it came back $this->assertEquals($original['values'][0]['pledge_id'], $pledgeID, 'In line ' . __LINE__); @@ -402,7 +402,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { 'amount' => 100, 'financial_type_id' => 1, 'start_date' => date('Ymd'), - 'installments' => 10, ); + 'installments' => 10,); $pledge = $this->callAPISuccess('pledge', 'create', $params); $new_params = array( @@ -424,7 +424,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { $pledgeID = $this->pledgeCreate($this->_individualId); $old_params = array( 'id' => $pledgeID, - 'sequential' => 1, ); + 'sequential' => 1,); $original = $this->callAPISuccess('pledge', 'get', $old_params); //Make sure it came back $this->assertEquals($original['values'][0]['pledge_id'], $pledgeID, 'In line ' . __LINE__); diff --git a/tests/phpunit/api/v3/PriceFieldValueTest.php b/tests/phpunit/api/v3/PriceFieldValueTest.php index c427acad43..fdb2f19306 100644 --- a/tests/phpunit/api/v3/PriceFieldValueTest.php +++ b/tests/phpunit/api/v3/PriceFieldValueTest.php @@ -198,7 +198,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase { ); $result1 = $this->callAPISuccess($this->_entity, 'create', $params1); $result2 = $this->callAPISuccess($this->_entity, 'create', $params2); - $result = $this->callAPISuccess($this->_entity, 'get', array('price_field_id' => $this->priceFieldID1 )); + $result = $this->callAPISuccess($this->_entity, 'get', array('price_field_id' => $this->priceFieldID1)); $this->assertEquals(2, $result['count'], 'In line ' . __LINE__); $this->callAPISuccess($this->_entity, 'delete', array('id' => $result1['id'])); $this->callAPISuccess($this->_entity, 'delete', array('id' => $result2['id'])); diff --git a/tests/phpunit/api/v3/ReportTemplateTest.php b/tests/phpunit/api/v3/ReportTemplateTest.php index 4ea4818b79..d06a1a6862 100644 --- a/tests/phpunit/api/v3/ReportTemplateTest.php +++ b/tests/phpunit/api/v3/ReportTemplateTest.php @@ -102,7 +102,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { $this->assertDBQuery(1, 'SELECT is_active FROM civicrm_option_value WHERE name = "CRM_Report_Form_Examplez"'); - $result = $this->callAPISuccess('ReportTemplate', 'delete', array( 'id' => $entityId, + $result = $this->callAPISuccess('ReportTemplate', 'delete', array( 'id' => $entityId, )); $this->assertAPISuccess($result); $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); diff --git a/tests/phpunit/api/v3/SettingTest.php b/tests/phpunit/api/v3/SettingTest.php index f68ee6be01..5978b26f94 100644 --- a/tests/phpunit/api/v3/SettingTest.php +++ b/tests/phpunit/api/v3/SettingTest.php @@ -168,7 +168,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { 'is_contact' => 0, 'description' => NULL, 'help_text' => NULL, - 'on_change' => array( // list of callbacks + 'on_change' => array(// list of callbacks array(__CLASS__, '_testOnChange_onChangeExample') ), ), diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 563d81ab2a..c714c1dec6 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -182,7 +182,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { $customDataEntities = array(); $invalidEntities = array('Individual', 'Organization', 'Household'); $entitiesToFix = array('Case', 'Relationship'); - foreach ($entities as $entityName => $entity ) { + foreach ($entities as $entityName => $entity) { if (!in_array($entityName, $invalidEntities) && !in_array($entityName, $entitiesToFix)) { if (!empty(self::$componentMap[$entityName]) && empty($enabledComponents[self::$componentMap[$entityName]])) { diff --git a/tests/phpunit/api/v3/TaxContributionPageTest.php b/tests/phpunit/api/v3/TaxContributionPageTest.php index 78df4ce089..8d26054453 100644 --- a/tests/phpunit/api/v3/TaxContributionPageTest.php +++ b/tests/phpunit/api/v3/TaxContributionPageTest.php @@ -207,7 +207,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $this->_ids['price_set'][] = $priceSet['id']; } $priceSetID = $this->_price = reset($this->_ids['price_set']); - CRM_Price_BAO_PriceSet::addTo('civicrm_contribution_page', $contributionPageResult['id'], $priceSetID ); + CRM_Price_BAO_PriceSet::addTo('civicrm_contribution_page', $contributionPageResult['id'], $priceSetID); if (empty($this->_ids['price_field'])) { $priceField = $this->callAPISuccess('price_field', 'create', array( @@ -259,7 +259,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $this->_ids['contributionId'] = $contribution['id']; $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId, 'In line ' . __LINE__); $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__ ); + $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__); $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345, 'In line ' . __LINE__); $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890, 'In line ' . __LINE__); $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF', 'In line ' . __LINE__); @@ -328,7 +328,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__); $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId, 'In line ' . __LINE__); $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__ ); + $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__); $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345, 'In line ' . __LINE__); $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890, 'In line ' . __LINE__); $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF', 'In line ' . __LINE__); @@ -353,7 +353,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__); $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId, 'In line ' . __LINE__); $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__ ); + $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__); $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345, 'In line ' . __LINE__); $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890, 'In line ' . __LINE__); $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF', 'In line ' . __LINE__); @@ -516,8 +516,8 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { ); $result = array(); - CRM_Financial_BAO_FinancialTypeAccount::retrieve( $searchParams, $result ); - return CRM_Utils_Array::value( 'financial_account_id', $result ); + CRM_Financial_BAO_FinancialTypeAccount::retrieve($searchParams, $result); + return CRM_Utils_Array::value('financial_account_id', $result); } ///////////////// civicrm_contribution_delete methods diff --git a/tests/phpunit/api/v3/UFGroupTest.php b/tests/phpunit/api/v3/UFGroupTest.php index 515f63b690..13f876f907 100644 --- a/tests/phpunit/api/v3/UFGroupTest.php +++ b/tests/phpunit/api/v3/UFGroupTest.php @@ -160,7 +160,7 @@ class api_v3_UFGroupTest extends CiviUnitTestCase { 'name' => 'test_group', 'notify' => 'admin@example.org', 'post_URL' => 'http://example.org/post', - 'title' => 'Test Group', ); + 'title' => 'Test Group',); $result = $this->callAPISuccess('uf_group', 'create', $params); $params['created_date'] = date('YmdHis', strtotime($params['created_date'])); foreach ($params as $key => $value) { diff --git a/tests/phpunit/api/v3/UFJoinTest.php b/tests/phpunit/api/v3/UFJoinTest.php index 39ba60a7d3..1a9c09acdd 100644 --- a/tests/phpunit/api/v3/UFJoinTest.php +++ b/tests/phpunit/api/v3/UFJoinTest.php @@ -86,12 +86,12 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { 'entity_id' => 1, 'weight' => 1, 'uf_group_id' => $this->_ufGroupId, - 'is_active' => 1, ); + 'is_active' => 1,); $ufJoin = $this->callAPISuccess('uf_join', 'create', $params); $searchParams = array( 'entity_table' => 'civicrm_contribution_page', - 'entity_id' => 1, ); + 'entity_id' => 1,); $result = $this->callAPISuccess('uf_join', 'get', $searchParams); foreach ($result['values'] as $key => $value) { @@ -118,7 +118,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { 'entity_table' => 'civicrm_contribution_page', 'entity_id' => 1, 'weight' => 1, - 'is_active' => 1, ); + 'is_active' => 1,); $result = $this->callAPIFailure('uf_join', 'create', $params); $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: uf_group_id', 'In line ' . __LINE__); } @@ -191,7 +191,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { 'entity_id' => 1, 'weight' => 1, 'uf_group_id' => $this->_ufGroupId, - 'is_active' => 1, ); + 'is_active' => 1,); $ufJoin = $this->callAPISuccess('uf_join', 'create', $params); $searchParams = array( -- 2.25.1
Contact-IDContribution-IDMembership-IDMembership TypeStart DateEnd DateMembership Status