PHPDoc fixes

This commit is contained in:
Aleksander Machniak
2021-02-28 11:58:27 +01:00
parent 1f64c0c629
commit 5ac44fd4ed
23 changed files with 172 additions and 89 deletions

View File

@@ -1,22 +1,21 @@
#!/bin/sh
set -e
set -x
TITLE="Roundcube Webmail"
PACKAGES="Webmail"
BIN_PHPDOC=`/usr/bin/which phpdoc`
if [ ! -x "$BIN_PHPDOC" ]
then
echo "phpdoc not found"
exit 1
fi
INSTALL_PATH="`dirname $0`/.."
PATH_PROJECT=$INSTALL_PATH/program/include
PATH_FRAMEWORK=$INSTALL_PATH/program/lib/Roundcube
PATH_DOCS=$INSTALL_PATH/doc/phpdoc
BIN_PHPDOC="`/usr/bin/which phpdoc`"
if [ ! -x "$BIN_PHPDOC" ]
then
echo "phpdoc not found: $BIN_PHPDOC"
exit 1
fi
TITLE="Roundcube Webmail"
PACKAGES="Webmail"
OUTPUTFORMAT=HTML
TEMPLATE=responsive-twig

View File

@@ -20,7 +20,7 @@
*/
/**
* Interface class for accessing APC cache
* Interface implementation class for accessing APC cache
*
* @package Framework
* @subpackage Cache
@@ -36,9 +36,7 @@ class rcube_cache_apc extends rcube_cache
/**
* Object constructor.
*
* @see rcube_cache::__construct()
* {@inheritdoc}
*/
public function __construct($userid, $prefix = '', $ttl = 0, $packed = true, $indexed = false)
{

View File

@@ -20,7 +20,7 @@
*/
/**
* Interface class for accessing SQL Database cache
* Interface implementation class for accessing SQL Database cache
*
* @package Framework
* @subpackage Cache
@@ -41,13 +41,9 @@ class rcube_cache_db extends rcube_cache
*/
protected $table;
protected $existing = [];
/**
* Object constructor.
*
* @see rcube_cache::__construct()
* {@inheritdoc}
*/
public function __construct($userid, $prefix = '', $ttl = 0, $packed = true, $indexed = false)
{
@@ -112,7 +108,6 @@ class rcube_cache_db extends rcube_cache
}
$this->db->reset();
$this->existing[] = $key;
}
if (!$this->indexed) {

View File

@@ -20,7 +20,7 @@
*/
/**
* Interface class for accessing Memcache cache
* Interface implementation class for accessing Memcache cache
*
* @package Framework
* @subpackage Cache
@@ -36,9 +36,7 @@ class rcube_cache_memcache extends rcube_cache
/**
* Object constructor.
*
* @see rcube_cache::__construct()
* {@inheritdoc}
*/
public function __construct($userid, $prefix = '', $ttl = 0, $packed = true, $indexed = false)
{

View File

@@ -20,7 +20,7 @@
*/
/**
* Interface class for accessing Memcached cache
* Interface implementation class for accessing Memcached cache
*
* @package Framework
* @subpackage Cache
@@ -36,9 +36,7 @@ class rcube_cache_memcached extends rcube_cache
/**
* Object constructor.
*
* @see rcube_cache::__construct()
* {@inheritdoc}
*/
public function __construct($userid, $prefix = '', $ttl = 0, $packed = true, $indexed = false)
{

View File

@@ -20,7 +20,7 @@
*/
/**
* Interface class for accessing Redis cache
* Interface implementation class for accessing Redis cache
*
* @package Framework
* @subpackage Cache
@@ -36,9 +36,7 @@ class rcube_cache_redis extends rcube_cache
/**
* Object constructor.
*
* @see rcube_cache::__construct()
* {@inheritdoc}
*/
public function __construct($userid, $prefix = '', $ttl = 0, $packed = true, $indexed = false)
{

View File

@@ -30,11 +30,7 @@ class rcube_db_mssql extends rcube_db
public $db_provider = 'mssql';
/**
* Object constructor
*
* @param string $db_dsnw DSN for read/write operations
* @param string $db_dsnr Optional DSN for read only operations
* @param bool $pconn Enables persistent connections
* {@inheritdoc}
*/
public function __construct($db_dsnw, $db_dsnr = '', $pconn = false)
{

View File

@@ -31,11 +31,7 @@ class rcube_db_mysql extends rcube_db
public $db_provider = 'mysql';
/**
* Object constructor
*
* @param string $db_dsnw DSN for read/write operations
* @param string $db_dsnr Optional DSN for read only operations
* @param bool $pconn Enables persistent connections
* {@inheritdoc}
*/
public function __construct($db_dsnw, $db_dsnr = '', $pconn = false)
{

View File

@@ -42,11 +42,7 @@ class rcube_db_pgsql extends rcube_db
];
/**
* Object constructor
*
* @param string $db_dsnw DSN for read/write operations
* @param string $db_dsnr Optional DSN for read only operations
* @param bool $pconn Enables persistent connections
* {@inheritdoc}
*/
public function __construct($db_dsnw, $db_dsnr = '', $pconn = false)
{

View File

@@ -168,7 +168,7 @@ class rcube
/**
* Get global handle for memcache access
*
* @return object Memcache
* @return Memcache The memcache engine
*/
public function get_memcache()
{
@@ -182,7 +182,7 @@ class rcube
/**
* Get global handle for memcached access
*
* @return object Memcached
* @return Memcached The memcached engine
*/
public function get_memcached()
{
@@ -196,7 +196,7 @@ class rcube
/**
* Get global handle for redis access
*
* @return object Redis
* @return Redis The redis engine
*/
public function get_redis()
{

View File

@@ -108,8 +108,10 @@ abstract class rcube_addressbook
*/
public $vcard_map = [];
/** @var array Error state - hash array with the following fields: type, message */
protected $error;
/**
* Returns addressbook name (e.g. for addressbooks listing)
* @return string
@@ -414,9 +416,13 @@ abstract class rcube_addressbook
/**
* Setter for the current group
* (empty, has to be re-implemented by extending class)
*
* @param string|int $group_id A group identifier
*/
function set_group($group_id) { }
function set_group($group_id)
{
// empty for address books don't supporting groups
}
/**
* List all active contact groups of this source

View File

@@ -29,7 +29,11 @@
*/
class rcube_charset
{
// Aliases: some of them from HTML5 spec.
/**
* Character set aliases (some of them from HTML5 spec.)
*
* @var array
*/
static public $aliases = [
'USASCII' => 'WINDOWS-1252',
'ANSIX31101983' => 'WINDOWS-1252',

View File

@@ -27,6 +27,7 @@ class rcube_config
{
const DEFAULT_SKIN = 'elastic';
/** @var string A skin configured in the config file (before being replaced by a user preference) */
public $system_skin = 'elastic';
private $env = '';
@@ -101,9 +102,7 @@ class rcube_config
}
/**
* @brief Guess the type the string may fit into.
*
* Look inside the string to determine what type might be best as a container.
* Looks inside the string to determine what type might be best as a container.
*
* @param string $value The value to inspect
*
@@ -129,9 +128,7 @@ class rcube_config
}
/**
* @brief Parse environment variable into PHP type.
*
* Perform an appropriate parsing of the string to create the desired PHP type.
* Parse environment variable into PHP type.
*
* @param string $string String to parse into PHP type
* @param string $type Type of value to return
@@ -164,7 +161,7 @@ class rcube_config
}
/**
* @brief Get environment variable value.
* Get environment variable value.
*
* Retrieve an environment variable's value or if it's not found, return the
* provided default value.

View File

@@ -377,10 +377,14 @@ class rcube_csv2vcard
],
];
/** @var array Localized labels map */
protected $local_label_map = [];
protected $vcards = [];
protected $map = [];
/** @var rcube_vcard[] List of contacts as vCards */
protected $vcards = [];
/** @var array Field mapping */
protected $map = [];
/**
@@ -408,8 +412,9 @@ class rcube_csv2vcard
/**
* Import contacts from CSV file
*
* @param string $csv Content of the CSV file
* @param bool $dry_run Generate automatic field mapping
* @param string $csv Content of the CSV file
* @param bool $dry_run Generate automatic field mapping
* @param bool $skip_head Skip header line
*
* @return array Field mapping info (dry run only)
*/
@@ -527,7 +532,7 @@ class rcube_csv2vcard
/**
* Parse CSV header line, detect fields mapping
*
* @param array $elements Array of field names from a first line in CSV file
* @param array $lines One or two header lines in CSV file
*/
protected function parse_header($lines)
{

View File

@@ -27,13 +27,12 @@
*/
class rcube_image
{
private $image_file;
const TYPE_GIF = 1;
const TYPE_JPG = 2;
const TYPE_PNG = 3;
const TYPE_TIF = 4;
/** @var array Image file type to extension map */
public static $extensions = [
self::TYPE_GIF => 'gif',
self::TYPE_JPG => 'jpg',
@@ -41,6 +40,9 @@ class rcube_image
self::TYPE_TIF => 'tif',
];
/** @var string Image file location */
private $image_file;
/**
* Class constructor

View File

@@ -26,15 +26,26 @@
*/
class rcube_imap_search
{
/** @var array IMAP connection options */
public $options = [];
protected $jobs = [];
/** @var rcube_imap_search_job[] Search jobs */
protected $jobs = [];
/** @var int Time limit in seconds */
protected $timelimit = 0;
/** @var array Search results */
protected $results;
/** @var rcube_imap_generic IMAP connection object */
protected $conn;
/**
* Default constructor
*
* @param array $options IMAP connection options
* @param rcube_imap_generic $conn IMAP connection object
*/
public function __construct($options, $conn)
{
@@ -45,11 +56,11 @@ class rcube_imap_search
/**
* Invoke search request to IMAP server
*
* @param array $folders List of IMAP folders to search in
* @param string $str Search criteria
* @param string $charset Search charset
* @param string $sort_field Header field to sort by
* @param bool $threading True if threaded listing is active
* @param array $folders List of IMAP folders to search in
* @param string $str Search criteria
* @param string $charset Search charset
* @param string $sort_field Header field to sort by
* @param bool $threading True if threaded listing is active
*/
public function exec($folders, $str, $charset = null, $sort_field = null, $threading = null)
{
@@ -88,6 +99,8 @@ class rcube_imap_search
/**
* Setter for timelimt property
*
* @param int $seconds Limit in seconds
*/
public function set_timelimit($seconds)
{
@@ -96,6 +109,8 @@ class rcube_imap_search
/**
* Setter for previous (potentially incomplete) search results
*
* @param array $res Search result
*/
public function set_results($res)
{
@@ -103,8 +118,9 @@ class rcube_imap_search
}
/**
* Get connection to the IMAP server
* (used for single-thread mode)
* Get connection to the IMAP server (used for single-thread mode)
*
* @return rcube_imap_generic IMAP connection object
*/
public function get_imap()
{
@@ -118,15 +134,36 @@ class rcube_imap_search
*/
class rcube_imap_search_job /* extends Stackable */
{
/** @var rcube_imap_search The job worker */
public $worker;
/** @var string IMAP folder to search in */
private $folder;
/** @var string Search criteria */
private $search;
/** @var string Search charset */
private $charset;
/** @var string Header field to sort by */
private $sort_field;
/** @var bool True if threaded listing is active */
private $threading;
/** @var rcube_result_index|rcube_result_thread Search result */
private $result;
/**
* Class constructor
*
* @param string $folder IMAP folder to search in
* @param string $str Search criteria
* @param string $charset Search charset
* @param string $sort_field Header field to sort by
* @param bool $threading True if threaded listing is active
*/
public function __construct($folder, $str, $charset = null, $sort_field = null, $threading = false)
{
$this->folder = $folder;
@@ -139,6 +176,9 @@ class rcube_imap_search_job /* extends Stackable */
$this->result->incomplete = true;
}
/**
* Executes the IMAP search
*/
public function run()
{
$this->result = $this->search_index();
@@ -146,6 +186,8 @@ class rcube_imap_search_job /* extends Stackable */
/**
* Copy of rcube_imap::search_index()
*
* @return rcube_result_index|rcube_result_thread Search result
*/
protected function search_index()
{
@@ -212,6 +254,11 @@ class rcube_imap_search_job /* extends Stackable */
return $messages;
}
/**
* Return the saved search set as a array
*
* @return array Search set
*/
public function get_search_set()
{
return [
@@ -223,6 +270,11 @@ class rcube_imap_search_job /* extends Stackable */
];
}
/**
* Returns the search result.
*
* @return rcube_result_index|rcube_result_thread Search result
*/
public function get_result()
{
return $this->result;

View File

@@ -187,7 +187,11 @@ class rcube_message_header
*/
public $flags = [];
// map header to rcube_message_header object property
/**
* Header name to rcube_message_header object property map
*
* @var array
*/
private $obj_headers = [
'date' => 'date',
'from' => 'from',
@@ -212,6 +216,11 @@ class rcube_message_header
/**
* Returns header value
*
* @param string $name Header name
* @param bool $decode Decode the header content
*
* @param string|null Header content
*/
public function get($name, $decode = true)
{
@@ -243,6 +252,9 @@ class rcube_message_header
/**
* Sets header value
*
* @param string $name Header name
* @param string $value Header content
*/
public function set($name, $value)
{
@@ -259,7 +271,7 @@ class rcube_message_header
/**
* Factory method to instantiate headers from a data array
*
* @param array $arr Hash array with header values
* @param array $arr Hash array with header values
*
* @return rcube_message_header instance filled with headers values
*/
@@ -283,6 +295,7 @@ class rcube_message_header
*/
class rcube_message_header_sorter
{
/** @var array Message UIDs */
private $uids = [];

View File

@@ -42,6 +42,8 @@ class rcube_result_multifolder
/**
* Object constructor.
*
* @param array $folders List of IMAP folders
*/
public function __construct($folders = [])
{
@@ -52,7 +54,7 @@ class rcube_result_multifolder
/**
* Initializes object with SORT command response
*
* @param string $data IMAP response string
* @param rcube_result_index|rcube_result_thread Search result
*/
public function add($result)
{
@@ -68,6 +70,8 @@ class rcube_result_multifolder
/**
* Append message UIDs from the given result to our index
*
* @param rcube_result_index|rcube_result_thread Search result
*/
protected function append_result($result)
{
@@ -82,6 +86,10 @@ class rcube_result_multifolder
/**
* Store a global index of (sorted) message UIDs
*
* @param
* @param string $sort_field Header field to sort by
* @param string $sort_order Sort order
*/
public function set_message_index($headers, $sort_field, $sort_order)
{
@@ -157,6 +165,7 @@ class rcube_result_multifolder
* @param int $msgid Message ID
* @param bool $get_index When enabled element's index will be returned.
* Elements are indexed starting with 0
*
* @return mixed False if message ID doesn't exist, True if exists or
* index of the element if $get_index=true
*/
@@ -240,7 +249,7 @@ class rcube_result_multifolder
/**
* Return result element at specified index
*
* @param int|string $index Element's index or "FIRST" or "LAST"
* @param int|string $idx Element's index or "FIRST" or "LAST"
*
* @return int Element value
*/
@@ -304,9 +313,11 @@ class rcube_result_multifolder
return $this->count();
}
/* Serialize magic methods */
/**
* Serialization __sleep handler
*
* @return array Names of all object properties that should be serialized
*/
public function __sleep()
{
$this->sdata = ['incomplete' => [], 'error' => []];
@@ -323,6 +334,9 @@ class rcube_result_multifolder
return ['sdata', 'index', 'folders', 'sorting', 'order'];
}
/**
* Serialization __wakeup handler
*/
public function __wakeup()
{
$this->meta = ['count' => count($this->index)];

View File

@@ -28,9 +28,13 @@
*/
class rcube_session_db extends rcube_session
{
/** @var rcube_db Database handler */
private $db;
/** @var string Session table name (quoted) */
private $table_name;
/**
* Object constructor
*

View File

@@ -28,9 +28,13 @@
*/
class rcube_session_memcache extends rcube_session
{
/** @var Memcache The memcache driver */
private $memcache;
/** @var bool Debug state */
private $debug;
/**
* Object constructor
*

View File

@@ -28,9 +28,13 @@
*/
class rcube_session_memcached extends rcube_session
{
/** @var Memcached The memcache driver */
private $memcache;
/** @var bool Debug state */
private $debug;
/**
* Object constructor
*

View File

@@ -26,8 +26,8 @@
* @package Framework
* @subpackage Core
*/
class rcube_session_php extends rcube_session {
class rcube_session_php extends rcube_session
{
/**
* Native php sessions don't need a save handler.
* We do need to define abstract function implementations but they are not used.

View File

@@ -24,11 +24,15 @@
* @package Framework
* @subpackage Core
*/
class rcube_session_redis extends rcube_session {
class rcube_session_redis extends rcube_session
{
/** @var Redis The redis engine */
private $redis;
/** @var bool Debug state */
private $debug;
/**
* Object constructor
*