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 {
@@ 136-140 (lines=5) @@
133
			return new JSONResponse([], Http::STATUS_UNAUTHORIZED);
134
		}
135
136
		if (strlen($devicePublicKey) !== 450 ||
137
			strpos($devicePublicKey, '-----BEGIN PUBLIC KEY-----') !== 0 ||
138
			strpos($devicePublicKey, '-----END PUBLIC KEY-----') !== 426) {
139
			return new JSONResponse(['message' => 'INVALID_DEVICE_KEY'], Http::STATUS_BAD_REQUEST);
140
		}
141
142
		$sessionId = $this->session->getId();
143
		try {