Skip to content

Commit

Permalink
Merge pull request #4955 from atif-shaikh/master-cleanup
Browse files Browse the repository at this point in the history
INFRA-132 - Batch #8
  • Loading branch information
Yashodha Chaku committed Jan 16, 2015
2 parents b00c855 + 3bdca10 commit 5552f12
Show file tree
Hide file tree
Showing 38 changed files with 149 additions and 182 deletions.
2 changes: 1 addition & 1 deletion CRM/Activity/Import/Form/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function preProcess() {
'downloadDuplicateRecordsUrl',
'downloadMismatchRecordsUrl',
'groupAdditions',
'unMatchCount'
'unMatchCount',
);
foreach ($properties as $property) {
$this->assign($property, $this->get($property));
Expand Down
4 changes: 2 additions & 2 deletions CRM/Admin/Form/RelationshipType.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ public function buildQuickForm() {
// add select for contact type
$contactTypeA = &$this->add('select', 'contact_types_a', ts('Contact Type A') . ' ',
array(
'' => ts('All Contacts')
'' => ts('All Contacts'),
) + $contactTypes
);
$contactTypeB = &$this->add('select', 'contact_types_b', ts('Contact Type B') . ' ',
array(
'' => ts('All Contacts')
'' => ts('All Contacts'),
) + $contactTypes
);

Expand Down
2 changes: 1 addition & 1 deletion CRM/Case/Form/EditClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function preProcess() {
}
elseif (in_array($context, array(
'dashlet',
'dashletFullscreen'
'dashletFullscreen',
))) {
$url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Case/Form/Task/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CRM_Case_Form_Task_Delete extends CRM_Case_Form_Task {
*
* @return void
*/
function preProcess() {
public function preProcess() {
//check for delete
if (!CRM_Core_Permission::checkActionPermission('CiviCase', CRM_Core_Action::DELETE)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
Expand Down
16 changes: 8 additions & 8 deletions CRM/Contact/BAO/GroupNesting.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function next() {
$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);
Expand Down Expand Up @@ -338,7 +338,7 @@ public static function removeAllParentForChild($childID) {
* @param $childID
* The child id of the association.
*
* @return boolean
* @return bool
* True if association is found, false otherwise.
*/
public static function isParentChild($parentID, $childID) {
Expand All @@ -358,7 +358,7 @@ public static function isParentChild($parentID, $childID) {
* @param $groupId
* The id of the group to check for child groups.
*
* @return boolean
* @return bool
* True if 1 or more child groups are found, false otherwise.
*/
public static function hasChildGroups($groupId) {
Expand All @@ -379,7 +379,7 @@ public static function hasChildGroups($groupId) {
* @param $groupId
* The id of the group to check for parent groups.
*
* @return boolean
* @return bool
* True if 1 or more parent groups are found, false otherwise.
*/
public static function hasParentGroups($groupId) {
Expand All @@ -401,7 +401,7 @@ public static function hasParentGroups($groupId) {
* @param $checkGroupId
* The group id to check if it is a parent of the $groupIds group(s).
*
* @return boolean
* @return bool
* True if $checkGroupId points to a group that is a parent of one of the $groupIds groups, false otherwise.
*/
public static function isParentGroup($groupIds, $checkGroupId) {
Expand Down Expand Up @@ -433,7 +433,7 @@ public static function isParentGroup($groupIds, $checkGroupId) {
* @param $checkGroupId
* The group id to check if it is a child of the $groupIds group(s).
*
* @return boolean
* @return bool
* True if $checkGroupId points to a group that is a child of one of the $groupIds groups, false otherwise.
*/
public static function isChildGroup($groupIds, $checkGroupId) {
Expand Down Expand Up @@ -467,7 +467,7 @@ public static function isChildGroup($groupIds, $checkGroupId) {
* @param $checkGroupId
* The group id to check if it is an ancestor of the $groupIds group(s).
*
* @return boolean
* @return bool
* True if $checkGroupId points to a group that is an ancestor of one of the $groupIds groups, false otherwise.
*/
public static function isAncestorGroup($groupIds, $checkGroupId) {
Expand Down Expand Up @@ -508,7 +508,7 @@ public static function isAncestorGroup($groupIds, $checkGroupId) {
* @param $checkGroupId
* The group id to check if it is a descendent of the $groupIds group(s).
*
* @return boolean
* @return bool
* True if $checkGroupId points to a group that is a descendent of one of the $groupIds groups, false otherwise.
*/
public static function isDescendentGroup($groupIds, $checkGroupId) {
Expand Down
14 changes: 6 additions & 8 deletions CRM/Contact/Form/Task/AddToOrganization.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function buildQuickForm() {
'relationship_type_id',
ts('Relationship Type'),
array(
'' => ts('- select -')
'' => ts('- select -'),
) +
CRM_Contact_BAO_Relationship::getRelationType("Organization"), TRUE
);
Expand All @@ -88,14 +88,12 @@ public function buildQuickForm() {
$this->assign('searchRows', $searchRows);
}


$this->assign('searchCount', $searchCount);
$this->assign('searchDone', $this->get('searchDone'));
$this->assign('contact_type_display', ts('Organization'));
$this->addElement('submit', $this->getButtonName('refresh'), ts('Search'), array('class' => 'crm-form-submit'));
$this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), array('class' => 'crm-form-submit'));


$this->addButtons(array(
array(
'type' => 'next',
Expand Down Expand Up @@ -166,27 +164,27 @@ public function postProcess() {
'count' => $valid,
'plural' => '%count %2 %3 relationships created',
2 => $relationship,
3 => $org
))
3 => $org,
)),
);
if ($duplicate) {
$status[] = ts('%count was skipped because the contact is already %2 %3', array(
'count' => $duplicate,
'plural' => '%count were skipped because the contacts are already %2 %3',
2 => $relationship,
3 => $org
3 => $org,
));
}
if ($invalid) {
$status[] = ts('%count relationship was not created because the contact is not of the right type for this relationship', array(
'count' => $invalid,
'plural' => '%count relationships were not created because the contact is not of the right type for this relationship'
'plural' => '%count relationships were not created because the contact is not of the right type for this relationship',
));
}
$status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
CRM_Core_Session::setStatus($status, ts('Relationship created.', array(
'count' => $valid,
'plural' => 'Relationships created.'
'plural' => 'Relationships created.',
)), 'success', array('expires' => 0));
}
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Task/PickProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function preProcess() {
if (count($this->_contactIds) > $this->_maxContacts) {
CRM_Core_Session::setStatus(ts("The maximum number of contacts you can select for Batch Update is %1. You have selected %2. Please select fewer contacts from your search results and try again.", array(
1 => $this->_maxContacts,
2 => count($this->_contactIds)
2 => count($this->_contactIds),
)), ts('Maximum Exceeded'), 'error');
$validate = TRUE;
}
Expand Down
1 change: 0 additions & 1 deletion CRM/Contribute/BAO/ManagePremiums.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ public static function add(&$params, &$ids) {
*
* @param int $productID
*/

public static function del($productID) {
//check dependencies
$premiumsProduct = new CRM_Contribute_DAO_PremiumsProduct();
Expand Down
16 changes: 8 additions & 8 deletions CRM/Core/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public static function getInfo() {
if ($value['active']) {
if (in_array($id, array(
self::ADD,
self::CREATE_NEW
self::CREATE_NEW,
))) {
$hasAccess = TRUE;
if (!CRM_Core_Permission::check('add contacts') &&
Expand Down Expand Up @@ -329,7 +329,7 @@ private static function setTemplateValues($id) {
$urlArray = array(
'fullTextSearchID' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue',
'CRM_Contact_Form_Search_Custom_FullText', 'value', 'name'
)
),
);
self::setProperty(self::FULLTEXT_SEARCH, 'templateValues', $urlArray);
break;
Expand Down Expand Up @@ -369,7 +369,7 @@ private static function setTemplateShortcutValues() {
'query' => 'action=add&reset=1&context=standalone',
'ref' => 'new-activity',
'title' => ts('Activity'),
)
),
));

$components = CRM_Core_Component::getEnabledComponents();
Expand All @@ -392,7 +392,7 @@ private static function setTemplateShortcutValues() {
'query' => 'atype=3&action=add&reset=1&context=standalone',
'ref' => 'new-email',
'title' => ts('Email'),
)
),
));

if (CRM_Core_Permission::check('edit groups')) {
Expand All @@ -402,7 +402,7 @@ private static function setTemplateShortcutValues() {
'query' => 'reset=1',
'ref' => 'new-group',
'title' => ts('Group'),
)
),
));
}

Expand All @@ -413,7 +413,7 @@ private static function setTemplateShortcutValues() {
'query' => 'reset=1&action=add',
'ref' => 'new-tag',
'title' => ts('Tag'),
)
),
));
}

Expand Down Expand Up @@ -481,7 +481,7 @@ private static function setTemplateDashboardValues() {
'path' => 'civicrm/user',
'query' => 'reset=1',
'title' => ts('My Contact Dashboard'),
)
),
);
}

Expand Down Expand Up @@ -590,7 +590,7 @@ public static function getContent($id) {
// return if upgrade mode
$config = CRM_Core_Config::singleton();
if ($config->isUpgradeMode()) {
return;
return NULL;
}

if (!self::getProperty($id, 'active')) {
Expand Down
16 changes: 8 additions & 8 deletions CRM/Core/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class CRM_Exception extends PEAR_Exception {
* - PEAR_Exception(string $message, array $causes);
* - PEAR_Exception(string $message, array $causes, int $code);
*
* @param string exception message
* @param string $message exception message
* @param int $code
* @param Exception $previous
*/
Expand Down Expand Up @@ -167,7 +167,7 @@ public static function displaySessionError(&$error, $separator = '<br />') {
* the errors we expect are from the pear modules DB, DB_DataObject
* which currently use PEAR::raiseError to notify of error messages.
*
* @param object PEAR_Error
* @param object $pearError PEAR_Error
*
* @return void
*/
Expand Down Expand Up @@ -461,11 +461,11 @@ class_exists('JError')
* Outputs pre-formatted debug information. Flushes the buffers
* so we can interrupt a potential POST/redirect
*
* @param string name of debug section
* @param mixed reference to variables that we need a trace of
* @param bool should we log or return the output
* @param bool whether to generate a HTML-escaped output
* @param bool should we check permissions before displaying output
* @param string $name name of debug section
* @param $variable mixed reference to variables that we need a trace of
* @param bool $log should we log or return the output
* @param bool $html whether to generate a HTML-escaped output
* @param bool $checkPermission should we check permissions before displaying output
* useful when we die during initialization and permissioning
* subsystem is not initialized - CRM-13765
*
Expand Down Expand Up @@ -526,7 +526,7 @@ public static function debug($name, $variable = NULL, $log = TRUE, $html = TRUE,
* @see CRM_Core_Error::debug()
* @see CRM_Core_Error::debug_log_message()
*/
static function debug_var(
public static function debug_var(
$variable_name,
$variable,
$print = TRUE,
Expand Down
16 changes: 8 additions & 8 deletions CRM/Core/I18n/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public static function makeMultilingual($locale) {
* @return void
*/
public static function makeSinglelingual($retain) {
$domain = new CRM_Core_DAO_Domain;
$domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
$locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales);

Expand All @@ -131,7 +131,7 @@ public static function makeSinglelingual($retain) {
}

// lets drop all triggers first
$logging = new CRM_Logging_Schema;
$logging = new CRM_Logging_Schema();
$logging->dropTriggers();

// turn subsequent tables singlelingual
Expand Down Expand Up @@ -166,13 +166,13 @@ public static function makeSinglelingual($retain) {
*
* @return void
*/
static function makeSinglelingualTable(
public static function makeSinglelingualTable(
$retain,
$table,
$class = 'CRM_Core_I18n_SchemaStructure',
$triggers = array()
) {
$domain = new CRM_Core_DAO_Domain;
$domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
$locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales);

Expand Down Expand Up @@ -212,7 +212,7 @@ static function makeSinglelingualTable(
$queries = array_merge($queries, self::createIndexQueries(NULL, $table));

// execute the queries without i18n rewriting
$dao = new CRM_Core_DAO;
$dao = new CRM_Core_DAO();
foreach ($queries as $query) {
$dao->query($query, FALSE);
}
Expand Down Expand Up @@ -318,7 +318,7 @@ public static function rebuildMultilingualSchema($locales, $version = NULL) {
$indices =& $class::indices();
$tables =& $class::tables();
$queries = array();
$dao = new CRM_Core_DAO;
$dao = new CRM_Core_DAO();

// get all of the already existing indices
$existing = array();
Expand Down Expand Up @@ -562,7 +562,7 @@ public static function triggerInfo(&$info, $tableName = NULL) {
foreach ($locales as $old) {
$trigger[] = "ELSEIF NEW.{$column}_{$old} IS NOT NULL THEN";
foreach (array_merge($locales, array(
$locale
$locale,
)) as $loc) {
if ($loc == $old) {
continue;
Expand Down Expand Up @@ -593,7 +593,7 @@ public static function triggerInfo(&$info, $tableName = NULL) {
foreach ($locales as $old) {
$trigger[] = "ELSEIF NEW.{$column}_{$old} IS NOT NULL THEN";
foreach (array_merge($locales, array(
$locale
$locale,
)) as $loc) {
if ($loc == $old) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/I18n/SchemaStructure_3_1_alpha1.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_3_1_alpha1 {
/**
* @return array
*/
static function &columns() {
public static function &columns() {
static $result = NULL;
if (!$result) {
$result = array(
Expand Down
Loading

0 comments on commit 5552f12

Please sign in to comment.