[feature/avatars] Even more fixes to docblocks

PHPBB3-10018
This commit is contained in:
Marc Alexander 2012-11-25 21:14:05 +01:00
parent 6522190ff1
commit f851d763f9
7 changed files with 65 additions and 61 deletions

View file

@ -21,53 +21,57 @@ if (!defined('IN_PHPBB'))
*/ */
abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
{ {
/**
* Avatar driver name
* @var string
*/
protected $name; protected $name;
/** /**
* Current board configuration * Current board configuration
* @type phpbb_config * @var phpbb_config
*/ */
protected $config; protected $config;
/** /**
* Request object * Request object
* @type phpbb_request * @var phpbb_request
*/ */
protected $request; protected $request;
/** /**
* Current $phpbb_root_path * Current $phpbb_root_path
* @type string * @var string
*/ */
protected $phpbb_root_path; protected $phpbb_root_path;
/** /**
* Current $php_ext * Current $php_ext
* @type string * @var string
*/ */
protected $php_ext; protected $php_ext;
/** /**
* A cache driver * Cache driver
* @type phpbb_cache_driver_interface * @var phpbb_cache_driver_interface
*/ */
protected $cache; protected $cache;
/** /**
* This flag should be set to true if the avatar requires a nonstandard image * This flag should be set to true if the avatar requires a nonstandard image
* tag, and will generate the html itself. * tag, and will generate the html itself.
* @type boolean * @var boolean
*/ */
public $custom_html = false; public $custom_html = false;
/** /**
* Construct a driver object * Construct a driver object
* *
* @param phpbb_config $config The phpBB configuration * @param phpbb_config $config phpBB configuration
* @param phpbb_request $request The request object * @param phpbb_request $request Request object
* @param string $phpbb_root_path The path to the phpBB root * @param string $phpbb_root_path Path to the phpBB root
* @param string $php_ext The php file extension * @param string $php_ext PHP file extension
* @param phpbb_cache_driver_interface $cache A cache driver * @param phpbb_cache_driver_interface $cache Cache driver
*/ */
public function __construct(phpbb_config $config, phpbb_request $request, $phpbb_root_path, $php_ext, phpbb_cache_driver_interface $cache = null) public function __construct(phpbb_config $config, phpbb_request $request, $phpbb_root_path, $php_ext, phpbb_cache_driver_interface $cache = null)
{ {
@ -100,7 +104,7 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
/** /**
* @inheritdoc * @inheritdoc
**/ */
public function prepare_form($template, $row, &$error) public function prepare_form($template, $row, &$error)
{ {
return false; return false;
@ -108,7 +112,7 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
/** /**
* @inheritdoc * @inheritdoc
**/ */
public function prepare_form_acp() public function prepare_form_acp()
{ {
return array(); return array();
@ -116,7 +120,7 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
/** /**
* @inheritdoc * @inheritdoc
**/ */
public function process_form($template, $row, &$error) public function process_form($template, $row, &$error)
{ {
return false; return false;
@ -124,7 +128,7 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
/** /**
* @inheritdoc * @inheritdoc
**/ */
public function delete($row) public function delete($row)
{ {
return true; return true;
@ -132,7 +136,7 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
/** /**
* @inheritdoc * @inheritdoc
**/ */
public function is_enabled() public function is_enabled()
{ {
$driver = preg_replace('#^phpbb_avatar_driver_#', '', get_class($this)); $driver = preg_replace('#^phpbb_avatar_driver_#', '', get_class($this));
@ -142,7 +146,7 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
/** /**
* @inheritdoc * @inheritdoc
**/ */
public function get_template_name() public function get_template_name()
{ {
$driver = preg_replace('#^phpbb_avatar_driver_#', '', get_class($this)); $driver = preg_replace('#^phpbb_avatar_driver_#', '', get_class($this));
@ -162,7 +166,7 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
/** /**
* Sets the name of the driver. * Sets the name of the driver.
* *
* @param string $name The driver name * @param string $name Driver name
*/ */
public function set_name($name) public function set_name($name)
{ {

View file

@ -78,7 +78,7 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver
/** /**
* @inheritdoc * @inheritdoc
**/ */
public function prepare_form_acp() public function prepare_form_acp()
{ {
return array( return array(
@ -170,7 +170,7 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver
/** /**
* Build gravatar URL for output on page * Build gravatar URL for output on page
* *
* @return string The gravatar URL * @return string Gravatar URL
*/ */
protected function get_gravatar_url($row) protected function get_gravatar_url($row)
{ {

View file

@ -43,7 +43,7 @@ interface phpbb_avatar_driver_interface
* Returns custom html for displaying this avatar. * Returns custom html for displaying this avatar.
* Only called if $custom_html is true. * Only called if $custom_html is true.
* *
* @param $ignore_config Whether this function should respect the users prefs * @param bool $ignore_config Whether this function should respect the users prefs
* and board configuration configuration option, or should just render * and board configuration configuration option, or should just render
* the avatar anyways. Useful for the ACP. * the avatar anyways. Useful for the ACP.
* @return string HTML * @return string HTML
@ -53,56 +53,56 @@ interface phpbb_avatar_driver_interface
/** /**
* Prepare form for changing the settings of this avatar * Prepare form for changing the settings of this avatar
* *
* @param object $template The template object * @param object $template Template object
* @param array $row The user data or group data that has been cleaned with * @param array $row User data or group data that has been cleaned with
* phpbb_avatar_manager::clean_row * phpbb_avatar_manager::clean_row
* @param array &$error The reference to an error array * @param array &$error Reference to an error array
* *
* @return bool Returns true if form has been successfully prepared * @return bool True if form has been successfully prepared
**/ */
public function prepare_form($template, $row, &$error); public function prepare_form($template, $row, &$error);
/** /**
* Prepare form for changing the acp settings of this avatar * Prepare form for changing the acp settings of this avatar
* *
* @return array Return the array containing the acp settings * @return array Array containing the acp settings
**/ */
public function prepare_form_acp(); public function prepare_form_acp();
/** /**
* Process form data * Process form data
* *
* @param object $template The template object * @param object $template Template object
* @param array $row The user data or group data that has been cleaned with * @param array $row User data or group data that has been cleaned with
* phpbb_avatar_manager::clean_row * phpbb_avatar_manager::clean_row
* @param array &$error The reference to an error array * @param array &$error Reference to an error array
* *
* @return array An array containing the avatar data as follows: * @return array Array containing the avatar data as follows:
* ['avatar'], ['avatar_width'], ['avatar_height'] * ['avatar'], ['avatar_width'], ['avatar_height']
**/ */
public function process_form($template, $row, &$error); public function process_form($template, $row, &$error);
/** /**
* Delete avatar * Delete avatar
* *
* @param array $row The user data or group data that has been cleaned with * @param array $row User data or group data that has been cleaned with
* phpbb_avatar_manager::clean_row * phpbb_avatar_manager::clean_row
* *
* @return bool True if avatar has been deleted or there is no need to delete * @return bool True if avatar has been deleted or there is no need to delete
**/ */
public function delete($row); public function delete($row);
/** /**
* Check if avatar is enabled * Check if avatar is enabled
* *
* @return bool True if avatar is enabled, false if it's disabled * @return bool True if avatar is enabled, false if it's disabled
**/ */
public function is_enabled(); public function is_enabled();
/** /**
* Get the avatars template name * Get the avatars template name
* *
* @return string The avatars template name * @return string Avatar's template name
**/ */
public function get_template_name(); public function get_template_name();
} }

View file

@ -114,7 +114,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
/** /**
* @inheritdoc * @inheritdoc
**/ */
public function prepare_form_acp() public function prepare_form_acp()
{ {
return array( return array(
@ -148,7 +148,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
/** /**
* Get a list of avatars that are locally available * Get a list of avatars that are locally available
* *
* @return array An array containing the locally available avatars * @return array Array containing the locally available avatars
*/ */
protected function get_avatar_list() protected function get_avatar_list()
{ {

View file

@ -60,7 +60,7 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
/** /**
* @inheritdoc * @inheritdoc
**/ */
public function prepare_form_acp() public function prepare_form_acp()
{ {
return array( return array(

View file

@ -124,7 +124,7 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver
/** /**
* @inheritdoc * @inheritdoc
**/ */
public function prepare_form_acp() public function prepare_form_acp()
{ {
global $user; global $user;

View file

@ -32,14 +32,14 @@ class phpbb_avatar_manager
/** /**
* Construct an avatar manager object * Construct an avatar manager object
* *
* @param $phpbb_root_path The path to the phpBB root * @param string $phpbb_root_path Path to the phpBB root
* @param $phpEx The php file extension * @param string $phpEx PHP file extension
* @param $config The phpBB configuration * @param phpbb_config $config phpBB configuration
* @param $request The request object * @param phpbb_request $request Request object
* @param $cache A cache driver * @param phpbb_cache_driver_interface $cache Cache driver
* @param $avatar_drivers The avatars drivers passed via the service container * @param array $avatar_drivers Avatar drivers passed via the service container
* @param $container The container object * @param object $container Container object
**/ */
public function __construct($phpbb_root_path, $phpEx, phpbb_config $config, phpbb_request $request, phpbb_cache_driver_interface $cache, $avatar_drivers, $container) public function __construct($phpbb_root_path, $phpEx, phpbb_config $config, phpbb_request $request, phpbb_cache_driver_interface $cache, $avatar_drivers, $container)
{ {
$this->phpbb_root_path = $phpbb_root_path; $this->phpbb_root_path = $phpbb_root_path;
@ -54,10 +54,10 @@ class phpbb_avatar_manager
/** /**
* Get the driver object specified by the avatar type * Get the driver object specified by the avatar type
* *
* @param string The avatar type; by default an avatar's service container name * @param string Avatar type; by default an avatar's service container name
* *
* @return object The avatar driver object * @return object Avatar driver object
**/ */
public function get_driver($avatar_type) public function get_driver($avatar_type)
{ {
if (self::$valid_drivers === false) if (self::$valid_drivers === false)
@ -101,7 +101,7 @@ class phpbb_avatar_manager
/** /**
* Load the list of valid drivers * Load the list of valid drivers
* This is executed once and fills self::$valid_drivers * This is executed once and fills self::$valid_drivers
**/ */
protected function load_valid_drivers() protected function load_valid_drivers()
{ {
if (!empty($this->avatar_drivers)) if (!empty($this->avatar_drivers))
@ -117,8 +117,8 @@ class phpbb_avatar_manager
/** /**
* Get a list of valid avatar drivers * Get a list of valid avatar drivers
* *
* @return array An array containing a list of the valid avatar drivers * @return array Array containing a list of the valid avatar drivers
**/ */
public function get_valid_drivers() public function get_valid_drivers()
{ {
if (self::$valid_drivers === false) if (self::$valid_drivers === false)
@ -132,11 +132,11 @@ class phpbb_avatar_manager
/** /**
* Strip out user_ and group_ prefixes from keys * Strip out user_ and group_ prefixes from keys
* *
* @param array $row The user data or group data * @param array $row User data or group data
* *
* @return array The user data or group data with keys that have been * @return array User data or group data with keys that have been
* stripped from the preceding "user_" or "group_" * stripped from the preceding "user_" or "group_"
**/ */
public static function clean_row($row) public static function clean_row($row)
{ {
$keys = array_keys($row); $keys = array_keys($row);