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

@@ 254-268 (lines=15) @@
251
				$notification->getMessageParameters())
252
		);
253
254
		foreach ($notification->getActions() as $action) {
255
			switch ($action->getLabel()) {
256
				case 'accept':
257
					$action->setParsedLabel(
258
						(string) $l->t('Accept')
259
					);
260
					break;
261
				case 'reject':
262
					$action->setParsedLabel(
263
						(string) $l->t('Decline')
264
					);
265
					break;
266
			}
267
			$notification->addParsedAction($action);
268
		}
269
270
		return $notification;
271
	}