diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-14 20:53:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-14 20:53:17 +0100 |
commit | 3f2007025aa9c7aa4b5de4cd450181c3fe9145dc (patch) | |
tree | 07597709721e18294d47a55a9303d0753f5da68f | |
parent | 3ade5ccb2713b6fee2f176ae8280afda98d918a9 (diff) | |
parent | 758cb4d0085cc2db2ac86dc65bd7d54c71b62fad (diff) | |
download | nextcloud-server-3f2007025aa9c7aa4b5de4cd450181c3fe9145dc.tar.gz nextcloud-server-3f2007025aa9c7aa4b5de4cd450181c3fe9145dc.zip |
Merge pull request #7845 from nextcloud/capabilties_manager_strict
Make the capabilities manager strict
-rw-r--r-- | lib/private/CapabilitiesManager.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/CapabilitiesManager.php b/lib/private/CapabilitiesManager.php index b3db9231972..5b114bffac2 100644 --- a/lib/private/CapabilitiesManager.php +++ b/lib/private/CapabilitiesManager.php @@ -20,8 +20,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -namespace OC; +declare(strict_types=1); + +namespace OC; use OCP\AppFramework\QueryException; use OCP\Capabilities\ICapability; @@ -47,7 +49,7 @@ class CapabilitiesManager { * @throws \InvalidArgumentException * @return array */ - public function getCapabilities($public = false) { + public function getCapabilities(bool $public = false) : array { $capabilities = []; foreach($this->capabilities as $capability) { try { @@ -78,6 +80,6 @@ class CapabilitiesManager { * @param \Closure $callable */ public function registerCapability(\Closure $callable) { - array_push($this->capabilities, $callable); + $this->capabilities[] = $callable; } } |