Skip to content

Commit

Permalink
Fix some phpstan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Jan 28, 2024
1 parent d363a6a commit 9e5c019
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 27 deletions.
20 changes: 0 additions & 20 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,6 @@ parameters:
count: 1
path: plugins/subscriptions_option/subscriptions_option.php

-
message: "#^Method rcube_storage\\:\\:index\\(\\) invoked with 4 parameters, 0\\-3 required\\.$#"
count: 1
path: plugins/zipdownload/zipdownload.php

-
message: "#^Call to an undefined method object\\:\\:get_group\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -690,11 +685,6 @@ parameters:
count: 1
path: program/lib/Roundcube/rcube_imap_generic.php

-
message: "#^Static method rcube_utils\\:\\:proxy_protocol_header\\(\\) invoked with 2 parameters, 0\\-1 required\\.$#"
count: 1
path: program/lib/Roundcube/rcube_imap_generic.php

-
message: "#^Undefined variable\\: \\$otoken$#"
count: 2
Expand Down Expand Up @@ -735,16 +725,6 @@ parameters:
count: 1
path: program/lib/Roundcube/rcube_ldap.php

-
message: "#^Method rcube\\:\\:url\\(\\) invoked with 4 parameters, 1 required\\.$#"
count: 1
path: program/lib/Roundcube/rcube_message.php

-
message: "#^Method rcube_storage\\:\\:get_message_part\\(\\) invoked with 8 parameters, 1\\-6 required\\.$#"
count: 3
path: program/lib/Roundcube/rcube_message.php

-
message: "#^Static method rcube_utils\\:\\:explode\\(\\) invoked with 3 parameters, 2 required\\.$#"
count: 1
Expand Down
10 changes: 7 additions & 3 deletions program/lib/Roundcube/rcube.php
Original file line number Diff line number Diff line change
Expand Up @@ -1065,13 +1065,17 @@ public function check_request($mode = rcube_utils::INPUT_POST)
}

/**
* Build a valid URL to this instance of Roundcube
* Build a valid URL to this instance of Roundcube.
*
* @param mixed $p Either a string with the action or url parameters as key-value pairs
* @param mixed $p Either a string with the action or
* url parameters as key-value pairs
* @param bool $absolute Build a URL absolute to document root
* @param bool $full Create fully qualified URL including http(s):// and hostname
* @param bool $secure Return absolute URL in secure location
*
* @return string Valid application URL
*/
public function url($p)
public function url($p, $absolute = false, $full = false, $secure = false)
{
// STUB: should be overloaded by the application
return '';
Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube_imap_generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ protected function _connect($host)

// insert proxy protocol header, if enabled
if (!empty($this->prefs['socket_options'])) {
$proxy_protocol_header = rcube_utils::proxy_protocol_header($this->prefs['socket_options'], $this->fp);
$proxy_protocol_header = rcube_utils::proxy_protocol_header($this->prefs['socket_options']);
if (strlen($proxy_protocol_header) > 0) {
fwrite($this->fp, $proxy_protocol_header);
}
Expand Down
11 changes: 8 additions & 3 deletions program/lib/Roundcube/rcube_storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,12 @@ abstract public function list_messages($folder = null, $page = null, $sort_field
* @param string $folder Folder to get index from
* @param string $sort_field Sort column
* @param string $sort_order Sort order [ASC, DESC]
* @param bool $no_threads Get not threaded index
* @param bool $no_search Get index not limited to search result (optionally)
*
* @return rcube_result_index|rcube_result_thread List of messages (UIDs)
*/
abstract public function index($folder = null, $sort_field = null, $sort_order = null);
abstract public function index($folder = null, $sort_field = null, $sort_order = null, $no_threads = false, $no_search = false);

/**
* Invoke search request to the server.
Expand Down Expand Up @@ -455,18 +457,21 @@ abstract public function get_message($uid, $folder = null);
abstract public function get_message_headers($uid, $folder = null, $force = false);

/**
* Fetch message body of a specific message from the server
* Fetch message body of a specific message from the server.
*
* @param int $uid Message UID
* @param string $part Part number
* @param rcube_message_part $o_part Part object created by get_structure()
* @param mixed $print True to print part, resource to write part contents in
* @param resource $fp File pointer to save the message part
* @param bool $skip_charset_conv Disables charset conversion
* @param int $max_bytes Only read this number of bytes
* @param bool $formatted Enables formatting of text/* parts bodies
*
* @return string|true|null Message/part body if not printed
*/
abstract public function get_message_part($uid, $part = 1, $o_part = null, $print = null, $fp = null, $skip_charset_conv = false);
abstract public function get_message_part($uid, $part = 1, $o_part = null, $print = null, $fp = null,
$skip_charset_conv = false, $max_bytes = 0, $formatted = true);

/**
* Fetch message body of a specific message from the server
Expand Down

0 comments on commit 9e5c019

Please sign in to comment.