]> source.dussan.org Git - nextcloud-server.git/commitdiff
Proper return types
authorLukas Reschke <lukas@owncloud.com>
Wed, 15 Apr 2015 13:56:10 +0000 (15:56 +0200)
committerLukas Reschke <lukas@owncloud.com>
Mon, 20 Apr 2015 11:00:02 +0000 (13:00 +0200)
lib/private/security/certificatemanager.php
lib/public/icertificatemanager.php

index beeb87a83160ee9dcec2cce48175fd63f7d9d599..d61c7f29327145dec5bce9053e0a5afb4a693ddb 100644 (file)
@@ -107,12 +107,12 @@ class CertificateManager implements ICertificateManager {
         *
         * @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/';
index ec88f32e291d1f824f5fc80623afc8b3d80e1c42..3014cd8f633d0c814619c746f7d6e8e659e37253 100644 (file)
@@ -38,7 +38,8 @@ interface ICertificateManager {
        /**
         * @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);