mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/16955] Clean up avatar classes
PHPBB3-16955
This commit is contained in:
parent
ba3a1389e6
commit
5756d4dd9b
3 changed files with 6 additions and 6 deletions
|
@ -95,7 +95,7 @@ interface driver_interface
|
|||
* an array that will be passed to vsprintf() with the language key in
|
||||
* the first array key.
|
||||
*
|
||||
* @return array Array containing the avatar data as follows:
|
||||
* @return array|false Array containing the avatar data as follows or false if processing failed:
|
||||
* ['avatar'], ['avatar_width'], ['avatar_height']
|
||||
*/
|
||||
public function process_form($request, $template, $user, $row, &$error);
|
||||
|
|
|
@ -284,6 +284,6 @@ class upload extends \phpbb\avatar\driver\driver
|
|||
*/
|
||||
protected function can_upload()
|
||||
{
|
||||
return $this->php_ini->getBool('file_uploads');
|
||||
return (bool) $this->php_ini->getBool('file_uploads');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ class manager
|
|||
|
||||
/**
|
||||
* Array that contains a list of enabled drivers
|
||||
* @var array|bool
|
||||
* @var array|false
|
||||
*/
|
||||
protected static $enabled_drivers = false;
|
||||
|
||||
|
@ -87,7 +87,7 @@ class manager
|
|||
* @param string $avatar_type Avatar type; by default an avatar's service container name
|
||||
* @param bool $load_enabled Load only enabled avatars
|
||||
*
|
||||
* @return object Avatar driver object
|
||||
* @return object|null Avatar driver object
|
||||
*/
|
||||
public function get_driver($avatar_type, $load_enabled = true)
|
||||
{
|
||||
|
@ -181,7 +181,7 @@ class manager
|
|||
$this->load_enabled_drivers();
|
||||
}
|
||||
|
||||
return self::$enabled_drivers;
|
||||
return self::$enabled_drivers ?: [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -254,7 +254,7 @@ class manager
|
|||
{
|
||||
$config_name = $driver->get_config_name();
|
||||
|
||||
return $this->config["allow_avatar_{$config_name}"];
|
||||
return (bool) $this->config["allow_avatar_{$config_name}"];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue