Code Duplication    Length = 13-14 lines in 3 locations

lib/Controller/GlobalScaleController.php 3 locations

@@ 62-74 (lines=13) @@
59
	 *
60
	 * @return DataResponse
61
	 */
62
	public function event(): DataResponse {
63
		$data = file_get_contents('php://input');
64
65
		try {
66
			$event = new GSEvent();
67
			$event->importFromJson($data);
68
			$this->gsDownstreamService->requestedEvent($event);
69
70
			return $this->success(['success' => $event]);
71
		} catch (Exception $e) {
72
			return $this->fail(['data' => $data, 'error' => $e->getMessage()]);
73
		}
74
	}
75
76
77
	/**
@@ 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(['result' => $event->getResult()]);
130
		} catch (Exception $e) {
131
			return $this->fail(['data' => $data, 'error' => $e->getMessage()]);
132
		}
133
	}
134
135
136
	/**
@@ 144-156 (lines=13) @@
141
	 *
142
	 * @return DataResponse
143
	 */
144
	public function status(): DataResponse {
145
		$data = file_get_contents('php://input');
146
147
		try {
148
			$event = new GSEvent();
149
			$event->importFromJson($data);
150
			$this->gsDownstreamService->statusEvent($event);
151
152
			return $this->success(['success' => $event]);
153
		} catch (Exception $e) {
154
			return $this->fail(['data' => $data, 'error' => $e->getMessage()]);
155
		}
156
	}
157
158
}
159