[Pkg-owncloud-commits] [owncloud] 258/457: phpdoc, strict and type hints

David Prévot taffit at moszumanska.debian.org
Sun Jun 28 20:06:18 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 8926bca0c7f27774959ec831c830c883bd284100
Author: Robin Appelman <icewind at owncloud.com>
Date:   Fri May 8 13:51:32 2015 +0200

    phpdoc, strict and type hints
---
 lib/private/files/filesystem.php   |  6 ++++++
 lib/private/hooks/emittertrait.php | 10 +++++-----
 tests/lib/files/filesystem.php     |  7 +++++++
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php
index 2391e84..212deb2 100644
--- a/lib/private/files/filesystem.php
+++ b/lib/private/files/filesystem.php
@@ -430,6 +430,12 @@ class Filesystem {
 		\OC_Hook::emit('OC_Filesystem', 'post_initMountPoints', array('user' => $user, 'user_dir' => $root));
 	}
 
+	/**
+	 * Get mounts from mount providers that are registered after setup
+	 *
+	 * @param MountProviderCollection $mountConfigManager
+	 * @param IUserManager $userManager
+	 */
 	private static function listenForNewMountProviders(MountProviderCollection $mountConfigManager, IUserManager $userManager) {
 		if (!self::$listeningForProviders) {
 			self::$listeningForProviders = true;
diff --git a/lib/private/hooks/emittertrait.php b/lib/private/hooks/emittertrait.php
index a80d7d5..5d471a3 100644
--- a/lib/private/hooks/emittertrait.php
+++ b/lib/private/hooks/emittertrait.php
@@ -34,12 +34,12 @@ trait EmitterTrait {
 	 * @param string $method
 	 * @param callable $callback
 	 */
-	public function listen($scope, $method, $callback) {
+	public function listen($scope, $method, callable $callback) {
 		$eventName = $scope . '::' . $method;
 		if (!isset($this->listeners[$eventName])) {
 			$this->listeners[$eventName] = array();
 		}
-		if (array_search($callback, $this->listeners[$eventName]) === false) {
+		if (array_search($callback, $this->listeners[$eventName], true) === false) {
 			$this->listeners[$eventName][] = $callback;
 		}
 	}
@@ -49,7 +49,7 @@ trait EmitterTrait {
 	 * @param string $method optional
 	 * @param callable $callback optional
 	 */
-	public function removeListener($scope = null, $method = null, $callback = null) {
+	public function removeListener($scope = null, $method = null, callable $callback = null) {
 		$names = array();
 		$allNames = array_keys($this->listeners);
 		if ($scope and $method) {
@@ -77,7 +77,7 @@ trait EmitterTrait {
 
 		foreach ($names as $name) {
 			if ($callback) {
-				$index = array_search($callback, $this->listeners[$name]);
+				$index = array_search($callback, $this->listeners[$name], true);
 				if ($index !== false) {
 					unset($this->listeners[$name][$index]);
 				}
@@ -92,7 +92,7 @@ trait EmitterTrait {
 	 * @param string $method
 	 * @param array $arguments optional
 	 */
-	protected function emit($scope, $method, $arguments = array()) {
+	protected function emit($scope, $method, array $arguments = array()) {
 		$eventName = $scope . '::' . $method;
 		if (isset($this->listeners[$eventName])) {
 			foreach ($this->listeners[$eventName] as $callback) {
diff --git a/tests/lib/files/filesystem.php b/tests/lib/files/filesystem.php
index b5ee27f..b7061bd 100644
--- a/tests/lib/files/filesystem.php
+++ b/tests/lib/files/filesystem.php
@@ -39,6 +39,13 @@ class DummyMountProvider implements IMountProvider {
 		$this->mounts = $mounts;
 	}
 
+	/**
+	 * Get the pre-registered mount points
+	 *
+	 * @param IUser $user
+	 * @param IStorageFactory $loader
+	 * @return \OCP\Files\Mount\IMountPoint[]
+	 */
 	public function  getMountsForUser(IUser $user, IStorageFactory $loader) {
 		return isset($this->mounts[$user->getUID()]) ? $this->mounts[$user->getUID()] : [];
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list