summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-05-08 14:27:22 +0200
committerRobin Appelman <icewind@owncloud.com>2015-06-02 14:07:55 +0200
commit0497534a6e5c7c856faf2f4a1939ab34a7f59a8f (patch)
tree9b6c1b92ad04cf9e980a2d9839af178c753486d3
parent8926bca0c7f27774959ec831c830c883bd284100 (diff)
downloadnextcloud-server-0497534a6e5c7c856faf2f4a1939ab34a7f59a8f.tar.gz
nextcloud-server-0497534a6e5c7c856faf2f4a1939ab34a7f59a8f.zip
more type hints
-rw-r--r--lib/private/files/node/root.php4
-rw-r--r--lib/private/hooks/emitter.php4
-rw-r--r--lib/private/hooks/forwardingemitter.php4
-rw-r--r--lib/private/hooks/legacyemitter.php2
-rw-r--r--lib/private/hooks/publicemitter.php2
-rw-r--r--lib/private/user/session.php4
-rw-r--r--tests/lib/hooks/forwardingemitter.php2
7 files changed, 11 insertions, 11 deletions
diff --git a/lib/private/files/node/root.php b/lib/private/files/node/root.php
index e47f98b0f27..7ffb3674a8f 100644
--- a/lib/private/files/node/root.php
+++ b/lib/private/files/node/root.php
@@ -94,7 +94,7 @@ class Root extends Folder implements IRootFolder {
* @param string $method
* @param callable $callback
*/
- public function listen($scope, $method, $callback) {
+ public function listen($scope, $method, callable $callback) {
$this->emitter->listen($scope, $method, $callback);
}
@@ -103,7 +103,7 @@ class Root extends Folder implements IRootFolder {
* @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) {
$this->emitter->removeListener($scope, $method, $callback);
}
diff --git a/lib/private/hooks/emitter.php b/lib/private/hooks/emitter.php
index 895bd2d9cac..bea3f289b8d 100644
--- a/lib/private/hooks/emitter.php
+++ b/lib/private/hooks/emitter.php
@@ -37,7 +37,7 @@ interface Emitter {
* @param callable $callback
* @return void
*/
- public function listen($scope, $method, $callback);
+ public function listen($scope, $method, callable $callback);
/**
* @param string $scope optional
@@ -45,5 +45,5 @@ interface Emitter {
* @param callable $callback optional
* @return void
*/
- public function removeListener($scope = null, $method = null, $callback = null);
+ public function removeListener($scope = null, $method = null, callable $callback = null);
}
diff --git a/lib/private/hooks/forwardingemitter.php b/lib/private/hooks/forwardingemitter.php
index 853004310fb..90c1970f480 100644
--- a/lib/private/hooks/forwardingemitter.php
+++ b/lib/private/hooks/forwardingemitter.php
@@ -40,7 +40,7 @@ abstract class ForwardingEmitter extends BasicEmitter {
* @param string $method
* @param callable $callback
*/
- public function listen($scope, $method, $callback) {
+ public function listen($scope, $method, callable $callback) {
parent::listen($scope, $method, $callback);
foreach ($this->forwardEmitters as $emitter) {
$emitter->listen($scope, $method, $callback);
@@ -50,7 +50,7 @@ abstract class ForwardingEmitter extends BasicEmitter {
/**
* @param \OC\Hooks\Emitter $emitter
*/
- protected function forward($emitter) {
+ protected function forward(Emitter $emitter) {
$this->forwardEmitters[] = $emitter;
//forward all previously connected hooks
diff --git a/lib/private/hooks/legacyemitter.php b/lib/private/hooks/legacyemitter.php
index b0912d740d2..b28854f4638 100644
--- a/lib/private/hooks/legacyemitter.php
+++ b/lib/private/hooks/legacyemitter.php
@@ -23,7 +23,7 @@
namespace OC\Hooks;
abstract class LegacyEmitter extends BasicEmitter {
- protected function emit($scope, $method, $arguments = array()) {
+ protected function emit($scope, $method, array $arguments = array()) {
\OC_Hook::emit($scope, $method, $arguments);
parent::emit($scope, $method, $arguments);
}
diff --git a/lib/private/hooks/publicemitter.php b/lib/private/hooks/publicemitter.php
index 71641c9d5e0..12de07b27c7 100644
--- a/lib/private/hooks/publicemitter.php
+++ b/lib/private/hooks/publicemitter.php
@@ -28,7 +28,7 @@ class PublicEmitter extends BasicEmitter {
* @param string $method
* @param array $arguments optional
*/
- public function emit($scope, $method, $arguments = array()) {
+ public function emit($scope, $method, array $arguments = array()) {
parent::emit($scope, $method, $arguments);
}
}
diff --git a/lib/private/user/session.php b/lib/private/user/session.php
index a66ae6bd8ad..75a884fb452 100644
--- a/lib/private/user/session.php
+++ b/lib/private/user/session.php
@@ -81,7 +81,7 @@ class Session implements IUserSession, Emitter {
* @param string $method
* @param callable $callback
*/
- public function listen($scope, $method, $callback) {
+ public function listen($scope, $method, callable $callback) {
$this->manager->listen($scope, $method, $callback);
}
@@ -90,7 +90,7 @@ class Session implements IUserSession, Emitter {
* @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) {
$this->manager->removeListener($scope, $method, $callback);
}
diff --git a/tests/lib/hooks/forwardingemitter.php b/tests/lib/hooks/forwardingemitter.php
index decf6bb354c..5e8e252d3e3 100644
--- a/tests/lib/hooks/forwardingemitter.php
+++ b/tests/lib/hooks/forwardingemitter.php
@@ -17,7 +17,7 @@ class DummyForwardingEmitter extends \OC\Hooks\ForwardingEmitter {
/**
* @param \OC\Hooks\Emitter $emitter
*/
- public function forward($emitter) {
+ public function forward(\OC\Hooks\Emitter $emitter) {
parent::forward($emitter);
}
}