use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+/**
+ * @deprecated 20.0.0 use \OCP\EventDispatcher\IEventDispatcher
+ */
class SymfonyAdapter implements EventDispatcherInterface {
/** @var EventDispatcher */
/** @var ILogger */
private $logger;
+ /**
+ * @deprecated 20.0.0
+ */
public function __construct(EventDispatcher $eventDispatcher, ILogger $logger) {
$this->eventDispatcher = $eventDispatcher;
$this->logger = $logger;
* If not supplied, an empty Event instance is created
*
* @return void
+ * @deprecated 20.0.0
*/
public function dispatch($eventName, $event = null) {
// type hinting is not possible, due to usage of GenericEvent
* @param callable $listener The listener
* @param int $priority The higher this value, the earlier an event
* listener will be triggered in the chain (defaults to 0)
+ * @deprecated 20.0.0
*/
public function addListener($eventName, $listener, $priority = 0) {
if (is_callable($listener)) {
*
* The subscriber is asked for all the events it is
* interested in and added as a listener for these events.
+ * @deprecated 20.0.0
*/
public function addSubscriber(EventSubscriberInterface $subscriber) {
$this->eventDispatcher->getSymfonyDispatcher()->addSubscriber($subscriber);
*
* @param string $eventName The event to remove a listener from
* @param callable $listener The listener to remove
+ * @deprecated 20.0.0
*/
public function removeListener($eventName, $listener) {
$this->eventDispatcher->getSymfonyDispatcher()->removeListener($eventName, $listener);
}
+ /**
+ * @deprecated 20.0.0
+ */
public function removeSubscriber(EventSubscriberInterface $subscriber) {
$this->eventDispatcher->getSymfonyDispatcher()->removeSubscriber($subscriber);
}
* @param string|null $eventName The name of the event
*
* @return array The event listeners for the specified event, or all event listeners by event name
+ * @deprecated 20.0.0
*/
public function getListeners($eventName = null) {
return $this->eventDispatcher->getSymfonyDispatcher()->getListeners($eventName);
* @param callable $listener The listener
*
* @return int|null The event listener priority
+ * @deprecated 20.0.0
*/
public function getListenerPriority($eventName, $listener) {
return $this->eventDispatcher->getSymfonyDispatcher()->getListenerPriority($eventName, $listener);
* @param string|null $eventName The name of the event
*
* @return bool true if the specified event has any listeners, false otherwise
+ * @deprecated 20.0.0
*/
public function hasListeners($eventName = null) {
return $this->eventDispatcher->getSymfonyDispatcher()->hasListeners($eventName);