* @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 = '';
* @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];
* @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'),
/**
* @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',
* @return string formatted text
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public function formatActivity(array $links, $verb, $id)
+ public function formatActivity(array $links, string $verb, int $id): string
{
$this->profiler->startRecording('rendering');
$o = '';
return $o;
}
- public function statusEditor(array $x = [], $notes_cid = 0, $popup = false)
+ public function statusEditor(array $x = [], int $notes_cid = 0, bool $popup = false): string
{
$user = User::getById($this->app->getLoggedInUserId(), ['uid', 'nickname', 'allow_location', 'default-location']);
if (empty($user['uid'])) {
* figures out how to determine page owner and other contextual items
* that are based on unique features of the calling module.
* @param array $items
- * @param $mode
- * @param $update
+ * @param string $mode
+ * @param $update @TODO Which type?
* @param bool $preview
* @param string $order
* @param int $uid
* @throws ImagickException
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public function create(array $items, $mode, $update, $preview = false, $order = 'commented', $uid = 0)
+ public function create(array $items, string $mode, $update, bool $preview = false, string $order = 'commented', int $uid = 0): string
{
$this->profiler->startRecording('rendering');
return $o;
}
- private function getBlocklist()
+ private function getBlocklist(): array
{
if (!local_user()) {
return [];
*
* @return array items with parents and comments
*/
- private function addRowInformation(array $row, array $activity, array $thr_parent)
+ private function addRowInformation(array $row, array $activity, array $thr_parent): array
{
$this->profiler->startRecording('rendering');
* @return array items with parents and comments
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- private function addChildren(array $parents, bool $block_authors, string $order, int $uid, string $mode)
+ private function addChildren(array $parents, bool $block_authors, string $order, int $uid, string $mode): array
{
$this->profiler->startRecording('rendering');
if (count($parents) > 1) {
* @param bool $recursive
* @return array
*/
- private function getItemChildren(array &$item_list, array $parent, $recursive = true)
+ private function getItemChildren(array &$item_list, array $parent, bool $recursive = true): array
{
$this->profiler->startRecording('rendering');
$children = [];
* @param array $items
* @return array
*/
- private function sortItemChildren(array $items)
+ private function sortItemChildren(array $items): array
{
$this->profiler->startRecording('rendering');
$result = $items;
* @param array $parent A tree-like array of items
* @return array
*/
- private function smartFlattenConversation(array $parent)
+ private function smartFlattenConversation(array $parent): array
{
$this->profiler->startRecording('rendering');
if (!isset($parent['children']) || count($parent['children']) == 0) {
* @return array
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- private function convSort(array $item_list, $order)
+ private function convSort(array $item_list, string $order): array
{
$this->profiler->startRecording('rendering');
$parents = [];
* @param array $b
* @return int
*/
- private function sortThrFeaturedReceived(array $a, array $b)
+ private function sortThrFeaturedReceived(array $a, array $b): int
{
if ($b['featured'] && !$a['featured']) {
return 1;
* @param array $b
* @return int
*/
- private function sortThrFeaturedCommented(array $a, array $b)
+ private function sortThrFeaturedCommented(array $a, array $b): int
{
if ($b['featured'] && !$a['featured']) {
return 1;
* @param array $b
* @return int
*/
- private function sortThrReceived(array $a, array $b)
+ private function sortThrReceived(array $a, array $b): int
{
return strcmp($b['received'], $a['received']);
}
* @param array $b
* @return int
*/
- private function sortThrReceivedRev(array $a, array $b)
+ private function sortThrReceivedRev(array $a, array $b): int
{
return strcmp($a['received'], $b['received']);
}
* @param array $b
* @return int
*/
- private function sortThrCommented(array $a, array $b)
+ private function sortThrCommented(array $a, array $b): int
{
return strcmp($b['commented'], $a['commented']);
}
* @param array $b
* @return int
*/
- private function sortThrCreated(array $a, array $b)
+ private function sortThrCreated(array $a, array $b): int
{
return strcmp($b['created'], $a['created']);
}
* @param string $filename File to open
* @return $this
*/
- public function open(string $filename)
+ public function open(string $filename): ParsedLogIterator
{
$this->reader->open($filename);
return $this;
* @param int $limit Max num of lines to read
* @return $this
*/
- public function withLimit(int $limit)
+ public function withLimit(int $limit): ParsedLogIterator
{
$this->limit = $limit;
return $this;
* @param array $filters filters per column
* @return $this
*/
- public function withFilters(array $filters)
+ public function withFilters(array $filters): ParsedLogIterator
{
$this->filters = $filters;
return $this;
* @param string $search string to search to filter lines
* @return $this
*/
- public function withSearch(string $search)
+ public function withSearch(string $search): ParsedLogIterator
{
$this->search = $search;
return $this;
* Check if parsed log line match filters.
* Always match if no filters are set.
*
- * @param ParsedLogLine $parsedlogline
- * @return bool
+ * @param ParsedLogLine $parsedlogline ParsedLogLine instance
+ * @return bool Wether the parse log line matches
*/
- private function filter($parsedlogline)
+ private function filter(ParsedLogLine $parsedlogline): bool
{
$match = true;
foreach ($this->filters as $filter => $filtervalue) {
* @param ParsedLogLine $parsedlogline
* @return bool
*/
- private function search($parsedlogline)
+ private function search(ParsedLogLine $parsedlogline): bool
{
if ($this->search != "") {
return strstr($parsedlogline->logline, $this->search) !== false;