Skip to content

Commit

Permalink
Merge pull request #19838 from eileenmcnaughton/nfc
Browse files Browse the repository at this point in the history
[NFC] Minor coding standards cleanup
  • Loading branch information
seamuslee001 authored Mar 19, 2021
2 parents 27fe2f4 + 13dbc54 commit 959a795
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions CRM/Activity/Form/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search {
/**
* @return string
*/
public function getDefaultEntity() {
public function getDefaultEntity(): string {
return 'Activity';
}

Expand All @@ -72,7 +72,7 @@ public function getDefaultEntity() {
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
public function preProcess() {
public function preProcess(): void {
$this->set('searchFormName', 'Search');

// set the button names
Expand All @@ -83,10 +83,8 @@ public function preProcess() {

parent::preProcess();

if (empty($this->_formValues)) {
if (isset($this->_ssID)) {
$this->_formValues = CRM_Contact_BAO_SavedSearch::getFormValues($this->_ssID);
}
if (empty($this->_formValues) && isset($this->_ssID)) {
$this->_formValues = CRM_Contact_BAO_SavedSearch::getFormValues($this->_ssID);
}

$this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
Expand All @@ -98,7 +96,7 @@ public function preProcess() {
$this->_context
);
$prefix = NULL;
if ($this->_context == 'user') {
if ($this->_context === 'user') {
$prefix = $this->_prefix;
}

Expand All @@ -125,7 +123,7 @@ public function preProcess() {
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
public function buildQuickForm() {
public function buildQuickForm(): void {
parent::buildQuickForm();
$this->addSortNameField();

Expand Down Expand Up @@ -155,9 +153,9 @@ public function buildQuickForm() {
* The processing consists of using a Selector / Controller framework for getting the
* search results.
*
* @throws \CRM_Core_Exception
* @throws \CRM_Core_Exception|\CiviCRM_API3_Exception
*/
public function postProcess() {
public function postProcess(): void {
if ($this->_done) {
return;
}
Expand All @@ -184,7 +182,7 @@ public function postProcess() {

// We don't show test records in summaries or dashboards
if (empty($this->_formValues['activity_test']) && $this->_force) {
$this->_formValues["activity_test"] = 0;
$this->_formValues['activity_test'] = 0;
}

$this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
Expand Down Expand Up @@ -286,7 +284,7 @@ public function fixFormValues() {
// use getEntity Defaults
$requestParams = CRM_Utils_Request::exportValues();
foreach (array_keys($requestParams) as $key) {
if (substr($key, 0, 7) != 'custom_') {
if (substr($key, 0, 7) !== 'custom_') {
continue;
}
elseif (empty($requestParams[$key])) {
Expand Down

0 comments on commit 959a795

Please sign in to comment.