Browse Source

Fix PHPDoc comments project-wide

pull/6482/head
Hypolite Petovan 2 years ago
parent
commit
3282ce5389
113 changed files with 1703 additions and 795 deletions
  1. +17
    -1
      src/App.php
  2. +1
    -1
      src/App/Mode.php
  3. +1
    -0
      src/BaseObject.php
  4. +6
    -0
      src/Content/ContactSelector.php
  5. +3
    -0
      src/Content/Feature.php
  6. +10
    -5
      src/Content/ForumManager.php
  7. +12
    -5
      src/Content/Nav.php
  8. +8
    -2
      src/Content/OEmbed.php
  9. +3
    -1
      src/Content/Pager.php
  10. +9
    -4
      src/Content/Smilies.php
  11. +30
    -20
      src/Content/Text/BBCode.php
  12. +28
    -19
      src/Content/Text/HTML.php
  13. +3
    -0
      src/Content/Text/Markdown.php
  14. +3
    -3
      src/Content/Text/Plaintext.php
  15. +13
    -1
      src/Content/Widget.php
  16. +1
    -0
      src/Content/Widget/CalendarExport.php
  17. +15
    -13
      src/Content/Widget/TagCloud.php
  18. +14
    -9
      src/Core/ACL.php
  19. +13
    -5
      src/Core/Addon.php
  20. +9
    -6
      src/Core/Authentication.php
  21. +5
    -1
      src/Core/Cache.php
  22. +3
    -2
      src/Core/Cache/AbstractCacheDriver.php
  23. +5
    -1
      src/Core/Config.php
  24. +3
    -3
      src/Core/Config/IConfigAdapter.php
  25. +1
    -0
      src/Core/Console/AutomaticInstallation.php
  26. +3
    -0
      src/Core/Console/PhpToPo.php
  27. +12
    -7
      src/Core/Hook.php
  28. +26
    -19
      src/Core/Installer.php
  29. +11
    -3
      src/Core/L10n.php
  30. +25
    -21
      src/Core/Logger.php
  31. +52
    -38
      src/Core/NotificationsManager.php
  32. +6
    -2
      src/Core/PConfig.php
  33. +5
    -3
      src/Core/Protocol.php
  34. +10
    -8
      src/Core/Renderer.php
  35. +1
    -0
      src/Core/Session/CacheSessionHandler.php
  36. +1
    -0
      src/Core/Session/DatabaseSessionHandler.php
  37. +10
    -6
      src/Core/StorageManager.php
  38. +12
    -3
      src/Core/System.php
  39. +3
    -1
      src/Core/Theme.php
  40. +9
    -5
      src/Core/Update.php
  41. +8
    -3
      src/Core/UserImport.php
  42. +27
    -2
      src/Core/Worker.php
  43. +32
    -16
      src/Database/DBA.php
  44. +4
    -1
      src/Database/DBStructure.php
  45. +5
    -0
      src/Database/PostUpdate.php
  46. +2
    -0
      src/LegacyModule.php
  47. +3
    -0
      src/Model/APContact.php
  48. +46
    -28
      src/Model/Attach.php
  49. +63
    -16
      src/Model/Contact.php
  50. +1
    -0
      src/Model/Conversation.php
  51. +16
    -6
      src/Model/Event.php
  52. +32
    -29
      src/Model/FileTag.php
  53. +24
    -5
      src/Model/GContact.php
  54. +32
    -19
      src/Model/Group.php
  55. +101
    -56
      src/Model/Item.php
  56. +3
    -2
      src/Model/ItemContent.php
  57. +4
    -0
      src/Model/ItemDeliveryData.php
  58. +2
    -0
      src/Model/ItemURI.php
  59. +5
    -0
      src/Model/Mail.php
  60. +7
    -4
      src/Model/OpenWebAuthToken.php
  61. +3
    -1
      src/Model/PermissionSet.php
  62. +47
    -29
      src/Model/Photo.php
  63. +2
    -0
      src/Model/Process.php
  64. +23
    -11
      src/Model/Profile.php
  65. +9
    -4
      src/Model/PushSubscriber.php
  66. +4
    -0
      src/Model/Queue.php
  67. +9
    -2
      src/Model/Register.php
  68. +2
    -1
      src/Model/Storage/Filesystem.php
  69. +7
    -1
      src/Model/Term.php
  70. +24
    -13
      src/Model/User.php
  71. +5
    -5
      src/Module/Contact.php
  72. +1
    -0
      src/Module/Install.php
  73. +8
    -5
      src/Module/Login.php
  74. +17
    -11
      src/Module/Proxy.php
  75. +3
    -1
      src/Module/Tos.php
  76. +1
    -0
      src/Network/CurlResult.php
  77. +1
    -0
      src/Network/FKOAuth1.php
  78. +5
    -0
      src/Network/FKOAuthDataStore.php
  79. +19
    -0
      src/Network/Probe.php
  80. +13
    -3
      src/Object/Image.php
  81. +8
    -0
      src/Object/Post.php
  82. +8
    -4
      src/Object/Thread.php
  83. +6
    -2
      src/Protocol/ActivityPub.php
  84. +30
    -6
      src/Protocol/ActivityPub/Processor.php
  85. +33
    -17
      src/Protocol/ActivityPub/Receiver.php
  86. +77
    -35
      src/Protocol/ActivityPub/Transmitter.php
  87. +68
    -26
      src/Protocol/DFRN.php
  88. +110
    -15
      src/Protocol/Diaspora.php
  89. +5
    -0
      src/Protocol/Email.php
  90. +6
    -5
      src/Protocol/Feed.php
  91. +119
    -74
      src/Protocol/OStatus.php
  92. +7
    -2
      src/Protocol/PortableContact.php
  93. +3
    -0
      src/Protocol/Salmon.php
  94. +36
    -25
      src/Util/Crypto.php
  95. +8
    -1
      src/Util/DateTimeFormat.php
  96. +9
    -8
      src/Util/Emailer.php
  97. +8
    -4
      src/Util/ExAuth.php
  98. +13
    -6
      src/Util/HTTPSignature.php
  99. +8
    -5
      src/Util/JsonLD.php
  100. +13
    -3
      src/Util/Network.php

+ 17
- 1
src/App.php View File

@ -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)
{

+ 1
- 1
src/App/Mode.php View File

@ -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)
{

+ 1
- 0
src/BaseObject.php View File

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

+ 6
- 0
src/Content/ContactSelector.php View File

@ -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 = "")
{

+ 3
- 0
src/Content/Feature.php View File

@ -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)
{

+ 10
- 5
src/Content/ForumManager.php View File

@ -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)
{

+ 12
- 5
src/Content/Nav.php View File

@ -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)
{

+ 8
- 2
src/Content/OEmbed.php View File

@ -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)
{

+ 3
- 1
src/Content/Pager.php View File

@ -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)
{

+ 9
- 4
src/Content/Smilies.php View File

@ -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)
{

+ 30
- 20
src/Content/Text/BBCode.php View File

@ -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)
{

+ 28
- 19
src/Content/Text/HTML.php View File

@ -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)
{

+ 3
- 0
src/Content/Text/Markdown.php View File

@ -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)
{

+ 3
- 3
src/Content/Text/Plaintext.php View File

@ -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.
*/

+ 13
- 1
src/Content/Widget.php View File

@ -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)
{

+ 1
- 0
src/Content/Widget/CalendarExport.php View File

@ -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();

+ 15
- 13
src/Content/Widget/TagCloud.php View File

@ -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
*/

+ 14
- 9
src/Core/ACL.php View File

@ -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)
{

+ 13
- 5
src/Core/Addon.php View File

@ -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)
{

+ 9
- 6
src/Core/Authentication.php View File

@ -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)
{

+ 5
- 1
src/Core/Cache.php View File

@ -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)
{

+ 3
- 2
src/Core/Cache/AbstractCacheDriver.php View File

@ -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)
{

+ 5
- 1
src/Core/Config.php View File

@ -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)
{

+ 3
- 3
src/Core/Config/IConfigAdapter.php View File

@ -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
*/

+ 1
- 0
src/Core/Console/AutomaticInstallation.php View File

@ -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)
{

+ 3
- 0
src/Core/Console/PhpToPo.php View File

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

+ 12
- 7
src/Core/Hook.php View File

@ -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)
{

+ 26
- 19
src/Core/Installer.php View File