Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] Minor coding standards cleanup #19838

Merged
merged 1 commit into from
Mar 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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