Code Duplication    Length = 13-14 lines in 2 locations

lib/Controller/GlobalScaleController.php 2 locations

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