Code Duplication    Length = 13-14 lines in 3 locations

lib/Controller/GlobalScaleController.php 3 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
	/**
@@ 123-136 (lines=14) @@
120
	 *
121
	 * @return DataResponse
122
	 */
123
	public function broadcast(): DataResponse {
124
		$data = file_get_contents('php://input');
125
126
		try {
127
			$event = new GSevent();
128
			$event->importFromJson($data);
129
130
			$this->gsDownstreamService->onNewEvent($event);
131
132
			return $this->success(['result' => $event->getResult()]);
133
		} catch (Exception $e) {
134
			return $this->fail(['data' => $data, 'error' => $e->getMessage()]);
135
		}
136
	}
137
138
139
	/**
@@ 147-159 (lines=13) @@
144
	 *
145
	 * @return DataResponse
146
	 */
147
	public function status(): DataResponse {
148
		$data = file_get_contents('php://input');
149
150
		try {
151
			$event = new GSevent();
152
			$event->importFromJson($data);
153
			$this->gsDownstreamService->statusEvent($event);
154
155
			return $this->success(['success' => $event]);
156
		} catch (Exception $e) {
157
			return $this->fail(['data' => $data, 'error' => $e->getMessage()]);
158
		}
159
	}
160
161
}
162