summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-07-15 13:57:35 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-07-15 13:57:35 +0200
commitb9a911f0b37c1c0903956badb87364b6be71aa55 (patch)
treeaeab64829be90ac4fa8e7c9e5754ba5629451795 /lib
parentda4f3559c5f1ab5db77e2cb06c2d618fb228313b (diff)
downloadnextcloud-server-b9a911f0b37c1c0903956badb87364b6be71aa55.tar.gz
nextcloud-server-b9a911f0b37c1c0903956badb87364b6be71aa55.zip
Deprecate the internal Symfony dispatcher adapter
This type is not known on the public API, yet we should make sure that any usage of this class is noticed and migrated as soon as possible. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/EventDispatcher/EventDispatcher.php1
-rw-r--r--lib/private/EventDispatcher/SymfonyAdapter.php16
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/private/EventDispatcher/EventDispatcher.php b/lib/private/EventDispatcher/EventDispatcher.php
index b81b4741306..f2a87cc4c70 100644
--- a/lib/private/EventDispatcher/EventDispatcher.php
+++ b/lib/private/EventDispatcher/EventDispatcher.php
@@ -100,6 +100,7 @@ class EventDispatcher implements IEventDispatcher {
/**
* @return SymfonyDispatcher
+ * @deprecated 20.0.0
*/
public function getSymfonyDispatcher(): SymfonyDispatcher {
return $this->dispatcher;
diff --git a/lib/private/EventDispatcher/SymfonyAdapter.php b/lib/private/EventDispatcher/SymfonyAdapter.php
index f2b74a5ca63..454f4ca4b01 100644
--- a/lib/private/EventDispatcher/SymfonyAdapter.php
+++ b/lib/private/EventDispatcher/SymfonyAdapter.php
@@ -35,6 +35,9 @@ use OCP\ILogger;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+/**
+ * @deprecated 20.0.0 use \OCP\EventDispatcher\IEventDispatcher
+ */
class SymfonyAdapter implements EventDispatcherInterface {
/** @var EventDispatcher */
@@ -42,6 +45,9 @@ class SymfonyAdapter implements EventDispatcherInterface {
/** @var ILogger */
private $logger;
+ /**
+ * @deprecated 20.0.0
+ */
public function __construct(EventDispatcher $eventDispatcher, ILogger $logger) {
$this->eventDispatcher = $eventDispatcher;
$this->logger = $logger;
@@ -57,6 +63,7 @@ class SymfonyAdapter implements EventDispatcherInterface {
* 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
@@ -85,6 +92,7 @@ class SymfonyAdapter implements EventDispatcherInterface {
* @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)) {
@@ -100,6 +108,7 @@ class SymfonyAdapter implements EventDispatcherInterface {
*
* 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);
@@ -110,11 +119,15 @@ class SymfonyAdapter implements EventDispatcherInterface {
*
* @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);
}
@@ -125,6 +138,7 @@ class SymfonyAdapter implements EventDispatcherInterface {
* @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);
@@ -139,6 +153,7 @@ class SymfonyAdapter implements EventDispatcherInterface {
* @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);
@@ -150,6 +165,7 @@ class SymfonyAdapter implements EventDispatcherInterface {
* @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);