Browse Source

more type hints

remotes/origin/poc-doctrine-migrations
Robin Appelman 11 years ago
parent
commit
0497534a6e
  1. 4
      lib/private/files/node/root.php
  2. 4
      lib/private/hooks/emitter.php
  3. 4
      lib/private/hooks/forwardingemitter.php
  4. 2
      lib/private/hooks/legacyemitter.php
  5. 2
      lib/private/hooks/publicemitter.php
  6. 4
      lib/private/user/session.php
  7. 2
      tests/lib/hooks/forwardingemitter.php

4
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);
}

4
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);
}

4
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

2
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);
}

2
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);
}
}

4
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);
}

2
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);
}
}

Loading…
Cancel
Save