rename methods

This commit is contained in:
Philipp Holzer 2019-10-26 05:02:14 +02:00
parent fdc0236aa1
commit 3465bd9f11
No known key found for this signature in database
GPG Key ID: D8365C3D36B77D90
2 changed files with 17 additions and 17 deletions

View File

@ -112,27 +112,27 @@ function notifications_content(App $a)
$all = (($a->argc > 2) && ($a->argv[2] == 'all')); $all = (($a->argc > 2) && ($a->argv[2] == 'all'));
$notifs = $nm->getIntroNotifies($all, $startrec, $perpage, $id); $notifs = $nm->getIntroList($all, $startrec, $perpage, $id);
// Get the network notifications // Get the network notifications
} elseif (($a->argc > 1) && ($a->argv[1] == 'network')) { } elseif (($a->argc > 1) && ($a->argv[1] == 'network')) {
$notif_header = L10n::t('Network Notifications'); $notif_header = L10n::t('Network Notifications');
$notifs = $nm->getNetworkNotifies($show, $startrec, $perpage); $notifs = $nm->getNetworkList($show, $startrec, $perpage);
// Get the system notifications // Get the system notifications
} elseif (($a->argc > 1) && ($a->argv[1] == 'system')) { } elseif (($a->argc > 1) && ($a->argv[1] == 'system')) {
$notif_header = L10n::t('System Notifications'); $notif_header = L10n::t('System Notifications');
$notifs = $nm->getSystemNotifies($show, $startrec, $perpage); $notifs = $nm->getSystemList($show, $startrec, $perpage);
// Get the personal notifications // Get the personal notifications
} elseif (($a->argc > 1) && ($a->argv[1] == 'personal')) { } elseif (($a->argc > 1) && ($a->argv[1] == 'personal')) {
$notif_header = L10n::t('Personal Notifications'); $notif_header = L10n::t('Personal Notifications');
$notifs = $nm->getPersonalNotifies($show, $startrec, $perpage); $notifs = $nm->getPersonalList($show, $startrec, $perpage);
// Get the home notifications // Get the home notifications
} elseif (($a->argc > 1) && ($a->argv[1] == 'home')) { } elseif (($a->argc > 1) && ($a->argv[1] == 'home')) {
$notif_header = L10n::t('Home Notifications'); $notif_header = L10n::t('Home Notifications');
$notifs = $nm->getHomeNotifies($show, $startrec, $perpage); $notifs = $nm->getHomeList($show, $startrec, $perpage);
// fallback - redirect to main page // fallback - redirect to main page
} else { } else {
$a->internalRedirect('notifications'); $a->internalRedirect('notifications');

View File

@ -238,7 +238,7 @@ final class Notify extends BaseObject
* bool 'seen' => Is the notification marked as "seen" * bool 'seen' => Is the notification marked as "seen"
* @throws Exception * @throws Exception
*/ */
private function formatNotifies(array $notifies, string $ident = "") private function formatList(array $notifies, string $ident = "")
{ {
$formattedNotifies = []; $formattedNotifies = [];
@ -422,7 +422,7 @@ final class Notify extends BaseObject
* *
* @throws Exception * @throws Exception
*/ */
public function getNetworkNotifies(bool $seen = false, int $start = 0, int $limit = self::DEFAULT_PAGE_LIMIT) public function getNetworkList(bool $seen = false, int $start = 0, int $limit = self::DEFAULT_PAGE_LIMIT)
{ {
$ident = self::NETWORK; $ident = self::NETWORK;
$notifies = []; $notifies = [];
@ -440,7 +440,7 @@ final class Notify extends BaseObject
$items = Item::selectForUser(local_user(), $fields, $condition, $params); $items = Item::selectForUser(local_user(), $fields, $condition, $params);
if ($this->dba->isResult($items)) { if ($this->dba->isResult($items)) {
$notifies = $this->formatNotifies(Item::inArray($items), $ident); $notifies = $this->formatList(Item::inArray($items), $ident);
} }
$arr = [ $arr = [
@ -465,7 +465,7 @@ final class Notify extends BaseObject
* *
* @throws Exception * @throws Exception
*/ */
public function getSystemNotifies(bool $seen = false, int $start = 0, int $limit = self::DEFAULT_PAGE_LIMIT) public function getSystemList(bool $seen = false, int $start = 0, int $limit = self::DEFAULT_PAGE_LIMIT)
{ {
$ident = self::SYSTEM; $ident = self::SYSTEM;
$notifies = []; $notifies = [];
@ -485,7 +485,7 @@ final class Notify extends BaseObject
$params); $params);
if ($this->dba->isResult($stmtNotifies)) { if ($this->dba->isResult($stmtNotifies)) {
$notifies = $this->formatNotifies($this->dba->toArray($stmtNotifies), $ident); $notifies = $this->formatList($this->dba->toArray($stmtNotifies), $ident);
} }
$arr = [ $arr = [
@ -510,7 +510,7 @@ final class Notify extends BaseObject
* *
* @throws Exception * @throws Exception
*/ */
public function getPersonalNotifies(bool $seen = false, int $start = 0, int $limit = self::DEFAULT_PAGE_LIMIT) public function getPersonalList(bool $seen = false, int $start = 0, int $limit = self::DEFAULT_PAGE_LIMIT)
{ {
$ident = self::PERSONAL; $ident = self::PERSONAL;
$notifies = []; $notifies = [];
@ -532,7 +532,7 @@ final class Notify extends BaseObject
$items = Item::selectForUser(local_user(), $fields, $condition, $params); $items = Item::selectForUser(local_user(), $fields, $condition, $params);
if ($this->dba->isResult($items)) { if ($this->dba->isResult($items)) {
$notifies = $this->formatNotifies(Item::inArray($items), $ident); $notifies = $this->formatList(Item::inArray($items), $ident);
} }
$arr = [ $arr = [
@ -557,7 +557,7 @@ final class Notify extends BaseObject
* *
* @throws Exception * @throws Exception
*/ */
public function getHomeNotifies(bool $seen = false, int $start = 0, int $limit = self::DEFAULT_PAGE_LIMIT) public function getHomeList(bool $seen = false, int $start = 0, int $limit = self::DEFAULT_PAGE_LIMIT)
{ {
$ident = self::HOME; $ident = self::HOME;
$notifies = []; $notifies = [];
@ -575,7 +575,7 @@ final class Notify extends BaseObject
$items = Item::selectForUser(local_user(), $fields, $condition, $params); $items = Item::selectForUser(local_user(), $fields, $condition, $params);
if ($this->dba->isResult($items)) { if ($this->dba->isResult($items)) {
$notifies = $this->formatNotifies(Item::inArray($items), $ident); $notifies = $this->formatList(Item::inArray($items), $ident);
} }
$arr = [ $arr = [
@ -602,7 +602,7 @@ final class Notify extends BaseObject
* @throws ImagickException * @throws ImagickException
* @throws Exception * @throws Exception
*/ */
public function getIntroNotifies(bool $all = false, int $start = 0, int $limit = self::DEFAULT_PAGE_LIMIT, int $id = 0) public function getIntroList(bool $all = false, int $start = 0, int $limit = self::DEFAULT_PAGE_LIMIT, int $id = 0)
{ {
/// @todo sanitize wording according to SELF::INTRO /// @todo sanitize wording according to SELF::INTRO
$ident = 'introductions'; $ident = 'introductions';
@ -638,7 +638,7 @@ final class Notify extends BaseObject
$limit $limit
); );
if ($this->dba->isResult($stmtNotifies)) { if ($this->dba->isResult($stmtNotifies)) {
$notifies = $this->formatIntros($this->dba->toArray($stmtNotifies)); $notifies = $this->formatIntroList($this->dba->toArray($stmtNotifies));
} }
$arr = [ $arr = [
@ -658,7 +658,7 @@ final class Notify extends BaseObject
* @throws HTTPException\InternalServerErrorException * @throws HTTPException\InternalServerErrorException
* @throws ImagickException * @throws ImagickException
*/ */
private function formatIntros(array $intros) private function formatIntroList(array $intros)
{ {
$knowyou = ''; $knowyou = '';