Code Duplication    Length = 5-5 lines in 2 locations

lib/Controller/PushController.php 2 locations

@@ 92-96 (lines=5) @@
89
			return new JSONResponse(['message' => 'INVALID_PUSHTOKEN_HASH'], Http::STATUS_BAD_REQUEST);
90
		}
91
92
		if (strlen($devicePublicKey) !== 450 ||
93
			strpos($devicePublicKey, '-----BEGIN PUBLIC KEY-----') !== 0 ||
94
			strpos($devicePublicKey, '-----END PUBLIC KEY-----') !== 426) {
95
			return new JSONResponse(['message' => 'INVALID_DEVICE_KEY'], Http::STATUS_BAD_REQUEST);
96
		}
97
98
		$tokenId = $this->session->get('token-id');
99
		try {
@@ 137-141 (lines=5) @@
134
			return new JSONResponse([], Http::STATUS_UNAUTHORIZED);
135
		}
136
137
		if (strlen($devicePublicKey) !== 450 ||
138
			strpos($devicePublicKey, '-----BEGIN PUBLIC KEY-----') !== 0 ||
139
			strpos($devicePublicKey, '-----END PUBLIC KEY-----') !== 426) {
140
			return new JSONResponse(['message' => 'INVALID_DEVICE_KEY'], Http::STATUS_BAD_REQUEST);
141
		}
142
143
		$sessionId = $this->session->getId();
144
		try {