Another incompatible method declaration fixed + type-hints added

This commit is contained in:
Roland Häder 2022-06-16 18:36:56 +02:00
parent 40d7f29a11
commit 2c5595c358
2 changed files with 9 additions and 7 deletions

View File

@ -45,7 +45,7 @@ class Widget
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @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( return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/follow.tpl'), array(
'$connect' => DI::l10n()->t('Add New Contact'), '$connect' => DI::l10n()->t('Add New Contact'),
@ -58,8 +58,10 @@ class Widget
/** /**
* Return Find People 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(); $global_dir = Search::getGlobalDirectory();
@ -97,7 +99,7 @@ class Widget
* *
* @return array Unsupported networks * @return array Unsupported networks
*/ */
public static function unavailableNetworks() public static function unavailableNetworks(): array
{ {
// Always hide content from these networks // Always hide content from these networks
$networks = [Protocol::PHANTOM, Protocol::FACEBOOK, Protocol::APPNET, Protocol::ZOT]; $networks = [Protocol::PHANTOM, Protocol::FACEBOOK, Protocol::APPNET, Protocol::ZOT];
@ -154,7 +156,7 @@ class Widget
* @return string * @return string
* @throws \Exception * @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); $queryString = parse_url($baseUrl, PHP_URL_QUERY);
$queryArray = []; $queryArray = [];
@ -191,7 +193,7 @@ class Widget
* @return string * @return string
* @throws \Exception * @throws \Exception
*/ */
public static function groups($baseurl, $selected = '') public static function groups(string $baseurl, string $selected = ''): string
{ {
if (!local_user()) { if (!local_user()) {
return ''; return '';

View File

@ -43,9 +43,9 @@ class ProfileFields extends BaseCollection
/** /**
* @param callable|null $callback * @param callable|null $callback
* @param int $flag * @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); return parent::filter($callback, $flag);
} }