diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-04-02 17:53:40 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-04-07 13:30:31 +0200 |
commit | 111fbabfb4772310cfae7037dfc3b71dcb881cc5 (patch) | |
tree | 80f11af29b391032f565f00aa831c23024c4abe6 /lib/private/hook.php | |
parent | b9e4e61759b4cc3cdf5c0cabd8e5a8d6828d5528 (diff) | |
download | nextcloud-server-111fbabfb4772310cfae7037dfc3b71dcb881cc5.tar.gz nextcloud-server-111fbabfb4772310cfae7037dfc3b71dcb881cc5.zip |
PHPDoc cleanup - clean code \o/
Diffstat (limited to 'lib/private/hook.php')
-rw-r--r-- | lib/private/hook.php | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/private/hook.php b/lib/private/hook.php index 824bb725077..c4ea1999b09 100644 --- a/lib/private/hook.php +++ b/lib/private/hook.php @@ -32,38 +32,39 @@ class OC_Hook{ /** * connects a function to a hook - * @param string $signalclass class name of emitter - * @param string $signalname name of signal - * @param string $slotclass class name of slot - * @param string $slotname name of slot + * + * @param string $signalClass class name of emitter + * @param string $signalName name of signal + * @param string|object $slotClass class name of slot + * @param string $slotName name of slot * @return bool * * This function makes it very easy to connect to use hooks. * * TODO: write example */ - static public function connect( $signalclass, $signalname, $slotclass, $slotname ) { + static public function connect($signalClass, $signalName, $slotClass, $slotName ) { // If we're trying to connect to an emitting class that isn't // yet registered, register it - if( !array_key_exists( $signalclass, self::$registered )) { - self::$registered[$signalclass] = array(); + if( !array_key_exists($signalClass, self::$registered )) { + self::$registered[$signalClass] = array(); } // If we're trying to connect to an emitting method that isn't // yet registered, register it with the emitting class - if( !array_key_exists( $signalname, self::$registered[$signalclass] )) { - self::$registered[$signalclass][$signalname] = array(); + if( !array_key_exists( $signalName, self::$registered[$signalClass] )) { + self::$registered[$signalClass][$signalName] = array(); } // dont connect hooks twice - foreach (self::$registered[$signalclass][$signalname] as $hook) { - if ($hook['class'] === $slotclass and $hook['name'] === $slotname) { + foreach (self::$registered[$signalClass][$signalName] as $hook) { + if ($hook['class'] === $slotClass and $hook['name'] === $slotName) { return false; } } // Connect the hook handler to the requested emitter - self::$registered[$signalclass][$signalname][] = array( - "class" => $slotclass, - "name" => $slotname + self::$registered[$signalClass][$signalName][] = array( + "class" => $slotClass, + "name" => $slotName ); // No chance for failure ;-) |