Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
@@ -83,7 +83,7 @@ class NotificationHelper {
|
||||
$notification = $this->notificationManager->createNotification();
|
||||
$notification
|
||||
->setApp('deck')
|
||||
->setUser((string)$user->getUID())
|
||||
->setUser((string) $user->getUID())
|
||||
->setObject('card', $card->getId())
|
||||
->setSubject('card-overdue', [
|
||||
$card->getTitle(), $board->getTitle()
|
||||
@@ -98,7 +98,7 @@ class NotificationHelper {
|
||||
* Send notifications that a board was shared with a user/group
|
||||
*
|
||||
* @param $boardId
|
||||
* @param $acl
|
||||
* @param Acl $acl
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function sendBoardShared($boardId, $acl) {
|
||||
@@ -128,11 +128,14 @@ class NotificationHelper {
|
||||
return $this->boards[$boardId];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Board $board
|
||||
*/
|
||||
private function generateBoardShared($board, $userId) {
|
||||
$notification = $this->notificationManager->createNotification();
|
||||
$notification
|
||||
->setApp('deck')
|
||||
->setUser((string)$userId)
|
||||
->setUser((string) $userId)
|
||||
->setDateTime(new DateTime())
|
||||
->setObject('board', $board->getId())
|
||||
->setSubject('board-shared', [$board->getTitle(), $this->currentUser]);
|
||||
|
||||
@@ -66,25 +66,25 @@ class Notifier implements INotifier {
|
||||
*/
|
||||
public function prepare(INotification $notification, $languageCode) {
|
||||
$l = $this->l10nFactory->get('deck', $languageCode);
|
||||
if($notification->getApp() !== 'deck') {
|
||||
if ($notification->getApp() !== 'deck') {
|
||||
throw new \InvalidArgumentException();
|
||||
}
|
||||
$notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('deck', 'deck-dark.svg')));
|
||||
$params = $notification->getSubjectParameters();
|
||||
|
||||
switch($notification->getSubject()) {
|
||||
switch ($notification->getSubject()) {
|
||||
case 'card-overdue':
|
||||
$cardId = $notification->getObjectId();
|
||||
$boardId = $this->cardMapper->findBoardId($cardId);
|
||||
$notification->setParsedSubject(
|
||||
(string) $l->t('The card "%s" on "%s" has reached its due date.', $params)
|
||||
);
|
||||
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#!/board/'.$boardId.'//card/'.$cardId.'');
|
||||
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#!/board/' . $boardId . '//card/' . $cardId . '');
|
||||
break;
|
||||
case 'board-shared':
|
||||
$boardId = $notification->getObjectId();
|
||||
$initiator = $this->userManager->get($params[1]);
|
||||
if($initiator !== null) {
|
||||
if ($initiator !== null) {
|
||||
$dn = $initiator->getDisplayName();
|
||||
} else {
|
||||
$dn = $params[1];
|
||||
@@ -102,7 +102,7 @@ class Notifier implements INotifier {
|
||||
]
|
||||
]
|
||||
);
|
||||
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#!/board/'.$boardId.'/');
|
||||
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#!/board/' . $boardId . '/');
|
||||
break;
|
||||
}
|
||||
return $notification;
|
||||
|
||||
Reference in New Issue
Block a user