*
* @param string $certificate the certificate data
* @param string $name the filename for the certificate
- * @return \OCP\ICertificate|void|bool
+ * @return \OCP\ICertificate
* @throws \Exception If the certificate could not get added
*/
public function addCertificate($certificate, $name) {
if (!Filesystem::isValidPath($name) or Filesystem::isFileBlacklisted($name)) {
- return false;
+ throw new \Exception('Filename is not valid');
}
$dir = $this->getPathToCertificates() . 'uploads/';
/**
* @param string $certificate the certificate data
* @param string $name the filename for the certificate
- * @return bool | \OCP\ICertificate
+ * @return \OCP\ICertificate
+ * @throws \Exception If the certificate could not get added
* @since 8.0.0
*/
public function addCertificate($certificate, $name);