Continued:

- more type-hints
- fixed incompatible method declarations
This commit is contained in:
Roland Häder 2022-06-16 18:28:38 +02:00
parent 1edc6b3c3b
commit 40d7f29a11
6 changed files with 37 additions and 35 deletions

View file

@ -41,7 +41,7 @@ class ContactSelector
* @param boolean $disabled optional, default false
* @return string
*/
public static function pollInterval($current, $disabled = false)
public static function pollInterval(string $current, bool $disabled = false): string
{
$dis = (($disabled) ? ' disabled="disabled" ' : '');
$o = '';
@ -84,7 +84,7 @@ class ContactSelector
* @return string Server URL
* @throws \Exception
*/
private static function getServerURLForProfile($profile)
private static function getServerURLForProfile(string $profile): string
{
if (!empty(self::$server_url[$profile])) {
return self::$server_url[$profile];
@ -114,10 +114,11 @@ class ContactSelector
* @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 ??? (@TODO)
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function networkToName($network, $profile = '', $protocol = '', $gsid = 0)
public static function networkToName(string $network, string $profile = '', string $protocol = '', int $gsid = 0): string
{
$nets = [
Protocol::DFRN => DI::l10n()->t('DFRN'),
@ -181,10 +182,11 @@ class ContactSelector
/**
* @param string $network network
* @param string $profile optional, default empty
* @param int $gsid ??? (@TODO)
* @return string
* @throws \Exception
*/
public static function networkToIcon($network, $profile = "", $gsid = 0)
public static function networkToIcon(string $network, string $profile = "", int $gsid = 0): string
{
$nets = [
Protocol::DFRN => 'friendica',