Code Duplication    Length = 9-11 lines in 3 locations

lib/Model/FederatedLink.php 3 locations

@@ 341-350 (lines=10) @@
338
	 *
339
	 * @throws FederatedCircleStatusUpdateException
340
	 */
341
	private function hasToBeValidStatusUpdateWhileRequestDeclined($status) {
342
		if ($this->getStatus() !== self::STATUS_REQUEST_DECLINED
343
			&& $this->getStatus() !== self::STATUS_LINK_SETUP) {
344
			return;
345
		}
346
347
		if ($status !== self::STATUS_LINK_REMOVE) {
348
			throw new FederatedCircleStatusUpdateException();
349
		}
350
	}
351
352
353
	/**
@@ 358-366 (lines=9) @@
355
	 *
356
	 * @throws FederatedCircleStatusUpdateException
357
	 */
358
	private function hasToBeValidStatusUpdateWhileLinkRequested($status) {
359
		if ($this->getStatus() !== self::STATUS_LINK_REQUESTED) {
360
			return;
361
		}
362
363
		if ($status !== self::STATUS_LINK_REMOVE && $status !== self::STATUS_LINK_UP) {
364
			throw new FederatedCircleStatusUpdateException();
365
		}
366
	}
367
368
369
	/**
@@ 374-384 (lines=11) @@
371
	 *
372
	 * @throws FederatedCircleStatusUpdateException
373
	 */
374
	private function hasToBeValidStatusUpdateWhileRequestSent($status) {
375
		if ($this->getStatus() !== self::STATUS_REQUEST_SENT
376
			&& $this->getStatus() !== self::STATUS_LINK_UP
377
		) {
378
			return;
379
		}
380
381
		if ($status !== self::STATUS_LINK_REMOVE) {
382
			throw new FederatedCircleStatusUpdateException();
383
		}
384
	}
385
386
387
	public function jsonSerialize() {