]> git.mxchange.org Git - friendica.git/commitdiff
Another incompatible method declaration fixed + type-hints added
authorRoland Häder <roland@mxchange.org>
Thu, 16 Jun 2022 16:36:56 +0000 (18:36 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 17 Jun 2022 15:18:31 +0000 (17:18 +0200)
src/Content/Widget.php
src/Profile/ProfileField/Collection/ProfileFields.php

index 1b2502d2d65e08a66de4110ca9f3cbf3acba23fd..22772d2b2ea3c72d34f02cd2b085716482c92834 100644 (file)
@@ -45,7 +45,7 @@ class Widget
         * @return string
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function follow($value = "")
+       public static function follow(string $value = ""): string
        {
                return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/follow.tpl'), array(
                        '$connect' => DI::l10n()->t('Add New Contact'),
@@ -58,8 +58,10 @@ class Widget
 
        /**
         * Return Find People widget
+        *
+        * @return string HTML code respresenting "People Widget"
         */
-       public static function findPeople()
+       public static function findPeople(): string
        {
                $global_dir = Search::getGlobalDirectory();
 
@@ -97,7 +99,7 @@ class Widget
         *
         * @return array Unsupported networks
         */
-       public static function unavailableNetworks()
+       public static function unavailableNetworks(): array
        {
                // Always hide content from these networks
                $networks = [Protocol::PHANTOM, Protocol::FACEBOOK, Protocol::APPNET, Protocol::ZOT];
@@ -154,7 +156,7 @@ class Widget
         * @return string
         * @throws \Exception
         */
-       private static function filter($type, $title, $desc, $all, $baseUrl, array $options, $selected = null)
+       private static function filter(string $type, string $title, string $desc, string $all, string $baseUrl, array $options, string $selected = null): string
        {
                $queryString = parse_url($baseUrl, PHP_URL_QUERY);
                $queryArray = [];
@@ -191,7 +193,7 @@ class Widget
         * @return string
         * @throws \Exception
         */
-       public static function groups($baseurl, $selected = '')
+       public static function groups(string $baseurl, string $selected = ''): string
        {
                if (!local_user()) {
                        return '';
index 906b690fa2edd0e16f2a3ecb03cf70980052d5ed..f04aaa65da2a061ac38454dc06d981c8ae4cb52b 100644 (file)
@@ -43,9 +43,9 @@ class ProfileFields extends BaseCollection
        /**
         * @param callable|null $callback
         * @param int           $flag
-        * @return ProfileFields
+        * @return ProfileFields as an extended version of BaseCollection
         */
-       public function filter(callable $callback = null, int $flag = 0): ProfileFields
+       public function filter(callable $callback = null, int $flag = 0): BaseCollection
        {
                return parent::filter($callback, $flag);
        }