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

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