* @param string $method
* @param callable $callback
* @return void
+ * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::addListener
*/
public function listen($scope, $method, callable $callback);
* @param string $method optional
* @param callable $callback optional
* @return void
+ * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::removeListener
*/
public function removeListener($scope = null, $method = null, callable $callback = null);
}
namespace OC\Hooks;
+/**
+ * @deprecated 18.0.0 use events and the \OCP\EventDispatcher\IEventDispatcher service
+ */
trait EmitterTrait {
/**
* @param string $scope
* @param string $method
* @param callable $callback
+ * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::addListener
*/
public function listen($scope, $method, callable $callback) {
$eventName = $scope . '::' . $method;
* @param string $scope optional
* @param string $method optional
* @param callable $callback optional
+ * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::removeListener
*/
public function removeListener($scope = null, $method = null, callable $callback = null) {
$names = [];
* @param string $scope
* @param string $method
* @param array $arguments optional
+ * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::dispatchTyped
*/
protected function emit($scope, $method, array $arguments = []) {
$eventName = $scope . '::' . $method;