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

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