Proper return types
This commit is contained in:
parent
20a6073a9f
commit
1cc2aefa46
|
@ -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/';
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue