aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/event/lib/EmitterInterface.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-11-10 12:49:51 +0000
committerMario <mario@mariovavti.com>2019-11-10 14:10:03 +0100
commit580c3f4ffe9608d2beb56d418c68b3b112420e76 (patch)
tree82335d01179ac361d3f547a4b8e8c598d302e9f3 /vendor/sabre/event/lib/EmitterInterface.php
parentd22766f458a8539a40a57f3946459a9be1f21cd6 (diff)
downloadvolse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.gz
volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.bz2
volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.zip
another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
Diffstat (limited to 'vendor/sabre/event/lib/EmitterInterface.php')
-rw-r--r--vendor/sabre/event/lib/EmitterInterface.php83
1 files changed, 83 insertions, 0 deletions
diff --git a/vendor/sabre/event/lib/EmitterInterface.php b/vendor/sabre/event/lib/EmitterInterface.php
new file mode 100644
index 000000000..a7e4b6132
--- /dev/null
+++ b/vendor/sabre/event/lib/EmitterInterface.php
@@ -0,0 +1,83 @@
+<?php declare (strict_types=1);
+
+namespace Sabre\Event;
+
+/**
+ * Event Emitter Interface
+ *
+ * Anything that accepts listeners and emits events should implement this
+ * interface.
+ *
+ * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
+ * @author Evert Pot (http://evertpot.com/)
+ * @license http://sabre.io/license/ Modified BSD License
+ */
+interface EmitterInterface {
+
+ /**
+ * Subscribe to an event.
+ *
+ * @return void
+ */
+ function on(string $eventName, callable $callBack, int $priority = 100);
+
+ /**
+ * Subscribe to an event exactly once.
+ *
+ * @return void
+ */
+ function once(string $eventName, callable $callBack, int $priority = 100);
+
+ /**
+ * Emits an event.
+ *
+ * This method will return true if 0 or more listeners were succesfully
+ * handled. false is returned if one of the events broke the event chain.
+ *
+ * If the continueCallBack is specified, this callback will be called every
+ * time before the next event handler is called.
+ *
+ * If the continueCallback returns false, event propagation stops. This
+ * allows you to use the eventEmitter as a means for listeners to implement
+ * functionality in your application, and break the event loop as soon as
+ * some condition is fulfilled.
+ *
+ * Note that returning false from an event subscriber breaks propagation
+ * and returns false, but if the continue-callback stops propagation, this
+ * is still considered a 'successful' operation and returns true.
+ *
+ * Lastly, if there are 5 event handlers for an event. The continueCallback
+ * will be called at most 4 times.
+ */
+ function emit(string $eventName, array $arguments = [], callable $continueCallBack = null) : bool;
+
+ /**
+ * Returns the list of listeners for an event.
+ *
+ * The list is returned as an array, and the list of events are sorted by
+ * their priority.
+ *
+ * @return callable[]
+ */
+ function listeners(string $eventName) : array;
+
+ /**
+ * Removes a specific listener from an event.
+ *
+ * If the listener could not be found, this method will return false. If it
+ * was removed it will return true.
+ */
+ function removeListener(string $eventName, callable $listener) : bool;
+
+ /**
+ * Removes all listeners.
+ *
+ * If the eventName argument is specified, all listeners for that event are
+ * removed. If it is not specified, every listener for every event is
+ * removed.
+ *
+ * @return void
+ */
+ function removeAllListeners(string $eventName = null);
+
+}