]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Widget.php
Fix removing falsy text nodes in HTML::tagToBBCodeSub
[friendica.git] / src / Content / Widget.php
index a2a3b3257b583d8b329e2b7ac297d4d0918c1e93..f1f62c33fc9141ca98e96989394088115ce25767 100644 (file)
@@ -225,7 +225,7 @@ class Widget
         * @return string
         * @throws \Exception
         */
-       public static function contactRels($baseurl, $selected = '')
+       public static function contactRels(string $baseurl, string $selected = ''): string
        {
                if (!local_user()) {
                        return '';
@@ -256,7 +256,7 @@ class Widget
         * @return string
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function networks($baseurl, $selected = '')
+       public static function networks(string $baseurl, string $selected = ''): string
        {
                if (!local_user()) {
                        return '';
@@ -268,7 +268,7 @@ class Widget
 
                $r = DBA::select('contact', ['network'], $condition, ['group_by' => ['network'], 'order' => ['network']]);
 
-               $nets = array();
+               $nets = [];
                while ($rr = DBA::fetch($r)) {
                        $nets[] = ['ref' => $rr['network'], 'name' => ContactSelector::networkToName($rr['network'])];
                }
@@ -294,10 +294,10 @@ class Widget
         *
         * @param string $baseurl  baseurl
         * @param string $selected optional, default empty
-        * @return string|void
+        * @return string
         * @throws \Exception
         */
-       public static function fileAs($baseurl, $selected = '')
+       public static function fileAs(string $baseurl, string $selected = ''): string
        {
                if (!local_user()) {
                        return '';
@@ -325,16 +325,16 @@ class Widget
         * @param int    $uid      Id of the user owning the categories
         * @param string $baseurl  Base page URL
         * @param string $selected Selected category
-        * @return string|void
+        * @return string
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function categories(int $uid, string $baseurl, string $selected = '')
+       public static function categories(int $uid, string $baseurl, string $selected = ''): string
        {
                if (!Feature::isEnabled($uid, 'categories')) {
                        return '';
                }
 
-               $terms = array();
+               $terms = [];
                foreach (Post\Category::getArray($uid, Post\Category::CATEGORY) as $savedFolderName) {
                        $terms[] = ['ref' => $savedFolderName, 'name' => $savedFolderName];
                }
@@ -355,11 +355,11 @@ class Widget
         *
         * @param int    $uid      Viewed profile user ID
         * @param string $nickname Viewed profile user nickname
-        * @return string|void
+        * @return string
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public static function commonFriendsVisitor(int $uid, string $nickname)
+       public static function commonFriendsVisitor(int $uid, string $nickname): string
        {
                if (local_user() == $uid) {
                        return '';
@@ -416,7 +416,7 @@ class Widget
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public static function tagCloud(int $uid, int $limit = 50)
+       public static function tagCloud(int $uid, int $limit = 50): string
        {
                if (empty($uid)) {
                        return '';
@@ -441,7 +441,7 @@ class Widget
         * @return string
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function postedByYear(string $url, int $uid, bool $wall)
+       public static function postedByYear(string $url, int $uid, bool $wall): string
        {
                $o = '';
 
@@ -512,10 +512,10 @@ class Widget
         * The account type value is added as a parameter to the url
         *
         * @param string $base        Basepath
-        * @param int    $accounttype Acount type
+        * @param string $accounttype Account type
         * @return string
         */
-       public static function accounttypes(string $base, $accounttype)
+       public static function accountTypes(string $base, string $accounttype): string
        {
                $accounts = [
                        ['ref' => 'person', 'name' => DI::l10n()->t('Persons')],