Code Duplication    Length = 15-18 lines in 3 locations

apps/federatedfilesharing/lib/Notifier.php 1 location

@@ 79-96 (lines=18) @@
76
				}
77
78
				// Deal with the actions for a known subject
79
				foreach ($notification->getActions() as $action) {
80
					switch ($action->getLabel()) {
81
						case 'accept':
82
							$action->setParsedLabel(
83
								(string) $l->t('Accept')
84
							)
85
							->setPrimary(true);
86
							break;
87
88
						case 'decline':
89
							$action->setParsedLabel(
90
								(string) $l->t('Decline')
91
							);
92
							break;
93
					}
94
95
					$notification->addParsedAction($action);
96
				}
97
				return $notification;
98
99
			default:

apps/files_sharing/lib/Notifier.php 1 location

@@ 136-152 (lines=17) @@
133
			);
134
		}
135
136
		foreach ($notification->getActions() as $action) {
137
			switch ($action->getLabel()) {
138
				case 'accept':
139
					$action->setParsedLabel(
140
						(string) $l->t('Accept')
141
					);
142
					break;
143
144
				case 'decline':
145
					$action->setParsedLabel(
146
						(string) $l->t('Decline')
147
					);
148
					break;
149
			}
150
151
			$notification->addParsedAction($action);
152
		}
153
154
		return $notification;
155
	}

apps/files/lib/Service/TransferOwnership/TransferRequestManager.php 1 location

@@ 275-289 (lines=15) @@
272
						'"%1$s" requested to transfer "%2$s" to you (%3$s)"',
273
						$notification->getMessageParameters())
274
				);
275
				foreach ($notification->getActions() as $action) {
276
					switch ($action->getLabel()) {
277
						case 'accept':
278
							$action->setParsedLabel(
279
								(string) $l->t('Accept')
280
							);
281
							break;
282
						case 'reject':
283
							$action->setParsedLabel(
284
								(string) $l->t('Decline')
285
							);
286
							break;
287
					}
288
					$notification->addParsedAction($action);
289
				}
290
				return $notification;
291
				break;
292
			case 'transfer_request_actioned_source':