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

View file

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

View file

@ -43,7 +43,7 @@ interface phpbb_avatar_driver_interface
* Returns custom html for displaying this avatar.
* 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
* the avatar anyways. Useful for the ACP.
* @return string HTML
@ -53,56 +53,56 @@ interface phpbb_avatar_driver_interface
/**
* Prepare form for changing the settings of this avatar
*
* @param object $template The template object
* @param array $row The user data or group data that has been cleaned with
* @param object $template Template object
* @param array $row User data or group data that has been cleaned with
* 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);
/**
* 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();
/**
* Process form data
*
* @param object $template The template object
* @param array $row The user data or group data that has been cleaned with
* @param object $template Template object
* @param array $row User data or group data that has been cleaned with
* 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']
**/
*/
public function process_form($template, $row, &$error);
/**
* 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
*
* @return bool True if avatar has been deleted or there is no need to delete
**/
*/
public function delete($row);
/**
* Check if avatar is enabled
*
* @return bool True if avatar is enabled, false if it's disabled
**/
*/
public function is_enabled();
/**
* Get the avatars template name
*
* @return string The avatars template name
**/
* @return string Avatar's template name
*/
public function get_template_name();
}

View file

@ -114,7 +114,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
/**
* @inheritdoc
**/
*/
public function prepare_form_acp()
{
return array(
@ -148,7 +148,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
/**
* 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()
{

View file

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

View file

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

View file

@ -32,14 +32,14 @@ class phpbb_avatar_manager
/**
* Construct an avatar manager object
*
* @param $phpbb_root_path The path to the phpBB root
* @param $phpEx The php file extension
* @param $config The phpBB configuration
* @param $request The request object
* @param $cache A cache driver
* @param $avatar_drivers The avatars drivers passed via the service container
* @param $container The container object
**/
* @param string $phpbb_root_path Path to the phpBB root
* @param string $phpEx PHP file extension
* @param phpbb_config $config phpBB configuration
* @param phpbb_request $request Request object
* @param phpbb_cache_driver_interface $cache Cache driver
* @param array $avatar_drivers Avatar drivers passed via the service container
* @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)
{
$this->phpbb_root_path = $phpbb_root_path;
@ -54,10 +54,10 @@ class phpbb_avatar_manager
/**
* 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)
{
if (self::$valid_drivers === false)
@ -101,7 +101,7 @@ class phpbb_avatar_manager
/**
* Load the list of valid drivers
* This is executed once and fills self::$valid_drivers
**/
*/
protected function load_valid_drivers()
{
if (!empty($this->avatar_drivers))
@ -117,8 +117,8 @@ class phpbb_avatar_manager
/**
* 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()
{
if (self::$valid_drivers === false)
@ -132,11 +132,11 @@ class phpbb_avatar_manager
/**
* 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_"
**/
*/
public static function clean_row($row)
{
$keys = array_keys($row);