Code Duplication    Length = 13-14 lines in 2 locations

lib/Controller/GlobalScaleController.php 2 locations

@@ 63-75 (lines=13) @@
60
	 *
61
	 * @return DataResponse
62
	 */
63
	public function event(): DataResponse {
64
		$data = file_get_contents('php://input');
65
66
		try {
67
			$event = new GSevent();
68
			$event->importFromJson($data);
69
			$this->gsDownstreamService->requestedEvent($event);
70
71
			return $this->success(['success' => $event]);
72
		} catch (Exception $e) {
73
			return $this->fail(['data' => $data, 'error' => $e->getMessage()]);
74
		}
75
	}
76
77
78
	/**
@@ 118-131 (lines=14) @@
115
	 *
116
	 * @return DataResponse
117
	 */
118
	public function broadcast(): DataResponse {
119
		$data = file_get_contents('php://input');
120
121
		try {
122
			$event = new GSevent();
123
			$event->importFromJson($data);
124
125
			$this->gsDownstreamService->onNewEvent($event);
126
127
			return $this->success([]);
128
		} catch (Exception $e) {
129
			return $this->fail(['data' => $data, 'error' => $e->getMessage()]);
130
		}
131
	}
132
133
}
134