Skip to content

Commit

Permalink
Replace deprecated methods use
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Jan 27, 2024
1 parent c47484c commit a73a53c
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 82 deletions.
69 changes: 0 additions & 69 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ parameters:
count: 18
path: installer/test.php

-
message: """
#^Call to deprecated method get_uids\\(\\) of class rcmail\\:
since 1\\.5\\-beta, use rcmail_action\\:\\:get_uids\\(\\)$#
"""
count: 1
path: plugins/archive/archive.php

-
message: "#^Access to an undefined property rcube\\:\\:\\$task\\.$#"
count: 1
Expand Down Expand Up @@ -253,14 +245,6 @@ parameters:
count: 2
path: plugins/managesieve/managesieve.php

-
message: """
#^Call to deprecated method get_uids\\(\\) of class rcmail\\:
since 1\\.5\\-beta, use rcmail_action\\:\\:get_uids\\(\\)$#
"""
count: 1
path: plugins/managesieve/managesieve.php

-
message: "#^Call to an undefined method rcube_storage\\:\\:registerFunction\\(\\)\\.$#"
count: 1
Expand All @@ -276,14 +260,6 @@ parameters:
count: 2
path: plugins/markasjunk/markasjunk.php

-
message: """
#^Call to deprecated method get_uids\\(\\) of class rcmail\\:
since 1\\.5\\-beta, use rcmail_action\\:\\:get_uids\\(\\)$#
"""
count: 1
path: plugins/markasjunk/markasjunk.php

-
message: "#^Access to an undefined property COM\\:\\:\\$Domains\\.$#"
count: 1
Expand Down Expand Up @@ -364,19 +340,6 @@ parameters:
count: 1
path: plugins/subscriptions_option/tests/SubscriptionsOption.php

-
message: "#^Call to deprecated method get_part_content\\(\\) of class rcube_message\\.$#"
count: 1
path: plugins/vcard_attachments/vcard_attachments.php

-
message: """
#^Call to deprecated method get_uids\\(\\) of class rcmail\\:
since 1\\.5\\-beta, use rcmail_action\\:\\:get_uids\\(\\)$#
"""
count: 1
path: plugins/zipdownload/zipdownload.php

-
message: "#^Method rcube_storage\\:\\:index\\(\\) invoked with 4 parameters, 0\\-3 required\\.$#"
count: 1
Expand Down Expand Up @@ -437,27 +400,11 @@ parameters:
count: 1
path: program/actions/mail/compose.php

-
message: """
#^Call to deprecated method table_output\\(\\) of class rcmail\\:
since 1\\.5\\-beta, use rcmail_action\\:\\:table_output\\(\\)$#
"""
count: 1
path: program/actions/mail/compose.php

-
message: "#^Variable \\$to_addresses in empty\\(\\) always exists and is not falsy\\.$#"
count: 1
path: program/actions/mail/compose.php

-
message: """
#^Call to deprecated method get_uids\\(\\) of class rcmail\\:
since 1\\.5\\-beta, use rcmail_action\\:\\:get_uids\\(\\)$#
"""
count: 1
path: program/actions/mail/delete.php

-
message: "#^Access to an undefined property object\\:\\:\\$charset\\.$#"
count: 2
Expand Down Expand Up @@ -508,14 +455,6 @@ parameters:
count: 1
path: program/actions/mail/index.php

-
message: """
#^Call to deprecated method get_uids\\(\\) of class rcmail\\:
since 1\\.5\\-beta, use rcmail_action\\:\\:get_uids\\(\\)$#
"""
count: 1
path: program/actions/mail/move.php

-
message: "#^Result of method rcube_result_set\\:\\:next\\(\\) \\(void\\) is used\\.$#"
count: 2
Expand Down Expand Up @@ -661,14 +600,6 @@ parameters:
count: 1
path: program/include/rcmail_sendmail.php

-
message: """
#^Call to deprecated method get_uids\\(\\) of class rcmail\\:
since 1\\.5\\-beta, use rcmail_action\\:\\:get_uids\\(\\)$#
"""
count: 2
path: program/include/rcmail_sendmail.php

-
message: "#^Call to method getMessage\\(\\) on an unknown class PEAR_Error\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion plugins/archive/archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function move_messages()
'destinations' => [],
];

foreach (rcmail::get_uids(null, null, $multifolder, rcube_utils::INPUT_POST) as $mbox => $uids) {
foreach (rcmail_action::get_uids(null, null, $multifolder, rcube_utils::INPUT_POST) as $mbox => $uids) {
if (!$this->archive_folder || $mbox === $this->archive_folder || strpos($mbox, $archive_prefix) === 0) {
$count = count($uids);
continue;
Expand Down
2 changes: 1 addition & 1 deletion plugins/managesieve/managesieve.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function mail_headers($args)
*/
public function managesieve_actions()
{
$uids = rcmail::get_uids(null, null, $multifolder, rcube_utils::INPUT_POST);
$uids = rcmail_action::get_uids(null, null, $multifolder, rcube_utils::INPUT_POST);

// handle fetching email headers for the new filter form
if (!empty($uids)) {
Expand Down
4 changes: 2 additions & 2 deletions plugins/markasjunk/markasjunk.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ public function mark_message()
$is_spam = $this->rcube->action == 'plugin.markasjunk.junk';
$uids = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST);
$mbox_name = rcube_utils::get_input_string('_mbox', rcube_utils::INPUT_POST);
$messageset = rcmail::get_uids($uids, $mbox_name, $multifolder);
$messageset = rcmail_action::get_uids($uids, $mbox_name, $multifolder);
$dest_mbox = $is_spam ? $this->spam_mbox : $this->ham_mbox;

// special case when select all is used, uid is '*', and not in multi folder mode and we are using a driver
// rcmail::get_uids does not handle this
// rcmail_action::get_uids does not handle this
if ($uids == '*' && !$multifolder && is_object($this->driver)) {
$storage = $this->rcube->get_storage();
$result_index = $storage->index($mbox_name);
Expand Down
4 changes: 2 additions & 2 deletions plugins/vcard_attachments/vcard_attachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function message_objects($p)
$contacts = [];

foreach ($this->vcard_parts as $part) {
$vcards = rcube_vcard::import($this->message->get_part_content($part, null, true));
$vcards = rcube_vcard::import($this->message->get_part_body($part));

foreach ($vcards as $idx => $vcard) {
// skip invalid vCards
Expand Down Expand Up @@ -207,7 +207,7 @@ public function save_vcard()
}

foreach ($index as $part_id => $mime_ids) {
$part = $message->get_part_content($part_id, null, true);
$part = $message->get_part_body($part_id);

if (!empty($part) && ($part_vcards = rcube_vcard::import($part))) {
foreach ($mime_ids as $id) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/zipdownload/zipdownload.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function download_messages()
$rcmail = rcmail::get_instance();

if ($rcmail->config->get('zipdownload_selection', $this->default_limit)) {
$messageset = rcmail::get_uids(null, null, $multi, rcube_utils::INPUT_POST);
$messageset = rcmail_action::get_uids(null, null, $multi, rcube_utils::INPUT_POST);
if (count($messageset)) {
$this->_download_messages($messageset);
}
Expand Down
2 changes: 1 addition & 1 deletion program/actions/mail/compose.php
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ public static function contacts_list($attrib = [])
$rcmail->output->set_env('current_page', 0);
$rcmail->output->include_script('list.js');

return $rcmail->table_output($attrib, [], ['name'], 'ID');
return rcmail_action::table_output($attrib, [], ['name'], 'ID');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion program/actions/mail/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function run($args = [])
$rcmail->output->send();
}

foreach (rcmail::get_uids(null, null, $multifolder, rcube_utils::INPUT_POST) as $mbox => $uids) {
foreach (rcmail_action::get_uids(null, null, $multifolder, rcube_utils::INPUT_POST) as $mbox => $uids) {
$deleted += (int) $rcmail->storage->delete_message($uids, $mbox);
$count += is_array($uids) ? count($uids) : 1;
$sources[] = $mbox;
Expand Down
4 changes: 2 additions & 2 deletions program/actions/mail/move.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function run($args = [])
$old_count = $rcmail->storage->count(null, $threading ? 'THREADS' : 'ALL');
}

$target = rcube_utils::get_input_string('_target_mbox', rcube_utils::INPUT_POST, true);
$target = rcube_utils::get_input_string('_target_mbox', rcube_utils::INPUT_POST, true);

if (empty($_POST['_uid']) || !strlen($target)) {
$rcmail->output->show_message('internalerror', 'error');
Expand All @@ -51,7 +51,7 @@ public function run($args = [])
$count = 0;
$sources = [];

foreach (rcmail::get_uids(null, null, $multifolder, rcube_utils::INPUT_POST) as $mbox => $uids) {
foreach (rcmail_action::get_uids(null, null, $multifolder, rcube_utils::INPUT_POST) as $mbox => $uids) {
if ($mbox === $target) {
$count += is_array($uids) ? count($uids) : 1;
} elseif ($rcmail->storage->move_message($uids, $target, $mbox)) {
Expand Down
4 changes: 2 additions & 2 deletions program/include/rcmail_sendmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,14 @@ public function deliver_message($message, $disconnect = true)

// set replied/forwarded flag
if (!empty($this->data['reply_uid'])) {
foreach (rcmail::get_uids($this->data['reply_uid'], $this->data['mailbox']) as $mbox => $uids) {
foreach (rcmail_action::get_uids($this->data['reply_uid'], $this->data['mailbox']) as $mbox => $uids) {
// skip <UID>.<PART> replies
if (!preg_match('/^\d+\.[0-9.]+$/', implode(',', (array) $uids))) {
$this->rcmail->storage->set_flag($uids, 'ANSWERED', $mbox);
}
}
} elseif (!empty($this->data['forward_uid'])) {
foreach (rcmail::get_uids($this->data['forward_uid'], $this->data['mailbox']) as $mbox => $uids) {
foreach (rcmail_action::get_uids($this->data['forward_uid'], $this->data['mailbox']) as $mbox => $uids) {
// skip <UID>.<PART> forwards
if (!preg_match('/^\d+\.[0-9.]+$/', implode(',', (array) $uids))) {
$this->rcmail->storage->set_flag($uids, 'FORWARDED', $mbox);
Expand Down

0 comments on commit a73a53c

Please sign in to comment.