Update PHPDoc in mod/

This commit is contained in:
Hypolite Petovan 2019-01-07 01:07:42 -05:00
parent 3282ce5389
commit af9067a381
18 changed files with 134 additions and 69 deletions

View file

@ -62,7 +62,8 @@ function admin_init(App $a)
* return the HTML for the pages of the admin panel. * return the HTML for the pages of the admin panel.
* *
* @param App $a * @param App $a
* * @throws ImagickException
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_post(App $a) function admin_post(App $a)
{ {
@ -161,6 +162,7 @@ function admin_post(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_content(App $a) function admin_content(App $a)
{ {
@ -312,6 +314,7 @@ function admin_content(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_tos(App $a) function admin_page_tos(App $a)
{ {
@ -334,6 +337,7 @@ function admin_page_tos(App $a)
* @brief Process send data from Admin TOS Page * @brief Process send data from Admin TOS Page
* *
* @param App $a * @param App $a
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_tos_post(App $a) function admin_page_tos_post(App $a)
{ {
@ -366,6 +370,7 @@ function admin_page_tos_post(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_blocklist(App $a) function admin_page_blocklist(App $a)
{ {
@ -406,6 +411,7 @@ function admin_page_blocklist(App $a)
* @brief Process send data from Admin Blocklist Page * @brief Process send data from Admin Blocklist Page
* *
* @param App $a * @param App $a
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_blocklist_post(App $a) function admin_page_blocklist_post(App $a)
{ {
@ -450,6 +456,8 @@ function admin_page_blocklist_post(App $a)
* @brief Process data send by the contact block admin page * @brief Process data send by the contact block admin page
* *
* @param App $a * @param App $a
* @throws ImagickException
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_contactblock_post(App $a) function admin_page_contactblock_post(App $a)
{ {
@ -482,6 +490,7 @@ function admin_page_contactblock_post(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_contactblock(App $a) function admin_page_contactblock(App $a)
{ {
@ -534,6 +543,7 @@ function admin_page_contactblock(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_deleteitem(App $a) function admin_page_deleteitem(App $a)
{ {
@ -558,6 +568,7 @@ function admin_page_deleteitem(App $a)
* URLs like the full /display URL to make the process more easy for the admin. * URLs like the full /display URL to make the process more easy for the admin.
* *
* @param App $a * @param App $a
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_deleteitem_post(App $a) function admin_page_deleteitem_post(App $a)
{ {
@ -597,6 +608,7 @@ function admin_page_deleteitem_post(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_federation(App $a) function admin_page_federation(App $a)
{ {
@ -783,6 +795,7 @@ function admin_page_federation(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_queue(App $a) function admin_page_queue(App $a)
{ {
@ -825,7 +838,9 @@ function admin_page_queue(App $a)
* The returned string holds the content of the page. * The returned string holds the content of the page.
* *
* @param App $a * @param App $a
* @param $deferred
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_workerqueue(App $a, $deferred) function admin_page_workerqueue(App $a, $deferred)
{ {
@ -875,6 +890,7 @@ function admin_page_workerqueue(App $a, $deferred)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_summary(App $a) function admin_page_summary(App $a)
{ {
@ -993,6 +1009,7 @@ function admin_page_summary(App $a)
* @brief Process send data from Admin Site Page * @brief Process send data from Admin Site Page
* *
* @param App $a * @param App $a
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_site_post(App $a) function admin_page_site_post(App $a)
{ {
@ -1171,6 +1188,9 @@ function admin_page_site_post(App $a)
$relay_user_tags = !empty($_POST['relay_user_tags']); $relay_user_tags = !empty($_POST['relay_user_tags']);
$active_panel = (!empty($_POST['active_panel']) ? "#" . Strings::escapeTags(trim($_POST['active_panel'])) : ''); $active_panel = (!empty($_POST['active_panel']) ? "#" . Strings::escapeTags(trim($_POST['active_panel'])) : '');
/**
* @var $storagebackend \Friendica\Model\Storage\IStorage
*/
$storagebackend = Strings::escapeTags(trim(defaults($_POST, 'storagebackend', ''))); $storagebackend = Strings::escapeTags(trim(defaults($_POST, 'storagebackend', '')));
StorageManager::setBackend($storagebackend); StorageManager::setBackend($storagebackend);
@ -1397,6 +1417,7 @@ function admin_page_site_post(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_site(App $a) function admin_page_site(App $a)
{ {
@ -1518,6 +1539,9 @@ function admin_page_site(App $a)
/* storage backend */ /* storage backend */
$storage_backends = StorageManager::listBackends(); $storage_backends = StorageManager::listBackends();
/**
* @var $storage_current_backend \Friendica\Model\Storage\IStorage
*/
$storage_current_backend = StorageManager::getBackend(); $storage_current_backend = StorageManager::getBackend();
$storage_backends_choices = [ $storage_backends_choices = [
@ -1677,7 +1701,8 @@ function admin_page_site(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* */ * @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
function admin_page_dbsync(App $a) function admin_page_dbsync(App $a)
{ {
$o = ''; $o = '';
@ -1767,6 +1792,7 @@ function admin_page_dbsync(App $a)
* @brief Process data send by Users admin page * @brief Process data send by Users admin page
* *
* @param App $a * @param App $a
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_users_post(App $a) function admin_page_users_post(App $a)
{ {
@ -1884,6 +1910,7 @@ function admin_page_users_post(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_users(App $a) function admin_page_users(App $a)
{ {
@ -2082,6 +2109,7 @@ function admin_page_users(App $a)
* @param App $a * @param App $a
* @param array $addons_admin A list of admin addon names * @param array $addons_admin A list of admin addon names
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_addons(App $a, array $addons_admin) function admin_page_addons(App $a, array $addons_admin)
{ {
@ -2287,6 +2315,7 @@ function rebuild_theme_table($themes)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_themes(App $a) function admin_page_themes(App $a)
{ {
@ -2457,6 +2486,7 @@ function admin_page_themes(App $a)
* @brief Prosesses data send by Logs admin page * @brief Prosesses data send by Logs admin page
* *
* @param App $a * @param App $a
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_logs_post(App $a) function admin_page_logs_post(App $a)
{ {
@ -2492,6 +2522,7 @@ function admin_page_logs_post(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_logs(App $a) function admin_page_logs(App $a)
{ {
@ -2548,6 +2579,7 @@ function admin_page_logs(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_viewlogs(App $a) function admin_page_viewlogs(App $a)
{ {
@ -2591,6 +2623,7 @@ function admin_page_viewlogs(App $a)
* @brief Prosesses data send by the features admin page * @brief Prosesses data send by the features admin page
* *
* @param App $a * @param App $a
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_features_post(App $a) function admin_page_features_post(App $a)
{ {
@ -2638,6 +2671,7 @@ function admin_page_features_post(App $a)
* *
* @param App $a * @param App $a
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function admin_page_features(App $a) function admin_page_features(App $a)
{ {

View file

@ -54,6 +54,9 @@ function dfrn_request_init(App $a)
* in order to link our friend request with our own server cell. * in order to link our friend request with our own server cell.
* After logging in, we click 'submit' to approve the linkage. * After logging in, we click 'submit' to approve the linkage.
* *
* @param App $a
* @throws ImagickException
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function dfrn_request_post(App $a) function dfrn_request_post(App $a)
{ {

View file

@ -14,6 +14,8 @@ use Friendica\Object\Image;
/** /**
* @param App $a * @param App $a
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function fbrowser_content(App $a) function fbrowser_content(App $a)
{ {

View file

@ -130,6 +130,7 @@ function hovercard_content()
* @param string $root Directory of the template * @param string $root Directory of the template
* *
* @return string|bool Output the raw content if existent, otherwise false * @return string|bool Output the raw content if existent, otherwise false
* @throws Exception
*/ */
function get_template_content($template, $root = '') function get_template_content($template, $root = '')
{ {

View file

@ -910,9 +910,8 @@ function item_content(App $a)
/** /**
* This function removes the tag $tag from the text $body and replaces it with * This function removes the tag $tag from the text $body and replaces it with
* the appropiate link. * the appropriate link.
* *
* @param App $a Application instance @TODO is unused in this function's scope (excluding included files)
* @param string $body the text to replace the tag in * @param string $body the text to replace the tag in
* @param string $inform a comma-seperated string containing everybody to inform * @param string $inform a comma-seperated string containing everybody to inform
* @param string $str_tags string to add the tag to * @param string $str_tags string to add the tag to
@ -920,7 +919,9 @@ function item_content(App $a)
* @param string $tag the tag to replace * @param string $tag the tag to replace
* @param string $network The network of the post * @param string $network The network of the post
* *
* @return boolean true if replaced, false if not replaced * @return array|bool ['replaced' => $replaced, 'contact' => $contact];
* @throws ImagickException
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function handle_tag(App $a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $network = "") function handle_tag(App $a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $network = "")
{ {

View file

@ -25,6 +25,9 @@ use Friendica\Util\Proxy as ProxyUtils;
* @param App $a App * @param App $a App
* *
* @return string * @return string
* @throws ImagickException
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws Exception
*/ */
function match_content(App $a) function match_content(App $a)
{ {

View file

@ -208,7 +208,8 @@ function saved_searches($search)
* '/network?f=&star=1', => $starred_active = 'active' * '/network?f=&star=1', => $starred_active = 'active'
* '/network?f=&bmark=1', => $bookmarked_active = 'active' * '/network?f=&bmark=1', => $bookmarked_active = 'active'
* *
* @return Array ($no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active); * @param App $a
* @return array ($no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active);
*/ */
function network_query_get_sel_tab(App $a) function network_query_get_sel_tab(App $a)
{ {
@ -265,8 +266,10 @@ function network_query_get_sel_group(App $a)
* @brief Sets the pager data and returns SQL * @brief Sets the pager data and returns SQL
* *
* @param App $a The global App * @param App $a The global App
* @param Pager $pager
* @param integer $update Used for the automatic reloading * @param integer $update Used for the automatic reloading
* @return string SQL with the appropriate LIMIT clause * @return string SQL with the appropriate LIMIT clause
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function networkPager(App $a, Pager $pager, $update) function networkPager(App $a, Pager $pager, $update)
{ {
@ -300,6 +303,7 @@ function networkPager(App $a, Pager $pager, $update)
* @brief Sets items as seen * @brief Sets items as seen
* *
* @param array $condition The array with the SQL condition * @param array $condition The array with the SQL condition
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function networkSetSeen($condition) function networkSetSeen($condition)
{ {
@ -319,9 +323,12 @@ function networkSetSeen($condition)
* *
* @param App $a The global App * @param App $a The global App
* @param array $items Items of the conversation * @param array $items Items of the conversation
* @param Pager $pager
* @param string $mode Display mode for the conversation * @param string $mode Display mode for the conversation
* @param integer $update Used for the automatic reloading * @param integer $update Used for the automatic reloading
* @param string $ordering
* @return string HTML of the conversation * @return string HTML of the conversation
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function networkConversation(App $a, $items, Pager $pager, $mode, $update, $ordering = '') function networkConversation(App $a, $items, Pager $pager, $mode, $update, $ordering = '')
{ {
@ -386,10 +393,11 @@ function network_content(App $a, $update = 0, $parent = 0)
/** /**
* @brief Get the network content in flat view * @brief Get the network content in flat view
* *
* @param Pager $pager
* @param App $a The global App * @param App $a The global App
* @param integer $update Used for the automatic reloading * @param integer $update Used for the automatic reloading
* @return string HTML of the network content in flat view * @return string HTML of the network content in flat view
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @global Pager $pager
*/ */
function networkFlatView(App $a, $update = 0) function networkFlatView(App $a, $update = 0)
{ {
@ -477,11 +485,12 @@ function networkFlatView(App $a, $update = 0)
/** /**
* @brief Get the network content in threaded view * @brief Get the network content in threaded view
* *
* @global Pager $pager
* @param App $a The global App * @param App $a The global App
* @param integer $update Used for the automatic reloading * @param integer $update Used for the automatic reloading
* @param integer $parent * @param integer $parent
* @return string HTML of the network content in flat view * @return string HTML of the network content in flat view
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @global Pager $pager
*/ */
function networkThreadedView(App $a, $update, $parent) function networkThreadedView(App $a, $update, $parent)
{ {
@ -1039,13 +1048,16 @@ function network_tabs(App $a)
* of the page to make the correct asynchronous call. This is obtained through the Pager that was instantiated in * of the page to make the correct asynchronous call. This is obtained through the Pager that was instantiated in
* networkThreadedView or networkFlatView. * networkThreadedView or networkFlatView.
* *
* @global Pager $pager
* @param App $a
* @param string $htmlhead The head tag HTML string * @param string $htmlhead The head tag HTML string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @global Pager $pager
*/ */
function network_infinite_scroll_head(App $a, &$htmlhead) function network_infinite_scroll_head(App $a, &$htmlhead)
{ {
/// @TODO this will have to be converted to a static property of the converted Module\Network class /// @TODO this will have to be converted to a static property of the converted Module\Network class
/**
* @var $pager Pager
*/
global $pager; global $pager;
if (PConfig::get(local_user(), 'system', 'infinite_scroll') if (PConfig::get(local_user(), 'system', 'infinite_scroll')

View file

@ -144,18 +144,18 @@ function parse_url_content(App $a)
* Note: We have moved the function to ParseUrl.php. This function is only for * Note: We have moved the function to ParseUrl.php. This function is only for
* legacy support and will be remove in the future * legacy support and will be remove in the future
* *
* @param type $url The url of the page which should be scraped * @param string $url The url of the page which should be scraped
* @param type $no_guessing If true the parse doens't search for * @param bool $no_guessing If true the parse doens't search for
* preview pictures * preview pictures
* @param type $do_oembed The false option is used by the function fetch_oembed() * @param bool $do_oembed The false option is used by the function fetch_oembed()
* to avoid endless loops * to avoid endless loops
* *
* @return array which contains needed data for embedding * @return array which contains needed data for embedding
* *
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @see ParseUrl::getSiteinfoCached() * @see ParseUrl::getSiteinfoCached()
* *
* @todo Remove this function after all Addons has been changed to use * @deprecated since version 3.6 use ParseUrl::getSiteinfoCached instead
* ParseUrl::getSiteinfoCached
*/ */
function parseurl_getsiteinfo_cached($url, $no_guessing = false, $do_oembed = true) function parseurl_getsiteinfo_cached($url, $no_guessing = false, $do_oembed = true)
{ {

View file

@ -54,6 +54,7 @@ use Friendica\Util\XML;
* } * }
* *
* @param App $a The Friendica App instance * @param App $a The Friendica App instance
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function ping_init(App $a) function ping_init(App $a)
{ {
@ -393,6 +394,7 @@ function ping_init(App $a)
* *
* @param int $uid User id * @param int $uid User id
* @return array Associative array of notifications * @return array Associative array of notifications
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function ping_get_notifications($uid) function ping_get_notifications($uid)
{ {
@ -479,8 +481,8 @@ function ping_get_notifications($uid)
* @param array $notifs Complete list of notification * @param array $notifs Complete list of notification
* @param array $sysmsgs List of system notice messages * @param array $sysmsgs List of system notice messages
* @param array $sysmsgs_info List of system info messages * @param array $sysmsgs_info List of system info messages
* @param array $groups_unseen List of unseen group messages * @param array $groups_unseen List of unseen group items
* @param array $forums_unseen List of unseen forum messages * @param array $forums_unseen List of unseen forum items
* *
* @return array XML-transform ready data array * @return array XML-transform ready data array
*/ */

View file

@ -12,8 +12,10 @@ use Friendica\Database\DBA;
use Friendica\Protocol\Diaspora; use Friendica\Protocol\Diaspora;
/** /**
* @param object $a App * @param App $a App
* @return void * @return void
* @throws ImagickException
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function receive_post(App $a) function receive_post(App $a)
{ {

View file

@ -7,8 +7,9 @@ use Friendica\Content\Smilies;
use Friendica\Core\System; use Friendica\Core\System;
/** /**
* @param object $a App * @param App $a App
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function smilies_content(App $a) function smilies_content(App $a)
{ {

View file

@ -36,8 +36,10 @@ function tagrm_post(App $a)
/** /**
* Updates tags from an item * Updates tags from an item
*
* @param $item_id * @param $item_id
* @param $tags array * @param $tags array
* @throws Exception
*/ */
function update_tags($item_id, $tags){ function update_tags($item_id, $tags){
if (empty($item_id) || empty($tags)){ if (empty($item_id) || empty($tags)){

View file

@ -1,8 +1,9 @@
<?php <?php
/** /**
* load view/theme/$current_theme/style.php with friendica contex * load view/theme/$current_theme/style.php with friendica contex
*
* @param App $a
*/ */
function view_init($a){ function view_init($a){
header("Content-Type: text/css"); header("Content-Type: text/css");

View file

@ -108,7 +108,7 @@ class PConfig extends BaseObject
* @param string $uid The user_id * @param string $uid The user_id
* @param string $family The category of the configuration value * @param string $family The category of the configuration value
* @param string $key The configuration key to set * @param string $key The configuration key to set
* @param string $value The value to store * @param mixed $value The value to store
* *
* @return bool Operation success * @return bool Operation success
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException

View file

@ -131,7 +131,7 @@ class Renderer extends BaseObject
* If $name is not defined, return engine defined by theme, * If $name is not defined, return engine defined by theme,
* or default * or default
* *
* @return object Template Engine instance * @return ITemplateEngine Template Engine instance
*/ */
public static function getTemplateEngine() public static function getTemplateEngine()
{ {

View file

@ -410,7 +410,7 @@ class GContact
} }
/** /**
* @param object $uid user * @param int $uid user
* @param integer $start optional, default 0 * @param integer $start optional, default 0
* @param integer $limit optional, default 80 * @param integer $limit optional, default 80
* @return array * @return array

View file

@ -63,7 +63,7 @@ class Image
/** /**
* @brief Constructor * @brief Constructor
* @param object $data data * @param string $data
* @param boolean $type optional, default null * @param boolean $type optional, default null
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException * @throws \ImagickException
@ -127,7 +127,7 @@ class Image
} }
/** /**
* @param object $data data * @param string $data data
* @return boolean * @return boolean
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException * @throws \ImagickException

View file

@ -1212,9 +1212,10 @@ class Transmitter
/** /**
* Transmits a given activity to a target * Transmits a given activity to a target
* *
* @param array $activity * @param string $activity Type name
* @param string $target Target profile * @param string $target Target profile
* @param integer $uid User ID * @param integer $uid User ID
* @return bool
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException * @throws \ImagickException
* @throws \Exception * @throws \Exception