From c0c5954756a84a9d282fe7efaff62885a1e411ae Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sun, 19 Jul 2009 22:15:59 -0600 Subject: [PATCH] Re-add some lint fixes --- imp/acl.php | 3 +-- imp/ajax.php | 12 ++++++------ imp/attachment.php | 2 +- imp/compose.php | 14 ++++++-------- imp/config/hooks.php.dist | 3 ++- imp/contacts.php | 2 +- imp/lib/Compose.php | 23 +++++------------------ imp/lib/Crypt/Pgp.php | 1 + imp/lib/Crypt/Smime.php | 1 + imp/lib/DIMP.php | 8 ++++---- imp/lib/Fetchmail.php | 15 ++++----------- imp/lib/IMP.php | 20 ++++++++++---------- imp/lib/Identity/imp.php | 2 +- imp/lib/Imap/Flags.php | 2 +- imp/lib/Imap/Tree.php | 5 ++--- imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php | 2 +- imp/lib/Message.php | 2 +- imp/lib/Mime/Viewer/Itip.php | 2 +- imp/lib/Mime/Viewer/Plain.php | 2 +- imp/lib/Mime/Viewer/Smil.php | 2 +- imp/lib/Quota.php | 4 ++-- imp/lib/Quota/Command.php | 6 +++--- imp/lib/Quota/Mdaemon.php | 4 +++- imp/lib/Search.php | 4 ++-- imp/lib/Spam.php | 2 +- imp/lib/UI/Compose.php | 8 +++----- imp/lib/Views/ListMessages.php | 2 +- imp/lib/api.php | 4 ++-- imp/mailbox.php | 6 +++--- imp/message.php | 4 ++-- imp/pgp.php | 2 +- imp/test.php | 2 +- imp/view.php | 4 ++-- 33 files changed, 77 insertions(+), 98 deletions(-) diff --git a/imp/acl.php b/imp/acl.php index 0682a880c..cd75a8ca4 100644 --- a/imp/acl.php +++ b/imp/acl.php @@ -179,8 +179,7 @@ if (empty($_SESSION['imp']['admin'])) { if (in_array($user, $current_users)) { continue; } - $new_user_field .= "\n" . ''; + $new_user_field .= "\n'; } $new_user_field .= "\n"; } diff --git a/imp/ajax.php b/imp/ajax.php index 12d6a0a32..2c575880f 100644 --- a/imp/ajax.php +++ b/imp/ajax.php @@ -94,7 +94,7 @@ function _getListMessages($mbox, $change) } $list_msg = new IMP_Views_ListMessages(); - $res = $list_msg->ListMessages($args); + $res = $list_msg->listMessages($args); // TODO: This can potentially be optimized for arrival time sort - if the // cache ID changes, we know the changes must occur at end of mailbox. @@ -481,7 +481,7 @@ case 'ShowPreview': ); $show_msg = new IMP_Views_ShowMessage(); - $result = (object) $show_msg->showMessage($args); + $result = (object)$show_msg->showMessage($args); break; case 'Html2Text': @@ -634,7 +634,7 @@ case 'PurgeDeleted': $expunge_count = count($expunged[$mbox]); $display_folder = IMP::displayFolder($mbox); if ($expunge_count == 1) { - $notification->push(sprintf(_("1 message was purged from \"%s\"."), $display_folder), 'horde.success'); + $notification->push(sprintf(_("1 message was purged from \"%s\"."), $display_folder), 'horde.success'); } else { $notification->push(sprintf(_("%s messages were purged from \"%s\"."), $expunge_count, $display_folder), 'horde.success'); } @@ -656,7 +656,7 @@ case 'ModifyPollFolder': $imptree = IMP_Imap_Tree::singleton(); $result = new stdClass; - $result->add = (bool) $add; + $result->add = (bool)$add; $result->folder = $mbox; if ($add) { @@ -664,10 +664,10 @@ case 'ModifyPollFolder': if ($info = $imptree->getElementInfo($mbox)) { $result->poll = array($mbox => $info['unseen']); } - $notification->push(sprintf(_("\"%s\" mailbox now polled for new mail."), $display_folder), 'horde.success'); + $notification->push(sprintf(_("\"%s\" mailbox now polled for new mail."), $display_folder), 'horde.success'); } else { $imptree->removePollList($mbox); - $notification->push(sprintf(_("\"%s\" mailbox no longer polled for new mail."), $display_folder), 'horde.success'); + $notification->push(sprintf(_("\"%s\" mailbox no longer polled for new mail."), $display_folder), 'horde.success'); } break; diff --git a/imp/attachment.php b/imp/attachment.php index f09ab74ff..9e6c96c12 100644 --- a/imp/attachment.php +++ b/imp/attachment.php @@ -67,7 +67,7 @@ if ($conf['compose']['link_attachments_notify']) { } else { /* Create a random identifier for this file. */ $id = uniqid(mt_rand()); - $res = $vfsroot->writeData($full_path, $file_name . '.notify' , $id, true); + $res = $vfsroot->writeData($full_path, $file_name . '.notify', $id, true); if (is_a($res, 'PEAR_Error')) { Horde::logMessage($res, __FILE__, __LINE__, PEAR_LOG_ERR); } else { diff --git a/imp/compose.php b/imp/compose.php index 690f9cd1d..9520694a7 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -446,7 +446,7 @@ case 'send_message': if (Horde_Util::getFormData('resume_draft') && $prefs->getValue('auto_delete_drafts') && - ($thismailbox == IMP::folderPref($prefs->getValue('drafts_folder'), true))) { + ($thismailbox == IMP::folderPref($prefs->getValue('drafts_folder'), true))) { $imp_message = IMP_Message::singleton(); $idx_array = array($index . IMP::IDX_SEP . $thismailbox); if ($imp_message->delete($idx_array)) { @@ -520,9 +520,7 @@ case 'fwd_digest': if (!empty($indices)) { $msglist = unserialize(urldecode($indices)); $subject_header = $imp_compose->attachIMAPMessage($msglist); - if ($subject_header === false) { - // TODO: notification - } else { + if ($subject_header !== false) { $header['subject'] = $subject_header; } } @@ -842,7 +840,7 @@ if ($redirect) { $entry['select_tabindex'] = ++$tabindex; $entry['select_name'] = htmlspecialchars($to_item[0]); $entry['select_to'] = array(); - for ($i = 1; $i < count($to_item); $i++) { + for ($i = 1, $items = count($to_item); $i < $items; ++$i) { $entry['select_to'][] = array('val' => htmlspecialchars($to_item[$i])); } } else { @@ -973,7 +971,7 @@ if ($redirect) { $entry['select_tabindex'] = ++$tabindex; $entry['select_name'] = htmlspecialchars($item[0]); $entry['select_arr'] = array(); - for ($i = 1; $i < count($item); $i++) { + for ($i = 1, $items = count($item); $i < $items; ++$i) { $entry['select_arr'][] = array('val' => htmlspecialchars($item[$i])); } $entry['input_value'] = null; @@ -1114,8 +1112,8 @@ if ($redirect) { $d_read = $prefs->getValue('disposition_request_read'); $t->set('rrr', $conf['compose']['allow_receipts'] && ($d_read != 'never')); if ($t->get('rrr')) { - $t->set('rrr_selected', ($d_read != 'ask') || (Horde_Util::getFormData('request_read_receipt') == 'on')); - $t->set('rrr_label', Horde::label('rrr', _("Request a _Read Receipt"))); + $t->set('rrr_selected', ($d_read != 'ask') || (Horde_Util::getFormData('request_read_receipt') == 'on')); + $t->set('rrr_label', Horde::label('rrr', _("Request a _Read Receipt"))); } $t->set('compose_html', (!is_null($rtemode) && !$prefs->isLocked('compose_html'))); diff --git a/imp/config/hooks.php.dist b/imp/config/hooks.php.dist index cff3309fe..7a21a8e75 100644 --- a/imp/config/hooks.php.dist +++ b/imp/config/hooks.php.dist @@ -472,7 +472,8 @@ if (!empty($GLOBALS['conf']['kolab']['enabled'])) { } if (!function_exists('_imp_hook_display_folder')) { - function _imp_hook_display_folder($mailbox) { + function _imp_hook_display_folder($mailbox) + { $type = Kolab::getMailboxType($mailbox); return empty($type) || ($type == 'mail'); } diff --git a/imp/contacts.php b/imp/contacts.php index 55e40ab00..f3de4575c 100644 --- a/imp/contacts.php +++ b/imp/contacts.php @@ -73,7 +73,7 @@ if (count($source_list) > 1) { $template->set('multiple_source', true); $s_list = array(); foreach ($source_list as $key => $select) { - $s_list[] = array('val' => $key, 'selected' => ($key == $source), 'label' => htmlspecialchars($select)); + $s_list[] = array('val' => $key, 'selected' => ($key == $source), 'label' => htmlspecialchars($select)); } $template->set('source_list', $s_list); } else { diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index 245fdac97..cc39f4433 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -575,7 +575,7 @@ class IMP_Compose ((strpos($save_attach, 'prompt') === 0) && empty($opts['save_attachments']))) { $mime_message->buildMimeIds(); - for ($i = 2; ; ++$i) { + for ($i = 2;; ++$i) { if (!($oldPart = $mime_message->getPart($i))) { break; } @@ -1310,7 +1310,7 @@ class IMP_Compose " ---------\n" . $this->_getMsgHeaders($h) . "\n\n"; - $msg_post = "\n\n" . '----- ' . + $msg_post = "\n\n----- " . ($from ? sprintf(_("End message from %s"), $from) : _("End message")) . " -----\n"; } else { @@ -1318,7 +1318,6 @@ class IMP_Compose $msg_post = ''; } - $compose_html = $GLOBALS['prefs']->getValue('compose_html'); $msg_text = $this->_getMessageText($contents, array( @@ -2154,7 +2153,7 @@ class IMP_Compose if ($part->getPrimaryType() == 'multipart') { $mixed_part = new Horde_Mime_Part(); $mixed_part->setType('multipart/mixed'); - $mixed_part->addPart(part); + $mixed_part->addPart($part); $link_part = new Horde_Mime_Part(); $link_part->setType('text/plain'); @@ -2452,9 +2451,6 @@ class IMP_Compose /** * Formats the address properly. * - * This method can be called statically, i.e.: - * $ret = IMP_Compose::formatAddr(); - * * @param string $addr The address to format. * * @return string The formatted address. @@ -2473,9 +2469,6 @@ class IMP_Compose * any address that is either not valid or fails to expand. This function * will not search if the address string is empty. * - * This method can be called statically, i.e.: - * $ret = IMP_Compose::expandAddresses(); - * * @param string $addrString The name(s) or address(es) to expand. * * @return array All matching addresses. @@ -2483,7 +2476,7 @@ class IMP_Compose static public function expandAddresses($addrString) { return preg_match('|[^\s]|', $addrString) - ? IMP_Compose::getAddressList(reset(array_filter(array_map('trim', Horde_Mime_Address::explode($addrString, ',;'))))) + ? self::getAddressList(reset(array_filter(array_map('trim', Horde_Mime_Address::explode($addrString, ',;'))))) : ''; } @@ -2491,16 +2484,13 @@ class IMP_Compose * Uses the Registry to expand names and return error information for * any address that is either not valid or fails to expand. * - * This method can be called statically, i.e.: - * $ret = IMP_Compose::expandAddresses(); - * * @param string $search The term to search by. * * @return array All matching addresses. */ static public function getAddressList($search = '') { - $sparams = IMP_Compose::getAddressSearchParams(); + $sparams = self::getAddressSearchParams(); try { $res = $GLOBALS['registry']->call('contacts/search', array($search, $sparams['sources'], $sparams['fields'], true)); } catch (Horde_Exception $e) { @@ -2534,9 +2524,6 @@ class IMP_Compose /** * Determines parameters needed to do an address search * - * This method can be called statically, i.e.: - * $ret = IMP_Compose::getAddressSearchParams(); - * * @return array An array with two keys: 'sources' and 'fields'. */ static public function getAddressSearchParams() diff --git a/imp/lib/Crypt/Pgp.php b/imp/lib/Crypt/Pgp.php index 6f4db8c54..b65ea7488 100644 --- a/imp/lib/Crypt/Pgp.php +++ b/imp/lib/Crypt/Pgp.php @@ -466,6 +466,7 @@ class IMP_Crypt_Pgp extends Horde_Crypt_Pgp { $params = array( 'actionID' => 'save_attachment_public_key', + 'mailbox' => $mailbox, 'uid' => $uid, 'mime_id' => $id ); diff --git a/imp/lib/Crypt/Smime.php b/imp/lib/Crypt/Smime.php index fc078e10f..a638c56bd 100644 --- a/imp/lib/Crypt/Smime.php +++ b/imp/lib/Crypt/Smime.php @@ -325,6 +325,7 @@ class IMP_Crypt_Smime extends Horde_Crypt_Smime { $params = array( 'actionID' => 'save_attachment_public_key', + 'mailbox' => $mailbox, 'uid' => $uid, 'mime_id' => $id ); diff --git a/imp/lib/DIMP.php b/imp/lib/DIMP.php index 786e3d737..7d93640ea 100644 --- a/imp/lib/DIMP.php +++ b/imp/lib/DIMP.php @@ -95,7 +95,7 @@ class DIMP header('Vary: Accept-Language'); } - echo '' . "\n" . + echo "\n" . (!empty($GLOBALS['language']) ? '\n". "\n"; @@ -164,7 +164,7 @@ class DIMP if (!empty($changes['a'])) { $result['a'] = array(); foreach ($changes['a'] as $val) { - $result['a'][] = DIMP::_createFolderElt(is_array($val) ? $val : $imptree->element($val)); + $result['a'][] = self::_createFolderElt(is_array($val) ? $val : $imptree->element($val)); } } @@ -174,7 +174,7 @@ class DIMP // Skip the base element, since any change there won't ever be // updated on-screen. if ($val != IMP_Imap_Tree::BASE_ELT) { - $result['c'][] = DIMP::_createFolderElt($imptree->element($val)); + $result['c'][] = self::_createFolderElt($imptree->element($val)); } } } @@ -217,7 +217,7 @@ class DIMP $ob = new stdClass; if ($elt['children']) { - $ob->ch = 1; + $ob->ch = 1; } $ob->m = $elt['value']; if ($ob->m != $elt['name']) { diff --git a/imp/lib/Fetchmail.php b/imp/lib/Fetchmail.php index 656816fd9..eadf3341f 100644 --- a/imp/lib/Fetchmail.php +++ b/imp/lib/Fetchmail.php @@ -71,8 +71,6 @@ abstract class IMP_Fetchmail /** * Returns a list of available drivers, with a description of each. - * This function can be called statically: - * $list = IMP_Fetchmail::listDrivers(); * * @return array The list of available drivers, with the driver name as * the key and the description as the value. @@ -100,8 +98,6 @@ abstract class IMP_Fetchmail /** * List the colors available for coloring fetched messages. - * This function can be called statically: - * $list = IMP_Fetchmail::listColors(); * * @return array The list of available colors; */ @@ -115,8 +111,6 @@ abstract class IMP_Fetchmail /** * Returns a description of the driver. - * This function can be called statically: - * $description = IMP_Fetchmail::description(); * * @return string The description of the driver. */ @@ -125,7 +119,6 @@ abstract class IMP_Fetchmail /** * Perform fetchmail on the list of accounts given. Outputs informaton * to the global notification driver. - * This function can be called statically. * * @param array $accounts The list of account identifiers to fetch mail * for. @@ -136,7 +129,7 @@ abstract class IMP_Fetchmail foreach ($accounts as $val) { $params = $fm_account->getAllValues($val); - $driver = IMP_Fetchmail::factory($params['driver'], $params); + $driver = self::factory($params['driver'], $params); if ($driver === false) { continue; } @@ -201,9 +194,9 @@ abstract class IMP_Fetchmail { /* Check for missing params. */ $paramlist = $this->getParameterList(); - if (array_diff($paramlist, array_keys($params))) { - // TODO: Error message here - } + /* if (array_diff($paramlist, array_keys($params))) { + * TODO: Error message here + * } */ $this->_params = $params; } diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 1176e7ce2..336346126 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -186,9 +186,9 @@ class IMP (!empty($GLOBALS['conf']['hooks']['permsdenied']) || (self::hasPermission('create_folders') && self::hasPermission('max_folders')))) { - $text .= '' . "\n"; - $text .= '\n"; - $text .= '' . "\n"; + $text .= "\n" . + '\n" . + "\n"; } /* Add the list of mailboxes to the lists. */ @@ -241,7 +241,7 @@ class IMP try { $notepads = $GLOBALS['registry']->call('notes/listNotepads', array(false, PERMS_EDIT)); if (count($notepads)) { - $text .= '' . "\n"; + $text .= '\n"; foreach ($notepads as $id => $notepad) { $text .= sprintf('%s', @@ -555,7 +555,7 @@ class IMP } } - if (IMP::canCompose()) { + if (self::canCompose()) { $menu->add(self::composeLink(array('mailbox' => $GLOBALS['imp_mbox']['mailbox'])), _("_New Message"), 'compose.png'); } @@ -577,7 +577,7 @@ class IMP $js_params = array( 'dialog_load' => Horde::applicationUrl('ajax.php', true, -1) . '/FetchmailDialog' ); - $menu->add('javascript:IMPDialog.display(\'' . IMP::escapeJSON($js_params) . '\')', _("Fetch Mail"), 'fetchmail.png'); + $menu->add('javascript:IMPDialog.display(\'' . self::escapeJSON($js_params) . '\')', _("Fetch Mail"), 'fetchmail.png'); } if ($prefs->getValue('filter_menuitem')) { @@ -1012,7 +1012,7 @@ class IMP } foreach ($enc_opts as $key => $val) { - $output .= '' . "\n"; + $output .= '\n"; } return $output; @@ -1383,7 +1383,7 @@ class IMP } foreach (array_merge(array($js_url), $js_force) as $val) { - echo '' . "\n"; + echo '\n"; } } @@ -1486,7 +1486,7 @@ class IMP } foreach ($css_out as $file) { - echo '' . "\n"; + echo '\n"; } } @@ -1687,7 +1687,7 @@ class IMP 'cancel_text' => _("Cancel") ); - return 'IMPDialog.display(\'' . IMP::escapeJSON($js_params) . '\')'; + return 'IMPDialog.display(\'' . self::escapeJSON($js_params) . '\')'; } /** diff --git a/imp/lib/Identity/imp.php b/imp/lib/Identity/imp.php index ca2f41b7e..e3dafdd4f 100644 --- a/imp/lib/Identity/imp.php +++ b/imp/lib/Identity/imp.php @@ -47,7 +47,7 @@ class Identity_imp extends Identity * Reads all the user's identities from the prefs object or builds * a new identity from the standard values given in prefs.php. */ - function __construct() + public function __construct() { parent::__construct(); $this->_properties = array_merge( diff --git a/imp/lib/Imap/Flags.php b/imp/lib/Imap/Flags.php index 5895b208c..68db76f33 100644 --- a/imp/lib/Imap/Flags.php +++ b/imp/lib/Imap/Flags.php @@ -162,7 +162,7 @@ class IMP_Imap_Flags /* Flags are named PREFIX{$i}. Keep incrementing until we find the * next available flag. */ - for ($i = 0; ; ++$i) { + for ($i = 0;; ++$i) { $curr = self::PREFIX . $i; if (!isset($this->_flags[$curr])) { $this->_flags[$curr] = array( diff --git a/imp/lib/Imap/Tree.php b/imp/lib/Imap/Tree.php index 6566f9ce4..e2daef383 100644 --- a/imp/lib/Imap/Tree.php +++ b/imp/lib/Imap/Tree.php @@ -619,7 +619,7 @@ class IMP_Imap_Tree $this->_currkey = $old['k'] + 1; $this->_currparent = $old['p']; } while ((($curr = $this->current()) == false) && - count($this->_currstack)); + !empty($this->_currstack)); } } @@ -665,7 +665,7 @@ class IMP_Imap_Tree */ public function peek() { - for ($i = ($this->_currkey + 1); ; ++$i) { + for ($i = ($this->_currkey + 1);; ++$i) { if (!isset($this->_parent[$this->_currparent][$i])) { return false; } @@ -1896,7 +1896,6 @@ class IMP_Imap_Tree } } - switch ($mailbox['v']) { case 'INBOX': $row['icon'] = 'folders/inbox.png'; diff --git a/imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php b/imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php index 26f600ac5..43022ae92 100644 --- a/imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php +++ b/imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php @@ -44,7 +44,7 @@ class IMP_LoginTasks_Task_DeleteSentmailMonthly extends Horde_LoginTasks_Task foreach (array_keys($old_folders) as $k) { foreach ($sent_mail_folders as $folder) { if (preg_match('/^' . str_replace('/', '\/', $folder) . '-([^-]+)-([0-9]{4})$/i', $k, $regs)) { - $folder_array[$k] = Horde_String::convertCharset((is_numeric($regs[1])) ? mktime(0, 0, 0,$regs[1], 1, $regs[2]) : strtotime("$regs[1] 1, $regs[2]"), Horde_Nls::getCharset(), 'UTF7-IMAP'); + $folder_array[$k] = Horde_String::convertCharset((is_numeric($regs[1])) ? mktime(0, 0, 0, $regs[1], 1, $regs[2]) : strtotime("$regs[1] 1, $regs[2]"), Horde_Nls::getCharset(), 'UTF7-IMAP'); } } } diff --git a/imp/lib/Message.php b/imp/lib/Message.php index b68125db7..c48575a5d 100644 --- a/imp/lib/Message.php +++ b/imp/lib/Message.php @@ -507,7 +507,7 @@ class IMP_Message /* For stripping all parts, it only makes sense to strip base * parts. Stripping subparts may cause issues with display of the * parent multipart type. */ - for ($i = 2; ; ++$i) { + for ($i = 2;; ++$i) { $part = $contents->getMIMEPart($i, array('nocontents' => true)); if (!$part) { break; diff --git a/imp/lib/Mime/Viewer/Itip.php b/imp/lib/Mime/Viewer/Itip.php index 6f6a8d78b..91f59ef4e 100644 --- a/imp/lib/Mime/Viewer/Itip.php +++ b/imp/lib/Mime/Viewer/Itip.php @@ -813,7 +813,7 @@ class IMP_Horde_Mime_Viewer_Itip extends Horde_Mime_Viewer_Driver } else { if ($event->end->compareDateTime($time_span_start) <= -1 || $event->start->compareDateTime($time_span_end) >= 1) { - continue; + continue; } if ($event->end->compareDateTime($vevent_start) <= -1 || $event->start->compareDateTime($vevent_end) >= 1) { diff --git a/imp/lib/Mime/Viewer/Plain.php b/imp/lib/Mime/Viewer/Plain.php index 0742903ac..37b967c7a 100644 --- a/imp/lib/Mime/Viewer/Plain.php +++ b/imp/lib/Mime/Viewer/Plain.php @@ -114,7 +114,7 @@ class IMP_Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain return array( $mime_id => array( - 'data' => '
' . "\n" . $text . '
', + 'data' => "
\n" . $text . '
', 'status' => array(), 'type' => $type ) diff --git a/imp/lib/Mime/Viewer/Smil.php b/imp/lib/Mime/Viewer/Smil.php index 5abd83f2f..c4a677f61 100644 --- a/imp/lib/Mime/Viewer/Smil.php +++ b/imp/lib/Mime/Viewer/Smil.php @@ -16,7 +16,7 @@ class IMP_Horde_Mime_Viewer_Smil extends Horde_Mime_Viewer_Smil /** * User-defined function callback for start elements. * - * @param object $parser Handle to the parser instance. + * @param object $parser Handle to the parser instance (not used). * @param string $name The name of this XML element. * @param array $attrs List of this element's attributes. */ diff --git a/imp/lib/Quota.php b/imp/lib/Quota.php index c5e1a6a15..9a088932b 100644 --- a/imp/lib/Quota.php +++ b/imp/lib/Quota.php @@ -49,7 +49,7 @@ class IMP_Quota $sig = hash('md5', serialize(array($driver, $params))); if (!isset(self::$_instances[$sig])) { - self::$_instances[$sig] = IMP_Quota::getInstance($driver, $params); + self::$_instances[$sig] = self::getInstance($driver, $params); } return self::$_instances[$sig]; @@ -126,7 +126,7 @@ class IMP_Quota 'nolimit_short' => isset($this->_params['format']['nolimit_short']) ? $this->_params['format']['nolimit_short'] : _("%.0f %s") - ); + ); } /** diff --git a/imp/lib/Quota/Command.php b/imp/lib/Quota/Command.php index 8153ff862..998a3515d 100644 --- a/imp/lib/Quota/Command.php +++ b/imp/lib/Quota/Command.php @@ -80,9 +80,9 @@ class IMP_Quota_Command extends IMP_Quota $cmdline = $this->_params['quota_path'] . ' -u ' . $_SESSION['imp']['user'] . ' | ' . $this->_params['grep_path'] . ' ' . $search_string; exec($cmdline, $quota_data, $return_code); if (($return_code == 0) && (count($quota_data) == 1)) { - $quota = split("[[:blank:]]+", trim($quota_data[0])); - $blocksize = $this->_blockSize(); - return array('usage' => $quota[1] * $blocksize, + $quota = split("[[:blank:]]+", trim($quota_data[0])); + $blocksize = $this->_blockSize(); + return array('usage' => $quota[1] * $blocksize, 'limit' => $quota[2] * $blocksize); } diff --git a/imp/lib/Quota/Mdaemon.php b/imp/lib/Quota/Mdaemon.php index 6fc13c4da..fcd6b6ad0 100644 --- a/imp/lib/Quota/Mdaemon.php +++ b/imp/lib/Quota/Mdaemon.php @@ -58,9 +58,11 @@ class IMP_Quota_Mdaemon extends IMP_Quota { $contents = file_get_contents($path . '\imap.mrk'); + $c_len = strlen($contents); $pointer = 36; $size = 0; - while ($pointer < strlen($contents)) { + + while ($pointer < $c_len) { $details = unpack('a17Filename/a11Crap/VSize', substr($contents, $pointer, 36)); $size += $details['Size']; $pointer += 36; diff --git a/imp/lib/Search.php b/imp/lib/Search.php index 7a113c150..70b2b45f8 100644 --- a/imp/lib/Search.php +++ b/imp/lib/Search.php @@ -81,7 +81,7 @@ class IMP_Search * 'id' -- The ID of the search query in use. * */ - function __construct($params = array()) + public function __construct($params = array()) { if (!empty($params['id'])) { $this->_id = $this->_strip($params['id']); @@ -678,7 +678,7 @@ class IMP_Search */ public function createSearchID($id) { - return 'impsearch' . "\0" . $this->_strip($id); + return 'impsearch\0' . $this->_strip($id); } /** diff --git a/imp/lib/Spam.php b/imp/lib/Spam.php index 93eb06577..a8ec15b21 100644 --- a/imp/lib/Spam.php +++ b/imp/lib/Spam.php @@ -59,7 +59,7 @@ class IMP_Spam $prog = str_replace(array('%u','%l', '%d'), array( escapeshellarg(Horde_Auth::getAuth()), - escapeshellarg(Horde_Auth::getBareAuth()), + escapeshellarg(Horde_Auth::getBareAuth()), escapeshellarg(Horde_Auth::getAuthDomain()) ), $GLOBALS['conf'][$action]['program']); $proc = proc_open($prog, diff --git a/imp/lib/UI/Compose.php b/imp/lib/UI/Compose.php index a72da079d..f7810a8d1 100644 --- a/imp/lib/UI/Compose.php +++ b/imp/lib/UI/Compose.php @@ -84,9 +84,7 @@ class IMP_UI_Compose { $fwd_msg = $imp_compose->forwardMessage($imp_contents); $subject_header = $imp_compose->attachIMAPMessage(array($index), $fwd_msg['headers']); - if ($subject_header === false) { - // TODO: notification - } else { + if ($subject_header !== false) { $fwd_msg['headers']['subject'] = $subject_header; } @@ -143,9 +141,9 @@ class IMP_UI_Compose $clean_to .= $val . (($val[Horde_String::length($val) - 1] == ';') ? ' ' : ', '); } if ($expand) { - return $clean_to; + return $clean_to; } else { - return IMP_Compose::formatAddr($clean_to); + return IMP_Compose::formatAddr($clean_to); } } diff --git a/imp/lib/Views/ListMessages.php b/imp/lib/Views/ListMessages.php index b1e1f1ae5..6c3565158 100644 --- a/imp/lib/Views/ListMessages.php +++ b/imp/lib/Views/ListMessages.php @@ -19,7 +19,7 @@ class IMP_Views_ListMessages * * @return array TODO */ - public function ListMessages($args) + public function listMessages($args) { $mbox = $args['mbox']; $is_search = false; diff --git a/imp/lib/api.php b/imp/lib/api.php index ee2741e55..3b2d91562 100644 --- a/imp/lib/api.php +++ b/imp/lib/api.php @@ -543,10 +543,10 @@ function _imp_cacheOutput($params) case 'fckeditor': return array( 'data' => - 'FCKConfig.ToolbarSets["ImpToolbar"] = ' . $GLOBALS['prefs']->getValue('fckeditor_buttons') . ';' . "\n" . + 'FCKConfig.ToolbarSets["ImpToolbar"] = ' . $GLOBALS['prefs']->getValue('fckeditor_buttons') . ";\n" . // To more closely match "normal" textarea behavior, // send
on enter instead of

. - 'FCKConfig.EnterMode = \'br\';' . "\n" . + "FCKConfig.EnterMode = \'br\';\n" . 'FCKConfig.ShiftEnterMode = \'p\';', 'type' => 'text/javascript' ); diff --git a/imp/mailbox.php b/imp/mailbox.php index b7998c9b4..2775dc276 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -12,7 +12,7 @@ * @author Michael Slusarz */ -function _outputSummaries($msgs, $mbox) +function _outputSummaries($msgs) { static $template; @@ -707,7 +707,7 @@ while (list(,$ob) = each($mbox_info['overview'])) { if ($search_mbox) { if (empty($lastMbox) || ($ob['mailbox'] != $lastMbox)) { if (!empty($lastMbox)) { - _outputSummaries($msgs, $lastMbox); + _outputSummaries($msgs); $msgs = array(); } $folder_link = Horde::url(Horde_Util::addParameter('mailbox.php', 'mailbox', $ob['mailbox'])); @@ -858,7 +858,7 @@ while (list(,$ob) = each($mbox_info['overview'])) { $msgs[$ob['uid']] = $msg; } -_outputSummaries($msgs, $lastMbox); +_outputSummaries($msgs); /* Prepare the message footers template. */ $mf_template = new Horde_Template(); diff --git a/imp/message.php b/imp/message.php index 8acb8285d..cc3ece3a2 100644 --- a/imp/message.php +++ b/imp/message.php @@ -303,12 +303,12 @@ $xpriority = $mime_headers->getValue('x-priority'); switch ($imp_ui->getXpriority($xpriority)) { case 'high': $basic_headers['priority'] = _("Priority"); - $display_headers['priority'] = '

' . ' ' . $xpriority; + $display_headers['priority'] = '
 ' . $xpriority; break; case 'low': $basic_headers['priority'] = _("Priority"); - $display_headers['priority'] = '
' . ' ' . $xpriority; + $display_headers['priority'] = '
 ' . $xpriority; break; } diff --git a/imp/pgp.php b/imp/pgp.php index 94553c981..8115f1f88 100644 --- a/imp/pgp.php +++ b/imp/pgp.php @@ -376,7 +376,7 @@ if ($prefs->getValue('use_pgp')) { $t->set('personalkey-create-email-help', Horde_Help::link('imp', 'pgp-personalkey-create-email')); $t->set('personalkey-create-keylength-help', Horde_Help::link('imp', 'pgp-personalkey-create-keylength')); $t->set('personalkey-create-passphrase-help', Horde_Help::link('imp', 'pgp-personalkey-create-passphrase')); - $t->set('keygen', addslashes(_("Key generation may take a long time to complete. Continue with key generation?"))); + $t->set('keygen', addslashes(_("Key generation may take a long time to complete. Continue with key generation?"))); $t->set('personal_import_url', Horde_Util::addParameter($selfURL, 'actionID', 'import_personal_public_key')); $t->set('personalkey-create-actions-help', Horde_Help::link('imp', 'pgp-personalkey-create-actions')); } diff --git a/imp/test.php b/imp/test.php index 48a00baa5..eee06f564 100644 --- a/imp/test.php +++ b/imp/test.php @@ -94,7 +94,7 @@ function _doConnectionTest() function _errorMsg($e) { - echo 'ERROR - The server returned the following error message:' . "\n" . + echo "ERROR - The server returned the following error message:\n" . '
' . $e->getMessage() . '

'; } diff --git a/imp/view.php b/imp/view.php index d5c466523..6bbe31b79 100644 --- a/imp/view.php +++ b/imp/view.php @@ -122,7 +122,7 @@ case 'download_render': case 'download_attach': $mime = $contents->getMIMEPart($id); if (!$name = $mime->getName(true)) { - $name = _("unnamed"); + $name = _("unnamed"); } /* Compress output? */ @@ -144,7 +144,7 @@ case 'download_render': $body = $render[$key]['data']; $type = $render[$key]['type']; if (!$name = $render[$key]['name']) { - $name = _("unnamed"); + $name = _("unnamed"); } break; } -- 2.11.0