);
// make sure a malicious POST does not change these on reserved statuses
- if ($this->_isReserved) { unset($params['name'], $params['class'], $params['is_active']);
+ if ($this->_isReserved) {
+ unset($params['name'], $params['class'], $params['is_active']);
}
if ($this->_action & CRM_Core_Action::UPDATE) {
foreach (array(
'current_campaign', 'past_campaign') as $ignore) {
$index = array_search($ignore, $campaign);
- if ($index !== FALSE) { unset($campaign[$index]);
+ if ($index !== FALSE) {
+ unset($campaign[$index]);
}
}
}
if ($count > 1) {
foreach (array(
'state', 'state_name', 'country', 'world_region') as $fld) {
- if (isset($address->$fld)) { unset($address->$fld);
+ if (isset($address->$fld)) {
+ unset($address->$fld);
}
}
}
if ($considerSelector) {
// drop the fields not meant for the selector
foreach ($subset as $name => $field) {
- if (!$field['in_selector']) { unset($subset[$name]);
+ if (!$field['in_selector']) {
+ unset($subset[$name]);
}
}
}
$extension_instance_found = TRUE;
}
- if (!$extension_instance_found) { CRM_Core_Error::fatal(
- "No extension instances of the '{$params['processor_name']}' payment processor were found.<br />" .
- "$method method is unsupported in legacy payment processors."
+ if (!$extension_instance_found) {
+ CRM_Core_Error::fatal(
+ "No extension instances of the '{$params['processor_name']}' payment processor were found.<br />" .
+ "$method method is unsupported in legacy payment processors."
);
}
* @return int
*/
public static function _cmpSnippet($a, $b) {
- if ($a['weight'] < $b['weight']) { return -1;
+ if ($a['weight'] < $b['weight']) {
+ return -1;
}
- if ($a['weight'] > $b['weight']) { return 1;
+ if ($a['weight'] > $b['weight']) {
+ return 1;
}
// fallback to name sort; don't really want to do this, but it makes results more stable
- if ($a['name'] < $b['name']) { return -1;
+ if ($a['name'] < $b['name']) {
+ return -1;
}
- if ($a['name'] > $b['name']) { return 1;
+ if ($a['name'] > $b['name']) {
+ return 1;
}
return 0;
}
*/
function smarty_block_crmRegion($params, $content, &$smarty, &$repeat)
{
- if ($repeat) { return;
+ if ($repeat) {
+ return;
}
require_once 'CRM/Core/Region.php';
$region = CRM_Core_Region::instance($params['name'], FALSE);
return $substr($string, 0, $length) . $etc;
}
- else { return $string;
+ else {
+ return $string;
}
}
if ($parent_event_id == NULL) {
return $this->event->parent_event_id;
}
- else { return $this->event->parent_event_id == $parent_event_id;
+ else {
+ return $this->event->parent_event_id == $parent_event_id;
}
}
}
if (is_array($ids)) {
return array_pop($ids);
}
- else { return NULL;
+ else {
+ return NULL;
}
}
}
}
- foreach ($occurDiscount as $key => $value) { if ($value > 1 && $key <> '') {
+ foreach ($occurDiscount as $key => $value) {
+ if ($value > 1 && $key <> '') {
if ($key == $values['discount_name'][$i]) {
$errors['discount_name[' . $i . ']'] = ts('%1 is already used for Discount Name.', array(1 => $key));
}
- }
+ }
}
//validation for discount labels and values
continue 2;
}
}
- if ($complete) { return 1;
+ if ($complete) {
+ return 1;
}
}
'payment_type' => $dao->payment_type,
);
}
- else { CRM_Core_Error::fatal("Unable to find payment processor in " . __CLASS__ . '::' . __METHOD__);
+ else {
+ CRM_Core_Error::fatal("Unable to find payment processor in " . __CLASS__ . '::' . __METHOD__);
}
}
}
if ($id && !empty($params['weight'])) {
- if (isset($params['name'])) { unset($params['name']);
+ if (isset($params['name'])) {
+ unset($params['name']);
}
$oldWeight = NULL;
$compIds = array();
$extends = CRM_Utils_Array::value('extends', $params);
if (is_array($extends)) {
- foreach ($extends as $compId => $selected) { if ($selected) { $compIds[] = $compId;
- }
+ foreach ($extends as $compId => $selected) {
+ if ($selected) {
+ $compIds[] = $compId;
+ }
}
}
$params['extends'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $compIds);
* @return int|null|string
*/
public static function getInstanceCount($optionVal) {
- if (empty($optionVal)) { return 0;
+ if (empty($optionVal)) {
+ return 0;
}
$sql = "
}
if ($id = CRM_Utils_Array::value('id', $ids)) {
- if (isset($params['name'])) { unset($params['name']);
+ if (isset($params['name'])) {
+ unset($params['name']);
}
$oldWeight = NULL;
}
}
else {
- if (!JUserHelper::verifyPassword($password, $dbPassword, $dbId)) { return FALSE;
+ if (!JUserHelper::verifyPassword($password, $dbPassword, $dbId)) {
+ return FALSE;
}
//include additional files required by Joomla 3.2.1+
if (is_array($params['filter.group_id'])) {
$groups = $params['filter.group_id'];
}
- else { $groups = explode(',', $params['filter.group_id']);
+ else {
+ $groups = explode(',', $params['filter.group_id']);
}
unset($params['filter.group_id']);
$groups = array_flip($groups);
$this->header = $header;
while (($data = fgetcsv($handle, 0, $this->separator)) !== FALSE) {
// skip blank lines
- if (count($data) == 1 && is_null($data[0])) { continue;
+ if (count($data) == 1 && is_null($data[0])) {
+ continue;
}
$this->row++;
$params = $this->convertLine($data);
if ($locale == 'en_US') {
continue;
}
- if (!file_exists(implode(CIVICRM_DIRECTORY_SEPARATOR, array($crmPath, 'sql', "civicrm_data.$locale.mysql")))) { unset($langs[$locale]);
+ if (!file_exists(implode(CIVICRM_DIRECTORY_SEPARATOR, array($crmPath, 'sql', "civicrm_data.$locale.mysql")))) {
+ unset($langs[$locale]);
}
}
$groupContacts = CRM_Core_DAO::createTestObject('CRM_Contact_DAO_GroupContact', NULL, 10);
//check the group contact id is not null for each of them
- foreach ($groupContacts as $gc) { $this->assertNotNull($gc->id);
+ foreach ($groupContacts as $gc) {
+ $this->assertNotNull($gc->id);
}
//cleanup
- foreach ($groupContacts as $gc) { $gc->deleteTestObjects('CRM_Contact_DAO_GroupContact');
+ foreach ($groupContacts as $gc) {
+ $gc->deleteTestObjects('CRM_Contact_DAO_GroupContact');
}
}