Fix PHPDoc comments project-wide

pull/6482/head
Hypolite Petovan 4 years ago
parent 6077aa5847
commit 3282ce5389

@ -121,6 +121,7 @@ class App
* @see initHead()
*
* @param string $path
* @throws InternalServerErrorException
*/
public function registerStylesheet($path)
{
@ -137,6 +138,7 @@ class App
* @see initFooter()
*
* @param string $path
* @throws InternalServerErrorException
*/
public function registerFooterScript($path)
{
@ -617,6 +619,7 @@ class App
* finally for PWD
*
* @return string
* @throws InternalServerErrorException
*/
public function getBasePath()
{
@ -676,6 +679,7 @@ class App
*
* @param bool $ssl Whether to append http or https under SSL_POLICY_SELFSIGN
* @return string Friendica server base URL
* @throws InternalServerErrorException
*/
public function getBaseURL($ssl = false)
{
@ -709,6 +713,7 @@ class App
* Clears the baseurl cache to prevent inconsistencies
*
* @param string $url
* @throws InternalServerErrorException
*/
public function setBaseURL($url)
{
@ -882,6 +887,7 @@ class App
* @param string $origURL
*
* @return string The cleaned url
* @throws InternalServerErrorException
*/
public function removeBaseURL($origURL)
{
@ -935,6 +941,7 @@ class App
* Returns the current UserAgent as a String
*
* @return string the UserAgent as a String
* @throws InternalServerErrorException
*/
public function getUserAgent()
{
@ -1058,6 +1065,7 @@ class App
* @brief Checks if the minimal memory is reached
*
* @return bool Is the memory limit reached?
* @throws InternalServerErrorException
*/
public function isMinMemoryReached()
{
@ -1102,6 +1110,7 @@ class App
* @brief Checks if the maximum load is reached
*
* @return bool Is the load reached?
* @throws InternalServerErrorException
*/
public function isMaxLoadReached()
{
@ -1134,6 +1143,7 @@ class App
*
* @param string $command The command to execute
* @param array $args Arguments to pass to the command ( [ 'key' => value, 'key2' => value2, ... ]
* @throws InternalServerErrorException
*/
public function proc_run($command, $args)
{
@ -1190,7 +1200,10 @@ class App
/**
* @brief Checks if a given directory is usable for the system
*
* @param $directory
* @param bool $check_writable
* @return boolean the directory is usable
* @throws Exception
*/
public static function isDirectoryUsable($directory, $check_writable = true)
{
@ -1368,6 +1381,7 @@ class App
* Generates the site's default sender email address
*
* @return string
* @throws InternalServerErrorException
*/
public function getSenderEmailAddress()
{
@ -1388,6 +1402,7 @@ class App
* Returns the current theme name.
*
* @return string the name of the current theme
* @throws InternalServerErrorException
*/
public function getCurrentTheme()
{
@ -1469,6 +1484,7 @@ class App
* Provide a sane default if nothing is chosen or the specified theme does not exist.
*
* @return string
* @throws InternalServerErrorException
*/
public function getCurrentThemeStylesheetPath()
{
@ -1930,7 +1946,7 @@ class App
* Should only be used if it isn't clear if the URL is either internal or external
*
* @param string $toUrl The target URL
*
* @throws InternalServerErrorException
*/
public function redirect($toUrl)
{

@ -42,7 +42,7 @@ class Mode
* - App::MODE_NORMAL : Normal run with all features enabled
*
* @param string $basepath the Basepath of the Application
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function determine($basepath = null)
{

@ -23,6 +23,7 @@ class BaseObject
* Same as get_app from boot.php
*
* @return App
* @throws \Exception
*/
public static function getApp()
{

@ -19,6 +19,8 @@ class ContactSelector
/**
* @param string $current current
* @param string $foreign_net network
* @return string
* @throws \Exception
*/
public static function profileAssign($current, $foreign_net)
{
@ -73,6 +75,7 @@ class ContactSelector
* @param string $network network
* @param string $profile optional, default empty
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function networkToName($network, $profile = "")
{
@ -141,6 +144,7 @@ class ContactSelector
* @param string $current optional, default empty
* @param string $suffix optionsl, default empty
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function gender($current = "", $suffix = "")
{
@ -180,6 +184,7 @@ class ContactSelector
* @param string $current optional, default empty
* @param string $suffix optionsl, default empty
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function sexualPreference($current = "", $suffix = "")
{
@ -217,6 +222,7 @@ class ContactSelector
/**
* @param string $current optional, default empty
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function maritalStatus($current = "")
{

@ -18,6 +18,7 @@ class Feature
* @param integer $uid user id
* @param string $feature feature
* @return boolean
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function isEnabled($uid, $feature)
{
@ -45,6 +46,7 @@ class Feature
*
* @param string $feature feature
* @return boolean
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
private static function getDefault($feature)
{
@ -69,6 +71,7 @@ class Feature
* @param bool $filtered True removes any locked features
*
* @return array
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function get($filtered = true)
{

@ -29,11 +29,12 @@ class ForumManager
* @param boolean $showprivate Show private groups
*
* @return array
* 'url' => forum url
* 'name' => forum name
* 'id' => number of the key from the array
* 'micro' => contact photo in format micro
* 'thumb' => contact photo in format thumb
* 'url' => forum url
* 'name' => forum name
* 'id' => number of the key from the array
* 'micro' => contact photo in format micro
* 'thumb' => contact photo in format thumb
* @throws \Exception
*/
public static function getList($uid, $lastitem, $showhidden = true, $showprivate = false)
{
@ -88,6 +89,8 @@ class ForumManager
* @param int $uid The ID of the User
* @param int $cid The contact id which is used to mark a forum as "selected"
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public static function widget($uid, $cid = 0)
{
@ -143,6 +146,8 @@ class ForumManager
*
* @param int $uid The ID of the User
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public static function profileAdvanced($uid)
{

@ -42,6 +42,8 @@ class Nav
/**
* Set a menu item in navbar as selected
*
* @param string $item
*/
public static function setSelected($item)
{
@ -50,6 +52,10 @@ class Nav
/**
* Build page header and site navigation bars
*
* @param App $a
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function build(App $a)
{
@ -114,12 +120,13 @@ class Nav
* Prepares a list of navigation links
*
* @brief Prepares a list of navigation links
* @param App $a
* @param App $a
* @return array Navigation links
* string 'sitelocation' => The webbie (username@site.com)
* array 'nav' => Array of links used in the nav menu
* string 'banner' => Formatted html link with banner image
* array 'userinfo' => Array of user information (name, icon)
* string 'sitelocation' => The webbie (username@site.com)
* array 'nav' => Array of links used in the nav menu
* string 'banner' => Formatted html link with banner image
* array 'userinfo' => Array of user information (name, icon)
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
private static function getInfo(App $a)
{

@ -51,6 +51,7 @@ class OEmbed
* @param bool $no_rich_type If set to true rich type content won't be fetched.
*
* @return \Friendica\Object\OEmbed
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function fetchURL($embedurl, $no_rich_type = false)
{
@ -260,6 +261,9 @@ class OEmbed
/**
* Find <span class='oembed'>..<a href='url' rel='oembed'>..</a></span>
* and replace it with [embed]url[/embed]
*
* @param $text
* @return string
*/
public static function HTML2BBCode($text)
{
@ -298,6 +302,7 @@ class OEmbed
* @brief Determines if rich content OEmbed is allowed for the provided URL
* @param string $url
* @return boolean
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function isAllowedURL($url)
{
@ -353,14 +358,15 @@ class OEmbed
* Since the iframe is automatically resized on load, there are no need for ugly
* and impractical scrollbars.
*
* @todo This function is currently unused until someone™ adds support for a separate OEmbed domain
* @todo This function is currently unused until someone™ adds support for a separate OEmbed domain
*
* @param string $src Original remote URL to embed
* @param string $width
* @param string $height
* @return string formatted HTML
*
* @see oembed_format_object()
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @see oembed_format_object()
*/
private static function iframe($src, $width, $height)
{

@ -65,7 +65,7 @@ class Pager
/**
* Returns the current page number
*
* @return type
* @return int
*/
public function getPage()
{
@ -140,6 +140,7 @@ class Pager
*
* @param integer $itemCount The number of displayed items on the page
* @return string HTML string of the pager
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function renderMinimal($itemCount)
{
@ -182,6 +183,7 @@ class Pager
*
* @param integer $itemCount The total number of items including those note displayed on the page
* @return string HTML string of the pager
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function renderFull($itemCount)
{

@ -55,10 +55,11 @@ class Smilies
* Get an array of all smilies, both internal and from addons.
*
* @return array
* 'texts' => smilie shortcut
* 'icons' => icon in html
* 'texts' => smilie shortcut
* 'icons' => icon in html
*
* @hook smilie ('texts' => smilies texts array, 'icons' => smilies html array)
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @hook smilie ('texts' => smilies texts array, 'icons' => smilies html array)
*/
public static function getList()
{
@ -182,6 +183,7 @@ class Smilies
* @param boolean $no_images Only replace emoticons without images
*
* @return string HTML Output of the Smilie
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function replace($s, $no_images = false)
{
@ -201,6 +203,7 @@ class Smilies
* @param array $smilies An string replacement array with the following structure: ['texts' => [], 'icons' => []]
* @param bool $no_images Only replace shortcodes without image replacement (e.g. Unicode characters)
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function replaceFromArray($text, array $smilies, $no_images = false)
{
@ -248,6 +251,7 @@ class Smilies
* @param string $m string
*
* @return string base64 decoded string
* @throws \Exception
*/
private static function decode($m)
{
@ -262,7 +266,8 @@ class Smilies
*
* @return string HTML Output
*
* @todo: Rework because it doesn't work correctly
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @todo : Rework because it doesn't work correctly
*/
private static function pregHeart($x)
{

@ -37,13 +37,14 @@ class BBCode extends BaseObject
*
* @param string $body Message body
* @return array
* 'type' -> Message type ("link", "video", "photo")
* 'text' -> Text before the shared message
* 'after' -> Text after the shared message
* 'image' -> Preview image of the message
* 'url' -> Url to the attached message
* 'title' -> Title of the attachment
* 'description' -> Description of the attachment
* 'type' -> Message type ("link", "video", "photo")
* 'text' -> Text before the shared message
* 'after' -> Text after the shared message
* 'image' -> Preview image of the message
* 'url' -> Url to the attached message
* 'title' -> Title of the attachment
* 'description' -> Description of the attachment
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
private static function getOldAttachmentData($body)
{
@ -108,13 +109,14 @@ class BBCode extends BaseObject
*
* @param string $body Message body
* @return array
* 'type' -> Message type ("link", "video", "photo")
* 'text' -> Text before the shared message
* 'after' -> Text after the shared message
* 'image' -> Preview image of the message
* 'url' -> Url to the attached message
* 'title' -> Title of the attachment
* 'description' -> Description of the attachment
* 'type' -> Message type ("link", "video", "photo")
* 'text' -> Text before the shared message
* 'after' -> Text after the shared message
* 'image' -> Preview image of the message
* 'url' -> Url to the attached message
* 'title' -> Title of the attachment
* 'description' -> Description of the attachment
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function getAttachmentData($body)
{
@ -345,6 +347,7 @@ class BBCode extends BaseObject
/**
* @brief Converts a BBCode text into plaintext
*
* @param $text
* @param bool $keep_urls Whether to keep URLs in the resulting plaintext
*
* @return string
@ -446,6 +449,7 @@ class BBCode extends BaseObject
* @brief Truncates imported message body string length to max_import_size
* @param string $body
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function limitBodySize($body)
{
@ -532,10 +536,11 @@ class BBCode extends BaseObject
* Note: Can produce a [bookmark] tag in the returned string
*
* @brief Processes [attachment] tags
* @param string $return
* @param string $return
* @param bool|int $simplehtml
* @param bool $tryoembed
* @param bool $tryoembed
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
private static function convertAttachment($return, $simplehtml = false, $tryoembed = true)
{
@ -777,10 +782,10 @@ class BBCode extends BaseObject
/**
* Performs a preg_replace within the boundaries of all named BBCode tags in a text
*
* @param type $pattern Preg pattern string
* @param type $replace Preg replace string
* @param type $name BBCode tag name
* @param type $text Text to search
* @param string $pattern Preg pattern string
* @param string $replace Preg replace string
* @param string $name BBCode tag name
* @param string $text Text to search
* @return string
*/
public static function pregReplaceInTag($pattern, $replace, $name, $text)
@ -930,6 +935,7 @@ class BBCode extends BaseObject
* @param boolean $is_quote_share Whether there is content before the [share] block
* @param integer $simplehtml Mysterious integer value depending on the target network/formatting style
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
private static function convertShareCallback(array $attributes, array $author_contact, $content, $is_quote_share, $simplehtml)
{
@ -1142,6 +1148,7 @@ class BBCode extends BaseObject
* @param int $simple_html
* @param bool $for_plaintext
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function convert($text, $try_oembed = true, $simple_html = false, $for_plaintext = false)
{
@ -1813,6 +1820,8 @@ class BBCode extends BaseObject
* [2] = Name
* [3] = Address
* @return string Replaced mention
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
private static function bbCodeMention2DiasporaCallback($match)
{
@ -1839,6 +1848,7 @@ class BBCode extends BaseObject
* @param string $text
* @param bool $for_diaspora Diaspora requires more changes than Libertree
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function toMarkdown($text, $for_diaspora = true)
{

@ -117,12 +117,13 @@ class HTML
/**
* Made by: ike@piratenpartei.de
* Originally made for the syncom project: http://wiki.piratenpartei.de/Syncom
* https://github.com/annando/Syncom
* https://github.com/annando/Syncom
*
* @brief Converter for HTML to BBCode
* @param string $message
* @param string $basepath
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function toBBCode($message, $basepath = '')
{
@ -713,6 +714,7 @@ class HTML
* @brief Convert video HTML to BBCode tags
*
* @param string $s
* @return string
*/
public static function toBBCodeVideo($s)
{
@ -789,7 +791,9 @@ class HTML
/**
* Loader for infinite scrolling
*
* @return string html for loader
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function scrollLoader()
{
@ -804,8 +808,10 @@ class HTML
* Get html for contact block.
*
* @template contact_block.tpl
* @hook contact_block_end (contacts=>array, output=>string)
* @hook contact_block_end (contacts=>array, output=>string)
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public static function contactBlock()
{
@ -890,22 +896,23 @@ class HTML
/**
* @brief Format contacts as picture links or as text links
*
* @param array $contact Array with contacts which contains an array with
* int 'id' => The ID of the contact
* int 'uid' => The user ID of the user who owns this data
* string 'name' => The name of the contact
* string 'url' => The url to the profile page of the contact
* string 'addr' => The webbie of the contact (e.g.) username@friendica.com
* string 'network' => The network to which the contact belongs to
* string 'thumb' => The contact picture
* string 'click' => js code which is performed when clicking on the contact
* @param boolean $redirect If true try to use the redir url if it's possible
* @param string $class CSS class for the
* @param boolean $textmode If true display the contacts as text links
* if false display the contacts as picture links
* @return string Formatted html
*/
* @param array $contact Array with contacts which contains an array with
* int 'id' => The ID of the contact
* int 'uid' => The user ID of the user who owns this data
* string 'name' => The name of the contact
* string 'url' => The url to the profile page of the contact
* string 'addr' => The webbie of the contact (e.g.) username@friendica.com
* string 'network' => The network to which the contact belongs to
* string 'thumb' => The contact picture
* string 'click' => js code which is performed when clicking on the contact
* @param boolean $redirect If true try to use the redir url if it's possible
* @param string $class CSS class for the
* @param boolean $textmode If true display the contacts as text links
* if false display the contacts as picture links
* @return string Formatted html
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public static function micropro($contact, $redirect = false, $class = '', $textmode = false)
{
// Use the contact URL if no address is available
@ -947,10 +954,10 @@ class HTML
* @param string $s Search query.
* @param string $id HTML id
* @param string $url Search url.
* @param bool $save Show save search button.
* @param bool $aside Display the search widgit aside.
*
* @return string Formatted HTML.
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function search($s, $id = 'search-box', $url = 'search', $aside = true)
{
@ -990,6 +997,7 @@ class HTML
* Replace naked text hyperlink with HTML formatted hyperlink
*
* @param string $s
* @return string
*/
public static function toLink($s)
{
@ -1006,6 +1014,7 @@ class HTML
* @param string $html
* @param array $reasons
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function applyContentFilter($html, array $reasons)
{

@ -26,6 +26,7 @@ class Markdown extends BaseObject
* @param string $text
* @param bool $hardwrap
* @return string
* @throws \Exception
*/
public static function convert($text, $hardwrap = true) {
$stamp1 = microtime(true);
@ -48,6 +49,8 @@ class Markdown extends BaseObject
* [2] = name (optional)
* [3] = address
* @return string Replaced mention
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
private static function diasporaMention2BBCodeCallback($match)
{

@ -9,9 +9,9 @@ class Plaintext
/**
* Shortens message
*
* @param type $msg
* @param type $limit
* @return type
* @param string $msg
* @param int $limit
* @return string
*
* @todo For Twitter URLs aren't shortened, but they have to be calculated as if.
*/

@ -28,6 +28,8 @@ class Widget
* Return the follow widget
*
* @param string $value optional, default empty
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function follow($value = "")
{
@ -125,6 +127,8 @@ class Widget
*
* @param string $baseurl baseurl
* @param string $selected optional, default empty
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function networks($baseurl, $selected = '')
{
@ -167,6 +171,8 @@ class Widget
*
* @param string $baseurl baseurl
* @param string $selected optional, default empty
* @return string|void
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function fileAs($baseurl, $selected = '')
{
@ -205,6 +211,8 @@ class Widget
*
* @param string $baseurl baseurl
* @param string $selected optional, default empty
* @return string|void
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function categories($baseurl, $selected = '')
{
@ -244,6 +252,8 @@ class Widget
* Return common friends visitor widget
*
* @param string $profile_uid uid
* @return string|void
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function commonFriendsVisitor($profile_uid)
{
@ -327,8 +337,10 @@ class Widget
* Insert a tag cloud widget for the present profile.
*
* @brief Insert a tag cloud widget for the present profile.
* @param int $limit Max number of displayed tags.
* @param int $limit Max number of displayed tags.
* @return string HTML formatted output.
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public static function tagCloud($limit = 50)
{

@ -21,6 +21,7 @@ class CalendarExport
* @brief Get the events widget.
*
* @return string Formated HTML of the calendar widget.
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function getHTML() {
$a = \get_app();

@ -24,13 +24,14 @@ class TagCloud
* Construct a tag/term cloud block for an user.
*
* @brief Construct a tag/term cloud block for an user.
* @param int $uid The user ID.
* @param int $count Max number of displayed tags/terms.
* @param int $owner_id The contact ID of the owner of the tagged items.
* @param string $flags Special item flags.
* @param int $type The tag/term type.
* @param int $uid The user ID.
* @param int $count Max number of displayed tags/terms.
* @param int $owner_id The contact ID of the owner of the tagged items.
* @param string $flags Special item flags.
* @param int $type The tag/term type.
*
* @return string HTML formatted output.
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function getHTML($uid, $count = 0, $owner_id = 0, $flags = '', $type = TERM_HASHTAG)
{
@ -63,13 +64,14 @@ class TagCloud
*
* @brief Get alphabetical sorted array of used tags/terms of an user including
* a weighting by frequency of use.
* @param int $uid The user ID.
* @param int $count Max number of displayed tags/terms.
* @param int $owner_id The contact id of the owner of the tagged items.
* @param string $flags Special item flags.
* @param int $type The tag/term type.
* @param int $uid The user ID.
* @param int $count Max number of displayed tags/terms.
* @param int $owner_id The contact id of the owner of the tagged items.
* @param string $flags Special item flags.
* @param int $type The tag/term type.
*
* @return arr Alphabetical sorted array of used tags of an user.
* @return array Alphabetical sorted array of used tags of an user.
* @throws \Exception
*/
private static function tagadelic($uid, $count = 0, $owner_id = 0, $flags = '', $type = TERM_HASHTAG)
{
@ -146,8 +148,8 @@ class TagCloud
* Compare function to sort tags/terms alphabetically.
*
* @brief Compare function to sort tags/terms alphabetically.
* @param type $a
* @param type $b
* @param string $a
* @param string $b
*
* @return int
*/

@ -23,15 +23,16 @@ class ACL extends BaseObject
/**
* Returns a select input tag with all the contact of the local user
*
* @param string $selname Name attribute of the select input tag
* @param string $selclass Class attribute of the select input tag
* @param array $options Available options:
* - size: length of the select box
* - mutual_friends: Only used for the hook
* - single: Only used for the hook
* - exclude: Only used for the hook
* @param array $preselected Contact ID that should be already selected
* @param string $selname Name attribute of the select input tag
* @param string $selclass Class attribute of the select input tag
* @param array $options Available options:
* - size: length of the select box
* - mutual_friends: Only used for the hook
* - single: Only used for the hook
* - exclude: Only used for the hook
* @param array $preselected Contact ID that should be already selected
* @return string
* @throws \Exception
*/
public static function getSuggestContactSelectHTML($selname, $selclass, array $options = [], array $preselected = [])
{
@ -141,6 +142,7 @@ class ACL extends BaseObject
* @param int $size Length of the select box
* @param int $tabindex Select input tag tabindex attribute
* @return string
* @throws \Exception
*/
public static function getMessageContactSelectHTML($selname, $selclass, array $preselected = [], $size = 4, $tabindex = null)
{
@ -215,6 +217,7 @@ class ACL extends BaseObject
*
* @param array $user
* @return array Hash of contact id lists
* @throws \Exception
*/
public static function getDefaultUserPermissions(array $user = null)
{
@ -251,9 +254,10 @@ class ACL extends BaseObject
* Return the full jot ACL selector HTML
*
* @param array $user User array
* @param array $default_permissions Static defaults permission array: ['allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '']
* @param bool $show_jotnets
* @param array $default_permissions Static defaults permission array: ['allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '']
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function getFullSelectorHTML(array $user, $show_jotnets = false, array $default_permissions = [])
{
@ -320,6 +324,7 @@ class ACL extends BaseObject
* @param string $search Name or part of a name or nick
* @param string $mode Search mode (e.g. "community")
* @return array with the search results
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function contactAutocomplete($search, $mode)
{

@ -70,7 +70,8 @@ class Addon extends BaseObject
* @brief uninstalls an addon.
*
* @param string $addon name of the addon
* @return boolean
* @return void
* @throws \Exception
*/
public static function uninstall($addon)
{
@ -91,6 +92,7 @@ class Addon extends BaseObject
*
* @param string $addon name of the addon
* @return bool
* @throws \Exception
*/
public static function install($addon)
{
@ -190,6 +192,7 @@ class Addon extends BaseObject
* *\endcode
* @param string $addon the name of the addon
* @return array with the addon information
* @throws \Exception
*/
public static function getInfo($addon)
{
@ -269,6 +272,7 @@ class Addon extends BaseObject
* Saves the current enabled addon list in the system.addon config key
*
* @return boolean
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function saveEnabledList()
{
@ -279,6 +283,7 @@ class Addon extends BaseObject
* Returns the list of non-hidden enabled addon names
*
* @return array
* @throws \Exception
*/
public static function getVisibleList()
{
@ -296,13 +301,14 @@ class Addon extends BaseObject
/**
* Shim of Hook::register left for backward compatibility purpose.
*
* @see Hook::register
* @see Hook::register
* @deprecated since version 2018.12
* @param string $hook the name of the hook
* @param string $file the name of the file that hooks into
* @param string $function the name of the function that the hook will call
* @param int $priority A priority (defaults to 0)
* @return mixed|bool
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function registerHook($hook, $file, $function, $priority = 0)
{
@ -312,12 +318,13 @@ class Addon extends BaseObject
/**
* Shim of Hook::unregister left for backward compatibility purpose.
*
* @see Hook::unregister
* @see Hook::unregister
* @deprecated since version 2018.12
* @param string $hook the name of the hook
* @param string $file the name of the file that hooks into
* @param string $function the name of the function that the hook called
* @return boolean
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function unregisterHook($hook, $file, $function)
{
@ -327,10 +334,11 @@ class Addon extends BaseObject
/**
* Shim of Hook::callAll left for backward-compatibility purpose.
*
* @see Hook::callAll
* @see Hook::callAll
* @deprecated since version 2018.12
* @param string $name of the hook to call
* @param string $name of the hook to call
* @param string|array &$data to transmit to the callback handler
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function callHooks($name, &$data = null)
{

@ -21,6 +21,7 @@ class Authentication extends BaseObject
* @param array $user Record from "user" table
*
* @return string Hashed data
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function getCookieHashForUser($user)
{
@ -32,8 +33,9 @@ class Authentication extends BaseObject
/**
* @brief Set the "Friendica" cookie
*
* @param int $time
* @param int $time
* @param array $user Record from "user" table
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function setCookie($time, $user = [])
{
@ -55,12 +57,13 @@ class Authentication extends BaseObject
/**
* @brief Sets the provided user's authenticated session
*
* @todo Should be moved to Friendica\Core\Session once it's created
* @todo Should be moved to Friendica\Core\Session once it's created
*
* @param type $user_record
* @param type $login_initial
* @param type $interactive
* @param type $login_refresh
* @param array $user_record
* @param bool $login_initial
* @param bool $interactive
* @param bool $login_refresh
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function setAuthenticatedSessionForUser($user_record, $login_initial = false, $interactive = false, $login_refresh = false)
{

@ -55,6 +55,7 @@ class Cache extends \Friendica\BaseObject
* @param string $prefix Prefix of the keys (optional)
*
* @return array Empty if the driver doesn't support this feature
* @throws \Exception
*/
public static function getAllKeys($prefix = null)
{
@ -73,6 +74,7 @@ class Cache extends \Friendica\BaseObject
* @param string $key The key to the cached data
*
* @return mixed Cached $value or "null" if not found
* @throws \Exception
*/
public static function get($key)
{
@ -95,6 +97,7 @@ class Cache extends \Friendica\BaseObject
* @param integer $duration The cache lifespan
*
* @return bool
* @throws \Exception
*/
public static function set($key, $value, $duration = self::MONTH)
{
@ -113,6 +116,7 @@ class Cache extends \Friendica\BaseObject
* @param string $key The key to the cached data
*
* @return bool
* @throws \Exception
*/
public static function delete($key)
{
@ -130,7 +134,7 @@ class Cache extends \Friendica\BaseObject
*
* @param boolean $outdated just remove outdated values
*
* @return void
* @return bool
*/
public static function clear($outdated = true)
{

@ -14,8 +14,9 @@ use Friendica\BaseObject;
abstract class AbstractCacheDriver extends BaseObject
{
/**
* @param string $key The original key
* @return string The cache key used for the cache
* @param string $key The original key
* @return string The cache key used for the cache
* @throws \Exception
*/
protected function getCacheKey($key)
{

@ -22,7 +22,7 @@ use Friendica\Core\Config;
class Config extends BaseObject
{
/**
* @var Friendica\Core\Config\IConfigAdapter
* @var \Friendica\Core\Config\IConfigAdapter
*/
private static $adapter = null;
@ -49,6 +49,7 @@ class Config extends BaseObject
* @param string $family The category of the configuration value
*
* @return void
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function load($family = "config")
{
@ -82,6 +83,7 @@ class Config extends BaseObject
* @param boolean $refresh optional, If true the config is loaded from the db and not from the cache (default: false)
*
* @return mixed Stored value or null if it does not exist
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function get($family, $key, $default_value = null, $refresh = false)
{
@ -110,6 +112,7 @@ class Config extends BaseObject
* @param mixed $value The value to store
*
* @return bool Operation success
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function set($family, $key, $value)
{
@ -135,6 +138,7 @@ class Config extends BaseObject
* @param string $key The configuration key to delete
*
* @return mixed
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function delete($family, $key)
{

@ -49,9 +49,9 @@ interface IConfigAdapter
*
* Note: Please do not store booleans - convert to 0/1 integer values!
*
* @param string $family The category of the configuration value
* @param string $key The configuration key to set
* @param mixed $value The value to store
* @param string $cat The category of the configuration value
* @param string $k The configuration key to set
* @param mixed $value The value to store
*
* @return bool Operation success
*/

@ -185,6 +185,7 @@ HELP;
* @param Installer $installer the Installer instance
*
* @return bool true if checks were successfully, otherwise false
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
private function runBasicChecks(Installer $installer)
{

@ -206,6 +206,9 @@ HELP;
* - replace " with \"
* - replace tab char with \t
* - manage multiline strings
*
* @param string $str
* @return string
*/
private function massageString($str)
{

@ -48,9 +48,9 @@ class Hook extends BaseObject
*
* This function is meant to be called by modules on each page load as it works after loadHooks has been called.
*
* @param type $hook
* @param type $file
* @param type $function
* @param string $hook
* @param string $file
* @param string $function
*/
public static function add($hook, $file, $function)
{
@ -70,6 +70,7 @@ class Hook extends BaseObject
* @param string $function the name of the function that the hook will call
* @param int $priority A priority (defaults to 0)
* @return mixed|bool
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function register($hook, $file, $function, $priority = 0)
{
@ -92,6 +93,7 @@ class Hook extends BaseObject
* @param string $file the name of the file that hooks into
* @param string $function the name of the function that the hook called
* @return boolean
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function unregister($hook, $file, $function)
{
@ -131,6 +133,7 @@ class Hook extends BaseObject
* @param integer $priority of the hook
* @param string $name of the hook to call
* @param mixed $data to transmit to the callback handler
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function fork($priority, $name, $data = null)
{
@ -163,8 +166,9 @@ class Hook extends BaseObject
* Use this function when you want to be able to allow a hook to manipulate
* the provided data.
*
* @param string $name of the hook to call
* @param string $name of the hook to call
* @param string|array &$data to transmit to the callback handler
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function callAll($name, &$data = null)
{
@ -178,10 +182,11 @@ class Hook extends BaseObject
/**
* @brief Calls a single hook.
*
* @param App $a
* @param string $name of the hook to call
* @param array $hook Hook data
* @param App $a
* @param string $name of the hook to call
* @param array $hook Hook data
* @param string|array &$data to transmit to the callback handler
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function callSingle(App $a, $name, $hook, &$data = null)
{

@ -47,6 +47,7 @@ class Installer
* Returns the PHP path
*
* @return string the PHP Path
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function getPHPPath()
{
@ -79,10 +80,11 @@ class Installer
/**
* Checks the current installation environment. There are optional and mandatory checks.
*
* @param string $baseurl The baseurl of Friendica
* @param string $phpath Optional path to the PHP binary
* @param string $baseurl The baseurl of Friendica
* @param string $phpath Optional path to the PHP binary
*
* @return bool if the check succeed
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function checkEnvironment($baseurl, $phpath = null)
{
@ -126,18 +128,19 @@ class Installer
* - Creates `config/local.config.php`
* - Installs Database Structure
*
* @param string $phppath Path to the PHP-Binary (optional, if not set e.g. 'php' or '/usr/bin/php')
* @param string $urlpath Path based on the URL of Friendica (e.g. '/friendica')
* @param string $dbhost Hostname/IP of the Friendica Database
* @param string $dbuser Username of the Database connection credentials
* @param string $dbpass Password of the Database connection credentials
* @param string $dbdata Name of the Database
* @param string $timezone Timezone of the Friendica Installaton (e.g. 'Europe/Berlin')
* @param string $language 2-letter ISO 639-1 code (eg. 'en')
* @param string $adminmail Mail-Adress of the administrator
* @param string $basepath The basepath of Friendica
* @param string $phppath Path to the PHP-Binary (optional, if not set e.g. 'php' or '/usr/bin/php')
* @param string $urlpath Path based on the URL of Friendica (e.g. '/friendica')
* @param string $dbhost Hostname/IP of the Friendica Database
* @param string $dbuser Username of the Database connection credentials
* @param string $dbpass Password of the Database connection credentials
* @param string $dbdata Name of the Database
* @param string $timezone Timezone of the Friendica Installaton (e.g. 'Europe/Berlin')
* @param string $language 2-letter ISO 639-1 code (eg. 'en')
* @param string $adminmail Mail-Adress of the administrator
* @param string $basepath The basepath of Friendica
*
* @return bool true if the config was created, otherwise false
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function createConfig($phppath, $urlpath, $dbhost, $dbuser, $dbpass, $dbdata, $timezone, $language, $adminmail, $basepath)
{
@ -167,6 +170,7 @@ class Installer
* Installs the DB-Scheme for Friendica
*
* @return bool true if the installation was successful, otherwise false
* @throws Exception
*/
public function installDatabase()
{
@ -212,11 +216,12 @@ class Installer
* - Checks if a PHP binary is available
* - Checks if it is the CLI version
* - Checks if "register_argc_argv" is enabled
*
* @param string $phppath Optional. The Path to the PHP-Binary
*
* @param string $phppath Optional. The Path to the PHP-Binary
* @param bool $required Optional. If set to true, the PHP-Binary has to exist (Default false)
*
* @return bool false if something required failed
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function checkPHP($phppath = null, $required = false)
{
@ -507,8 +512,9 @@ class Installer
*
* Checks, if "url_rewrite" is enabled in the ".htaccess" file
*
* @param string $baseurl The baseurl of the app
* @param string $baseurl The baseurl of the app
* @return bool false if something required failed
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function checkHtAccess($baseurl)
{
@ -576,12 +582,13 @@ class Installer
/**
* Checking the Database connection and if it is available for the current installation
*
* @param string $dbhost Hostname/IP of the Friendica Database
* @param string $dbuser Username of the Database connection credentials
* @param string $dbpass Password of the Database connection credentials
* @param string $dbdata Name of the Database
* @param string $dbhost Hostname/IP of the Friendica Database
* @param string $dbuser Username of the Database connection credentials
* @param string $dbpass Password of the Database connection credentials
* @param string $dbdata Name of the Database
*
* @return bool true if the check was successful, otherwise false
* @throws Exception
*/
public function checkDB($dbhost, $dbuser, $dbpass, $dbdata)
{

@ -90,6 +90,7 @@ class L10n extends BaseObject
/**
* @brief Returns the preferred language from the HTTP_ACCEPT_LANGUAGE header
* @return string The two-letter language code
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function detectLanguage()
{