Code Duplication    Length = 3-3 lines in 24 locations

lib/Activity/ActivityManager.php 24 locations

@@ 132-134 (lines=3) @@
129
	public function getActivityFormat($subjectIdentifier, $subjectParams = [], $ownActivity = false) {
130
		$subject = '';
131
		switch ($subjectIdentifier) {
132
			case self::SUBJECT_BOARD_CREATE:
133
				$subject = $ownActivity ? $this->l10n->t('You have created a new board {board}'): $this->l10n->t('{user} has created a new board {board}');
134
				break;
135
			case self::SUBJECT_BOARD_DELETE:
136
				$subject = $ownActivity ? $this->l10n->t('You have deleted the board {board}') : $this->l10n->t('{user} has deleted the board {board}');
137
				break;
@@ 135-137 (lines=3) @@
132
			case self::SUBJECT_BOARD_CREATE:
133
				$subject = $ownActivity ? $this->l10n->t('You have created a new board {board}'): $this->l10n->t('{user} has created a new board {board}');
134
				break;
135
			case self::SUBJECT_BOARD_DELETE:
136
				$subject = $ownActivity ? $this->l10n->t('You have deleted the board {board}') : $this->l10n->t('{user} has deleted the board {board}');
137
				break;
138
			case self::SUBJECT_BOARD_RESTORE:
139
				$subject = $ownActivity ? $this->l10n->t('You have restored the board {board}') : $this->l10n->t('{user} has restored the board {board}');
140
				break;
@@ 138-140 (lines=3) @@
135
			case self::SUBJECT_BOARD_DELETE:
136
				$subject = $ownActivity ? $this->l10n->t('You have deleted the board {board}') : $this->l10n->t('{user} has deleted the board {board}');
137
				break;
138
			case self::SUBJECT_BOARD_RESTORE:
139
				$subject = $ownActivity ? $this->l10n->t('You have restored the board {board}') : $this->l10n->t('{user} has restored the board {board}');
140
				break;
141
			case self::SUBJECT_BOARD_SHARE:
142
				$subject = $ownActivity ? $this->l10n->t('You have shared the board {board} with {acl}') : $this->l10n->t('{user} has shared the board {board} with {sharee}');
143
				break;
@@ 141-143 (lines=3) @@
138
			case self::SUBJECT_BOARD_RESTORE:
139
				$subject = $ownActivity ? $this->l10n->t('You have restored the board {board}') : $this->l10n->t('{user} has restored the board {board}');
140
				break;
141
			case self::SUBJECT_BOARD_SHARE:
142
				$subject = $ownActivity ? $this->l10n->t('You have shared the board {board} with {acl}') : $this->l10n->t('{user} has shared the board {board} with {sharee}');
143
				break;
144
			case self::SUBJECT_BOARD_UNSHARE:
145
				$subject = $ownActivity ? $this->l10n->t('You have removed {acl} from the board {board}') : $this->l10n->t('{user} has removed {acl} from the board {board}');
146
				break;
@@ 144-146 (lines=3) @@
141
			case self::SUBJECT_BOARD_SHARE:
142
				$subject = $ownActivity ? $this->l10n->t('You have shared the board {board} with {acl}') : $this->l10n->t('{user} has shared the board {board} with {sharee}');
143
				break;
144
			case self::SUBJECT_BOARD_UNSHARE:
145
				$subject = $ownActivity ? $this->l10n->t('You have removed {acl} from the board {board}') : $this->l10n->t('{user} has removed {acl} from the board {board}');
146
				break;
147
148
			case self::SUBJECT_BOARD_UPDATE_TITLE:
149
				$subject = $ownActivity ? $this->l10n->t('You have renamed the board {before} to {board}') : $this->l10n->t('{user} has has renamed the board {before} to {board}');
@@ 148-150 (lines=3) @@
145
				$subject = $ownActivity ? $this->l10n->t('You have removed {acl} from the board {board}') : $this->l10n->t('{user} has removed {acl} from the board {board}');
146
				break;
147
148
			case self::SUBJECT_BOARD_UPDATE_TITLE:
149
				$subject = $ownActivity ? $this->l10n->t('You have renamed the board {before} to {board}') : $this->l10n->t('{user} has has renamed the board {before} to {board}');
150
				break;
151
			case self::SUBJECT_BOARD_UPDATE_ARCHIVED:
152
				if (isset($subjectParams['after']) && $subjectParams['after']) {
153
					$subject = $ownActivity ? $this->l10n->t('You have archived the board {board}') : $this->l10n->t('{user} has archived the board {before}');
@@ 159-161 (lines=3) @@
156
				}
157
				break;
158
159
			case self::SUBJECT_STACK_CREATE:
160
				$subject = $ownActivity ? $this->l10n->t('You have created a new stack {stack} on {board}') : $this->l10n->t('{user} has created a new stack {stack} on {board}');
161
				break;
162
			case self::SUBJECT_STACK_UPDATE:
163
				$subject = $ownActivity ? $this->l10n->t('You have created a new stack {stack} on {board}') : $this->l10n->t('{user} has created a new stack {stack} on {board}');
164
				break;
@@ 162-164 (lines=3) @@
159
			case self::SUBJECT_STACK_CREATE:
160
				$subject = $ownActivity ? $this->l10n->t('You have created a new stack {stack} on {board}') : $this->l10n->t('{user} has created a new stack {stack} on {board}');
161
				break;
162
			case self::SUBJECT_STACK_UPDATE:
163
				$subject = $ownActivity ? $this->l10n->t('You have created a new stack {stack} on {board}') : $this->l10n->t('{user} has created a new stack {stack} on {board}');
164
				break;
165
			case self::SUBJECT_STACK_UPDATE_TITLE:
166
				$subject = $ownActivity ? $this->l10n->t('You have renamed a new stack {before} to {stack} on {board}') : $this->l10n->t('{user} has renamed a new stack {before} to {stack} on {board}');
167
				break;
@@ 165-167 (lines=3) @@
162
			case self::SUBJECT_STACK_UPDATE:
163
				$subject = $ownActivity ? $this->l10n->t('You have created a new stack {stack} on {board}') : $this->l10n->t('{user} has created a new stack {stack} on {board}');
164
				break;
165
			case self::SUBJECT_STACK_UPDATE_TITLE:
166
				$subject = $ownActivity ? $this->l10n->t('You have renamed a new stack {before} to {stack} on {board}') : $this->l10n->t('{user} has renamed a new stack {before} to {stack} on {board}');
167
				break;
168
			case self::SUBJECT_STACK_DELETE:
169
				$subject = $ownActivity ? $this->l10n->t('You have deleted {stack} on {board}') : $this->l10n->t('{user} has deleted {stack} on {board}');
170
				break;
@@ 168-170 (lines=3) @@
165
			case self::SUBJECT_STACK_UPDATE_TITLE:
166
				$subject = $ownActivity ? $this->l10n->t('You have renamed a new stack {before} to {stack} on {board}') : $this->l10n->t('{user} has renamed a new stack {before} to {stack} on {board}');
167
				break;
168
			case self::SUBJECT_STACK_DELETE:
169
				$subject = $ownActivity ? $this->l10n->t('You have deleted {stack} on {board}') : $this->l10n->t('{user} has deleted {stack} on {board}');
170
				break;
171
			case self::SUBJECT_CARD_CREATE:
172
				$subject = $ownActivity ? $this->l10n->t('You have created {card} in {stack} on {board}') : $this->l10n->t('{user} has created {card} in {stack} on {board}');
173
				break;
@@ 171-173 (lines=3) @@
168
			case self::SUBJECT_STACK_DELETE:
169
				$subject = $ownActivity ? $this->l10n->t('You have deleted {stack} on {board}') : $this->l10n->t('{user} has deleted {stack} on {board}');
170
				break;
171
			case self::SUBJECT_CARD_CREATE:
172
				$subject = $ownActivity ? $this->l10n->t('You have created {card} in {stack} on {board}') : $this->l10n->t('{user} has created {card} in {stack} on {board}');
173
				break;
174
			case self::SUBJECT_CARD_DELETE:
175
				$subject = $ownActivity ? $this->l10n->t('You have deleted {card} in {stack} on {board}') : $this->l10n->t('{user} has deleted {card} in {stack} on {board}');
176
				break;
@@ 174-176 (lines=3) @@
171
			case self::SUBJECT_CARD_CREATE:
172
				$subject = $ownActivity ? $this->l10n->t('You have created {card} in {stack} on {board}') : $this->l10n->t('{user} has created {card} in {stack} on {board}');
173
				break;
174
			case self::SUBJECT_CARD_DELETE:
175
				$subject = $ownActivity ? $this->l10n->t('You have deleted {card} in {stack} on {board}') : $this->l10n->t('{user} has deleted {card} in {stack} on {board}');
176
				break;
177
			case self::SUBJECT_CARD_UPDATE_TITLE:
178
				$subject = $ownActivity ? $this->l10n->t('You have renamed the card {before} to {card}') : $this->l10n->t('{user} has renamed the card {before} to {card}');
179
				break;
@@ 177-179 (lines=3) @@
174
			case self::SUBJECT_CARD_DELETE:
175
				$subject = $ownActivity ? $this->l10n->t('You have deleted {card} in {stack} on {board}') : $this->l10n->t('{user} has deleted {card} in {stack} on {board}');
176
				break;
177
			case self::SUBJECT_CARD_UPDATE_TITLE:
178
				$subject = $ownActivity ? $this->l10n->t('You have renamed the card {before} to {card}') : $this->l10n->t('{user} has renamed the card {before} to {card}');
179
				break;
180
			case self::SUBJECT_CARD_UPDATE_DESCRIPTION:
181
				if (!isset($subjectParams['before'])) {
182
					$subject = $ownActivity ? $this->l10n->t('You have added a description to {card} in {stack} on {board}') : $this->l10n->t('{user} has added a description to {card} in {stack} on {board}');
@@ 187-189 (lines=3) @@
184
					$subject = $ownActivity ? $this->l10n->t('You have updated the description of {card} in {stack} on {board}') : $this->l10n->t('{user} has updated the description {card} in {stack} on {board}');
185
				}
186
				break;
187
			case self::SUBJECT_CARD_UPDATE_ARCHIVE:
188
				$subject = $ownActivity ? $this->l10n->t('You have archived {card} in {stack} on {board}') : $this->l10n->t('{user} has archived {card} in {stack} on {board}');
189
				break;
190
			case self::SUBJECT_CARD_UPDATE_UNARCHIVE:
191
				$subject = $ownActivity ? $this->l10n->t('You have unarchived {card} in {stack} on {board}') : $this->l10n->t('{user} has unarchived {card} in {stack} on {board}');
192
				break;
@@ 190-192 (lines=3) @@
187
			case self::SUBJECT_CARD_UPDATE_ARCHIVE:
188
				$subject = $ownActivity ? $this->l10n->t('You have archived {card} in {stack} on {board}') : $this->l10n->t('{user} has archived {card} in {stack} on {board}');
189
				break;
190
			case self::SUBJECT_CARD_UPDATE_UNARCHIVE:
191
				$subject = $ownActivity ? $this->l10n->t('You have unarchived {card} in {stack} on {board}') : $this->l10n->t('{user} has unarchived {card} in {stack} on {board}');
192
				break;
193
			case self::SUBJECT_CARD_UPDATE_DUEDATE:
194
				if (!isset($subjectParams['after'])) {
195
					$subject = $ownActivity ? $this->l10n->t('You have removed the due date of {card}') : $this->l10n->t('{user} has removed the due date of {card}');
@@ 203-205 (lines=3) @@
200
				}
201
202
				break;
203
			case self::SUBJECT_LABEL_ASSIGN:
204
				$subject = $ownActivity ? $this->l10n->t('You have added the label {label} to {card} in {stack} on {board}') : $this->l10n->t('{user} has added the label {label} to {card} in {stack} on {board}');
205
				break;
206
			case self::SUBJECT_LABEL_UNASSING:
207
				$subject = $ownActivity ? $this->l10n->t('You have removed the label {label} from {card} in {stack} on {board}') : $this->l10n->t('{user} has removed the label {label} from {card} in {stack} on {board}');
208
				break;
@@ 206-208 (lines=3) @@
203
			case self::SUBJECT_LABEL_ASSIGN:
204
				$subject = $ownActivity ? $this->l10n->t('You have added the label {label} to {card} in {stack} on {board}') : $this->l10n->t('{user} has added the label {label} to {card} in {stack} on {board}');
205
				break;
206
			case self::SUBJECT_LABEL_UNASSING:
207
				$subject = $ownActivity ? $this->l10n->t('You have removed the label {label} from {card} in {stack} on {board}') : $this->l10n->t('{user} has removed the label {label} from {card} in {stack} on {board}');
208
				break;
209
			case self::SUBJECT_CARD_USER_ASSIGN:
210
				$subject = $ownActivity ? $this->l10n->t('You have assigned {assigneduser} to {card} on {board}') : $this->l10n->t('{user} has assigned {assigneduser} to {card} on {board}');
211
				break;
@@ 209-211 (lines=3) @@
206
			case self::SUBJECT_LABEL_UNASSING:
207
				$subject = $ownActivity ? $this->l10n->t('You have removed the label {label} from {card} in {stack} on {board}') : $this->l10n->t('{user} has removed the label {label} from {card} in {stack} on {board}');
208
				break;
209
			case self::SUBJECT_CARD_USER_ASSIGN:
210
				$subject = $ownActivity ? $this->l10n->t('You have assigned {assigneduser} to {card} on {board}') : $this->l10n->t('{user} has assigned {assigneduser} to {card} on {board}');
211
				break;
212
			case self::SUBJECT_CARD_USER_UNASSIGN:
213
				$subject = $ownActivity ? $this->l10n->t('You have unassigned {assigneduser} from {card} on {board}') : $this->l10n->t('{user} has unassigned {assigneduser} from {card} on {board}');
214
				break;
@@ 212-214 (lines=3) @@
209
			case self::SUBJECT_CARD_USER_ASSIGN:
210
				$subject = $ownActivity ? $this->l10n->t('You have assigned {assigneduser} to {card} on {board}') : $this->l10n->t('{user} has assigned {assigneduser} to {card} on {board}');
211
				break;
212
			case self::SUBJECT_CARD_USER_UNASSIGN:
213
				$subject = $ownActivity ? $this->l10n->t('You have unassigned {assigneduser} from {card} on {board}') : $this->l10n->t('{user} has unassigned {assigneduser} from {card} on {board}');
214
				break;
215
			case self::SUBJECT_CARD_UPDATE_STACKID:
216
				$subject = $ownActivity ? $this->l10n->t('You have moved the card {card} from {stackBefore} to {stack}') : $this->l10n->t('{user} has moved the card {card} from {stackBefore} to {stack}');
217
				break;
@@ 215-217 (lines=3) @@
212
			case self::SUBJECT_CARD_USER_UNASSIGN:
213
				$subject = $ownActivity ? $this->l10n->t('You have unassigned {assigneduser} from {card} on {board}') : $this->l10n->t('{user} has unassigned {assigneduser} from {card} on {board}');
214
				break;
215
			case self::SUBJECT_CARD_UPDATE_STACKID:
216
				$subject = $ownActivity ? $this->l10n->t('You have moved the card {card} from {stackBefore} to {stack}') : $this->l10n->t('{user} has moved the card {card} from {stackBefore} to {stack}');
217
				break;
218
			case self::SUBJECT_ATTACHMENT_CREATE:
219
				$subject = $ownActivity ? $this->l10n->t('You have added the attachment {attachment} to {card}') : $this->l10n->t('{user} has added the attachment {attachment} to {card}');
220
				break;
@@ 218-220 (lines=3) @@
215
			case self::SUBJECT_CARD_UPDATE_STACKID:
216
				$subject = $ownActivity ? $this->l10n->t('You have moved the card {card} from {stackBefore} to {stack}') : $this->l10n->t('{user} has moved the card {card} from {stackBefore} to {stack}');
217
				break;
218
			case self::SUBJECT_ATTACHMENT_CREATE:
219
				$subject = $ownActivity ? $this->l10n->t('You have added the attachment {attachment} to {card}') : $this->l10n->t('{user} has added the attachment {attachment} to {card}');
220
				break;
221
			case self::SUBJECT_ATTACHMENT_UPDATE:
222
				$subject = $ownActivity ? $this->l10n->t('You have updated the attachment {attachment} on {card}') : $this->l10n->t('{user} has updated the attachment {attachment} to {card}');
223
				break;
@@ 221-223 (lines=3) @@
218
			case self::SUBJECT_ATTACHMENT_CREATE:
219
				$subject = $ownActivity ? $this->l10n->t('You have added the attachment {attachment} to {card}') : $this->l10n->t('{user} has added the attachment {attachment} to {card}');
220
				break;
221
			case self::SUBJECT_ATTACHMENT_UPDATE:
222
				$subject = $ownActivity ? $this->l10n->t('You have updated the attachment {attachment} on {card}') : $this->l10n->t('{user} has updated the attachment {attachment} to {card}');
223
				break;
224
			case self::SUBJECT_ATTACHMENT_DELETE:
225
				$subject = $ownActivity ? $this->l10n->t('You have deleted the attachment {attachment} from {card}') : $this->l10n->t('{user} has deleted the attachment {attachment} to {card}');
226
				break;
@@ 224-226 (lines=3) @@
221
			case self::SUBJECT_ATTACHMENT_UPDATE:
222
				$subject = $ownActivity ? $this->l10n->t('You have updated the attachment {attachment} on {card}') : $this->l10n->t('{user} has updated the attachment {attachment} to {card}');
223
				break;
224
			case self::SUBJECT_ATTACHMENT_DELETE:
225
				$subject = $ownActivity ? $this->l10n->t('You have deleted the attachment {attachment} from {card}') : $this->l10n->t('{user} has deleted the attachment {attachment} to {card}');
226
				break;
227
			case self::SUBJECT_ATTACHMENT_RESTORE:
228
				$subject = $ownActivity ? $this->l10n->t('You have restored the attachment {attachment} to {card}') : $this->l10n->t('{user} has restored the attachment {attachment} to {card}');
229
				break;
@@ 227-229 (lines=3) @@
224
			case self::SUBJECT_ATTACHMENT_DELETE:
225
				$subject = $ownActivity ? $this->l10n->t('You have deleted the attachment {attachment} from {card}') : $this->l10n->t('{user} has deleted the attachment {attachment} to {card}');
226
				break;
227
			case self::SUBJECT_ATTACHMENT_RESTORE:
228
				$subject = $ownActivity ? $this->l10n->t('You have restored the attachment {attachment} to {card}') : $this->l10n->t('{user} has restored the attachment {attachment} to {card}');
229
				break;
230
			default:
231
				break;
232
		}