Code Duplication    Length = 5-5 lines in 2 locations

lib/Controller/PushController.php 2 locations

@@ 98-102 (lines=5) @@
95
			return new JSONResponse(['message' => 'Invalid hashed push token'], Http::STATUS_BAD_REQUEST);
96
		}
97
98
		if (strlen($devicePublicKey) !== 450 ||
99
			strpos($devicePublicKey, '-----BEGIN PUBLIC KEY-----') !== 0 ||
100
			strpos($devicePublicKey, '-----END PUBLIC KEY-----') !== 426) {
101
			return new JSONResponse(['message' => 'Invalid device public key'], Http::STATUS_BAD_REQUEST);
102
		}
103
104
		$sessionId = $this->session->getId();
105
		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-----') !== 425) {
139
			return new JSONResponse(['message' => 'Invalid device public key'], Http::STATUS_BAD_REQUEST);
140
		}
141
142
		$sessionId = $this->session->getId();
143
		try {