Skip to content

Commit

Permalink
Fix some phpmd findings
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Oct 19, 2016
1 parent 1646bb3 commit 490c022
Show file tree
Hide file tree
Showing 19 changed files with 10 additions and 64 deletions.
1 change: 0 additions & 1 deletion lib/midcom/helper/datamanager2/type/date.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ public function convert_to_html()
*/
private function get_time_format()
{
$format = 'none';
// FIXME: This is not exactly an elegant way to do this
$widget_conf = $this->storage->_schema->fields[$this->name]['widget_config'];
if ( $this->storage_type != 'ISO_DATE'
Expand Down
2 changes: 1 addition & 1 deletion lib/midcom/helper/datamanager2/type/privilege.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public function convert_to_html()

case MIDCOM_PRIVILEGE_INHERIT:
$effective_value = $this->get_effective_value() ? 'allow' : 'deny';
return sprintf($this->_l10n->get('widget privilege: inherit %s'), $this->_l10n->get('widget privilege: ' . $get_effective_value));
return sprintf($this->_l10n->get('widget privilege: inherit %s'), $this->_l10n->get('widget privilege: ' . $effective_value));

default:
return $this->get_value();
Expand Down
2 changes: 1 addition & 1 deletion lib/midcom/helper/datamanager2/widget/textarea.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function _on_initialize()
*/
public function add_elements_to_form($attributes)
{
$attribute['rows'] = $this->height;
$attributes['rows'] = $this->height;
$attributes['cols'] = $this->width;
$attributes['class'] = 'longtext';
if ($this->wrap != '')
Expand Down
2 changes: 1 addition & 1 deletion lib/midcom/helper/datamanager2/widget/tinymce.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public function add_elements_to_form($attributes)
$this->_add_initscript();
}

$attribute['rows'] = $this->height;
$attributes['rows'] = $this->height;
$attributes['cols'] = $this->width;
$attributes['class'] = 'tinymce';
if ($this->wrap != '')
Expand Down
1 change: 0 additions & 1 deletion lib/midcom/services/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ public function load_jobs(array $data)

foreach ($jobs as $job)
{
$stat = false;
try
{
if ($this->_validate_job($job))
Expand Down
1 change: 0 additions & 1 deletion lib/midcom/services/rcs/backend/rcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ public function get_diff($oldest_revision, $latest_revision, $renderer_style = '
$return = array();
$oldest = array_intersect_key($oldest, $newest);

$ln = midcom::get()->i18n->get_l10n("midcom");
$repl = array(
'<del>' => "<span class=\"deleted\">",
'</del>' => '</span>',
Expand Down
2 changes: 1 addition & 1 deletion lib/midgard/admin/asgard/handler/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private function _show_lists($type)
{
$this->_request_data['list_type'] = $type;
midcom_show_style('midgard_admin_asgard_components_header');
foreach ($this->_request_data[$type] as $component => $component_data)
foreach ($this->_request_data[$type] as $component_data)
{
$this->_request_data['component_data'] = $component_data;
midcom_show_style('midgard_admin_asgard_components_item');
Expand Down
10 changes: 0 additions & 10 deletions lib/net/nehmer/comments/handler/moderate.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ class net_nehmer_comments_handler_moderate extends midcom_baseclasses_components
*/
private $_objectguid;

/**
* Simple helper which references all important members to the request data listing
* for usage within the style listing.
*/
private function _prepare_request_data()
{
$this->_request_data['objectguid'] = $this->_objectguid;
$this->_request_data['comment'] = $this->_comment;
}

/**
* Marks comment as possible abuse
*
Expand Down
2 changes: 1 addition & 1 deletion lib/org/openpsa/calendar/conflictmanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function run($rob_tentative = false)

foreach ($this->_load_resources() as $resource)
{
$this->_process_resource($member, $modified_events, $rob_tentative);
$this->_process_resource($resource, $modified_events, $rob_tentative);
}
// TODO: Shared tasks need a separate check (different member object)

Expand Down
10 changes: 0 additions & 10 deletions lib/org/openpsa/calendar/midcom/interfaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,6 @@ public static function get_viewer_attributes($guid, $node)
return $workflow->render_attributes() . ' href="' . $node[MIDCOM_NAV_FULLURL] . 'event/' . $guid . '/"';
}

/**
* Returns string of correct window options for JS
*/
private static function _js_window_options($height, $width)
{
$ret = "toolbar=0,location=0,status=0,height={$height},width={$width},";
$ret .= "dependent=1,alwaysRaised=1,scrollbars=1,resizable=1";
return $ret;
}

public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object)
{
if ($object instanceof org_openpsa_calendar_event_dba)
Expand Down
1 change: 0 additions & 1 deletion lib/org/openpsa/core/acl/synchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ private function _write_full_midcom_acls(midcom_core_dbaobject $object, $owner_i
{
foreach ($privileges as $privilege)
{
$found = false;
if ( !empty($needed_privileges[$privilege->privilegename])
&& $needed_privileges[$privilege->privilegename]['assignee'] == $privilege->assignee
&& $needed_privileges[$privilege->privilegename]['value'] == $privilege->value)
Expand Down
6 changes: 3 additions & 3 deletions lib/org/openpsa/directmarketing/cleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ private function add_time_filter(midcom_core_querybuilder $qb, $kept)
private function get_message_receipt_qb($kept = false)
{
$qb = org_openpsa_directmarketing_campaign_messagereceipt_dba::new_query_builder();
$qb->add_time_filter($qb, $kept);
$this->add_time_filter($qb, $kept);
return $qb;
}

private function get_link_log_qb($kept = false)
{
$qb = org_openpsa_directmarketing_link_log_dba::new_query_builder();
$qb->add_time_filter($qb, $kept);
$this->add_time_filter($qb, $kept);
return $qb;
}

Expand Down Expand Up @@ -127,7 +127,7 @@ private function delete_entries(midcom_core_querybuilder $qb)
$objects = $qb->execute();
foreach ($objects as $object)
{
$objects->delete();
$object->delete();
}
}
}
1 change: 0 additions & 1 deletion lib/org/openpsa/directmarketing/handler/message/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ public function copy_callback(midcom_helper_datamanager2_controller $controller)
foreach ($campaigns as $campaign)
{
$new_object = $copy->copy_object($original, $campaign, array('sendStarted' => 0, 'sendCompleted' => 0));
$guid = $new_object->guid;

// Store for later use
$copy_data[] = array
Expand Down
2 changes: 1 addition & 1 deletion lib/org/openpsa/invoices/handler/rest/billingdata.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private function get_billingdata($linkGuid)
}

$billingdata = new org_openpsa_invoices_billing_data_dba();
$billingdata->linkGuid = $linkGuid;
$billingdata->linkGuid = $person->guid;
if (!$billingdata->create())
{
return false;
Expand Down
1 change: 0 additions & 1 deletion lib/org/openpsa/products/midcom/interfaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobjec

private function _resolve_productgroup($product_group, $topic)
{
$intree = false;
$real_config = new midcom_helper_configuration($topic, 'org.openpsa.products');

if ($real_config->get('root_group'))
Expand Down
16 changes: 0 additions & 16 deletions lib/org/openpsa/user/handler/person/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@ public function load_schemadb()
return $db;
}

private function _prepare_request_data()
{
$this->_request_data['person'] = $this->_person;
$this->_request_data['account'] = $this->_account;
$this->_master->add_password_validation_code();
}

/**
* @param mixed $handler_id The ID of the handler.
* @param array $args The argument list.
Expand Down Expand Up @@ -242,13 +235,4 @@ public function _handler_delete($handler_id, array $args, array &$data)
}
return new midcom_response_relocate('view/' . $this->_person->guid . "/");
}

/**
* Update the context so that we get a complete breadcrumb line towards the current location.
*/
private function _update_breadcrumb_line($action)
{
$this->add_breadcrumb("view/{$this->_person->guid}/", $this->_person->name);
$this->add_breadcrumb("", $this->_l10n->get($action));
}
}
11 changes: 0 additions & 11 deletions lib/org/openpsa/user/viewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@
*/
class org_openpsa_user_viewer extends midcom_baseclasses_components_request
{
public function add_password_validation_code()
{
//get rules for js in style
$this->_request_data['password_rules'] = $this->_config->get('password_score_rules');

//get password_length & minimum score for js
$this->_request_data['min_score'] = $this->_config->get('min_password_score');
$this->_request_data['min_length'] = $this->_config->get('min_password_length');
$this->_request_data['max_length'] = $this->_config->get('max_password_length');
}

/**
* Create account based on data from DM2
*
Expand Down
2 changes: 1 addition & 1 deletion lib/org/openpsa/widgets/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ private function _show_groups()
$mc->add_constraint('gid.orgOpenpsaObtype', '>=', org_openpsa_contacts_group_dba::ORGANIZATION);
$memberships = $mc->get_rows(array('gid', 'extra'));

foreach ($memberships as $guid => $data)
foreach ($memberships as $data)
{
try
{
Expand Down
1 change: 0 additions & 1 deletion lib/org/openpsa/widgets/status.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ abstract class org_openpsa_widgets_status
public function render()
{
$l10n = midcom::get()->i18n->get_l10n('org.openpsa.widgets');
$l10n_midcom = midcom::get()->i18n->get_l10n('midcom');

echo "<h2 class=\"current-status {$this->get_status_class()}\">";
echo $l10n->get('status') . ': ' . $this->get_current_status();
Expand Down

0 comments on commit 490c022

Please sign in to comment.