more type hints

This commit is contained in:
Robin Appelman 2015-05-08 14:27:22 +02:00
parent 8926bca0c7
commit 0497534a6e
7 changed files with 11 additions and 11 deletions

View File

@ -94,7 +94,7 @@ class Root extends Folder implements IRootFolder {
* @param string $method * @param string $method
* @param callable $callback * @param callable $callback
*/ */
public function listen($scope, $method, $callback) { public function listen($scope, $method, callable $callback) {
$this->emitter->listen($scope, $method, $callback); $this->emitter->listen($scope, $method, $callback);
} }
@ -103,7 +103,7 @@ class Root extends Folder implements IRootFolder {
* @param string $method optional * @param string $method optional
* @param callable $callback 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); $this->emitter->removeListener($scope, $method, $callback);
} }

View File

@ -37,7 +37,7 @@ interface Emitter {
* @param callable $callback * @param callable $callback
* @return void * @return void
*/ */
public function listen($scope, $method, $callback); public function listen($scope, $method, callable $callback);
/** /**
* @param string $scope optional * @param string $scope optional
@ -45,5 +45,5 @@ interface Emitter {
* @param callable $callback optional * @param callable $callback optional
* @return void * @return void
*/ */
public function removeListener($scope = null, $method = null, $callback = null); public function removeListener($scope = null, $method = null, callable $callback = null);
} }

View File

@ -40,7 +40,7 @@ abstract class ForwardingEmitter extends BasicEmitter {
* @param string $method * @param string $method
* @param callable $callback * @param callable $callback
*/ */
public function listen($scope, $method, $callback) { public function listen($scope, $method, callable $callback) {
parent::listen($scope, $method, $callback); parent::listen($scope, $method, $callback);
foreach ($this->forwardEmitters as $emitter) { foreach ($this->forwardEmitters as $emitter) {
$emitter->listen($scope, $method, $callback); $emitter->listen($scope, $method, $callback);
@ -50,7 +50,7 @@ abstract class ForwardingEmitter extends BasicEmitter {
/** /**
* @param \OC\Hooks\Emitter $emitter * @param \OC\Hooks\Emitter $emitter
*/ */
protected function forward($emitter) { protected function forward(Emitter $emitter) {
$this->forwardEmitters[] = $emitter; $this->forwardEmitters[] = $emitter;
//forward all previously connected hooks //forward all previously connected hooks

View File

@ -23,7 +23,7 @@
namespace OC\Hooks; namespace OC\Hooks;
abstract class LegacyEmitter extends BasicEmitter { 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); \OC_Hook::emit($scope, $method, $arguments);
parent::emit($scope, $method, $arguments); parent::emit($scope, $method, $arguments);
} }

View File

@ -28,7 +28,7 @@ class PublicEmitter extends BasicEmitter {
* @param string $method * @param string $method
* @param array $arguments optional * @param array $arguments optional
*/ */
public function emit($scope, $method, $arguments = array()) { public function emit($scope, $method, array $arguments = array()) {
parent::emit($scope, $method, $arguments); parent::emit($scope, $method, $arguments);
} }
} }

View File

@ -81,7 +81,7 @@ class Session implements IUserSession, Emitter {
* @param string $method * @param string $method
* @param callable $callback * @param callable $callback
*/ */
public function listen($scope, $method, $callback) { public function listen($scope, $method, callable $callback) {
$this->manager->listen($scope, $method, $callback); $this->manager->listen($scope, $method, $callback);
} }
@ -90,7 +90,7 @@ class Session implements IUserSession, Emitter {
* @param string $method optional * @param string $method optional
* @param callable $callback 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); $this->manager->removeListener($scope, $method, $callback);
} }

View File

@ -17,7 +17,7 @@ class DummyForwardingEmitter extends \OC\Hooks\ForwardingEmitter {
/** /**
* @param \OC\Hooks\Emitter $emitter * @param \OC\Hooks\Emitter $emitter
*/ */
public function forward($emitter) { public function forward(\OC\Hooks\Emitter $emitter) {
parent::forward($emitter); parent::forward($emitter);
} }
} }