* Determines network name
*
* @param string $network network of the contact
- * @param string $profile optional, default empty
* @param string $protocol (Optional) Protocol that is used for the transmission
* @param int $gsid Server id
- * @return string
+ *
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function networkToName(string $network, string $protocol = '', int $gsid = null): string
use Friendica\Util\Profiler;
use Friendica\Util\Strings;
use Friendica\Util\Temporal;
+use ImagickException;
use Psr\Log\LoggerInterface;
class Conversation
* @param array &$conv_responses (already created with builtin activity structure)
* @return void
* @throws ImagickException
- * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+ * @throws InternalServerErrorException
*/
public function builtinActivityPuller(array $activity, array &$conv_responses)
{
* @param string $formSecurityToken A 'contact_action' form security token
* @return array
* @throws InternalServerErrorException
- * @throws \ImagickException
+ * @throws ImagickException
*/
public function getThreadList(array $items, string $mode, bool $preview, bool $pagedrop, string $formSecurityToken): array
{
use Friendica\Content\Image\Entity\MasonryImage;
use Friendica\Content\Post\Collection\PostMedias;
use Friendica\Core\Renderer;
+use Friendica\Network\HTTPException\ServiceUnavailableException;
class Image
{
}
/**
- * @param PostMedias $images
- * @return string
- * @throws \Friendica\Network\HTTPException\ServiceUnavailableException
+ * @throws ServiceUnavailableException
*/
private static function getImageGridHtml(PostMedias $images): string
{
* For each row, we calculate how much of the total width each picture will take depending on their aspect ratio
* and how much relative height it needs to accomodate all pictures next to each other with their height normalized.
*
- * @param array $images
- * @return string
- * @throws \Friendica\Network\HTTPException\ServiceUnavailableException
+ * @throws ServiceUnavailableException
*/
private static function getHorizontalMasonryHtml(PostMedias $images): string
{
use Friendica\Model\Tag;
use Friendica\Model\User;
use Friendica\Network\HTTPException;
+use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Object\EMail\ItemCCEMail;
use Friendica\Protocol\Activity;
use Friendica\Util\ACLFormatter;
use Friendica\Util\Proxy;
use Friendica\Util\XML;
use GuzzleHttp\Psr7\Uri;
+use ImagickException;
/**
* A content helper class for displaying items
* @param string $network The network of the post
*
* @return array|bool ['replaced' => $replaced, 'contact' => $contact] or "false" on if already replaced
- * @throws \Friendica\Network\HTTPException\InternalServerErrorException
- * @throws \ImagickException
+ * @throws InternalServerErrorException
+ * @throws ImagickException
*/
public static function replaceTag(string &$body, int $profile_uid, string $tag, string $network = '')
{
* @param array $item
* @return void
* @throws ImagickException
- * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+ * @throws InternalServerErrorException
*/
public function localize(array &$item)
{
/**
* Add a share block for the given guid
- *
- * @param string $guid
- * @param integer $uid
- * @param bool $add_media
- * @return string
*/
private function createSharedPostByGuid(string $guid, bool $add_media): string
{
namespace Friendica\Content;
use DOMDocument;
+use DOMElement;
use DOMXPath;
use Exception;
use Friendica\Content\Text\BBCode;
$xpath->query("//link[@type='application/json+oembed'] | //link[@type='text/json+oembed']")
as $link)
{
+ /** @var DOMElement $link */
$href = $link->getAttributeNode('href')->nodeValue;
// Both Youtube and Vimeo output OEmbed endpoint URL with HTTP
// but their OEmbed endpoint is only accessible by HTTPS ¯\_(ツ)_/¯
* Get preview path for given media id relative to the base URL
*
* @param string $size One of the Proxy::SIZE_* constants
- * @param bool $vlurred If "true", the preview will be blurred
+ * @param bool $blurred If "true", the preview will be blurred
* @return string preview link
*/
public function getPreviewPath(string $size = '', bool $blurred = false): string
/**
* Convert complex IMG and ZMG elements
- *
- * @param [type] $text
- * @param integer $simplehtml
- * @param integer $uriid
- * @return string
*/
private static function convertImages(string $text, int $simplehtml, int $uriid = 0): string
{
/**
* Removes links
*
- * @param string $text HTML/BBCode string
+ * @param string $bbcode HTML/BBCode string
* @return string Cleaned HTML/BBCode
*/
public static function removeLinks(string $bbcode): string
$text = $HTMLPurifier->purify($text);
- /** @var \HTMLPurifier_ErrorCollector $errorCollector */
+ ///** @var \HTMLPurifier_ErrorCollector $errorCollector */
// Uncomment to debug HTML Purifier behavior
//$errorCollector = $HTMLPurifier->context->get('ErrorCollector');
//var_dump($errorCollector->getRaw());