Proper return types

This commit is contained in:
Lukas Reschke 2015-04-15 15:56:10 +02:00
parent 20a6073a9f
commit 1cc2aefa46
2 changed files with 4 additions and 3 deletions

View File

@ -107,12 +107,12 @@ class CertificateManager implements ICertificateManager {
* *
* @param string $certificate the certificate data * @param string $certificate the certificate data
* @param string $name the filename for the certificate * @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 * @throws \Exception If the certificate could not get added
*/ */
public function addCertificate($certificate, $name) { public function addCertificate($certificate, $name) {
if (!Filesystem::isValidPath($name) or Filesystem::isFileBlacklisted($name)) { if (!Filesystem::isValidPath($name) or Filesystem::isFileBlacklisted($name)) {
return false; throw new \Exception('Filename is not valid');
} }
$dir = $this->getPathToCertificates() . 'uploads/'; $dir = $this->getPathToCertificates() . 'uploads/';

View File

@ -38,7 +38,8 @@ interface ICertificateManager {
/** /**
* @param string $certificate the certificate data * @param string $certificate the certificate data
* @param string $name the filename for the certificate * @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 * @since 8.0.0
*/ */
public function addCertificate($certificate, $name); public function addCertificate($certificate, $name);