aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/EventDispatcher
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-02-10 18:57:07 +0100
committerGitHub <noreply@github.com>2021-02-10 18:57:07 +0100
commit1cc23c6e6e174d05fde8c6ea06b75530f72f096a (patch)
treec7a35abfdbc9437089e4f36ae6e606d6d5ccbccc /lib/public/EventDispatcher
parent847ee4041ae140dd3ca32f6388a817f63ba3836a (diff)
parentf76ec25e58292b8d2c4b9a27857365fab373be1c (diff)
downloadnextcloud-server-1cc23c6e6e174d05fde8c6ea06b75530f72f096a.tar.gz
nextcloud-server-1cc23c6e6e174d05fde8c6ea06b75530f72f096a.zip
Merge pull request #25558 from nextcloud/deprecate/generic-event-wrapper
Deprecate the GenericEvent wrapper
Diffstat (limited to 'lib/public/EventDispatcher')
-rw-r--r--lib/public/EventDispatcher/GenericEvent.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/public/EventDispatcher/GenericEvent.php b/lib/public/EventDispatcher/GenericEvent.php
index ab2ff734ada..eda7fdf0997 100644
--- a/lib/public/EventDispatcher/GenericEvent.php
+++ b/lib/public/EventDispatcher/GenericEvent.php
@@ -40,17 +40,23 @@ use function array_key_exists;
* \OCP\EventDispatcher\Event
*
* @since 18.0.0
+ * @deprecated 22.0.0 use \OCP\EventDispatcher\Event
*/
class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
+ /** @deprecated 22.0.0 */
protected $subject;
+
+ /** @deprecated 22.0.0 */
protected $arguments;
/**
* Encapsulate an event with $subject and $args.
*
* @since 18.0.0
+ * @deprecated 22.0.0
*/
public function __construct($subject = null, array $arguments = []) {
+ parent::__construct();
$this->subject = $subject;
$this->arguments = $arguments;
}
@@ -59,6 +65,7 @@ class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
* Getter for subject property.
*
* @since 18.0.0
+ * @deprecated 22.0.0
*/
public function getSubject() {
return $this->subject;
@@ -69,6 +76,7 @@ class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
*
* @throws InvalidArgumentException if key is not found
* @since 18.0.0
+ * @deprecated 22.0.0
*/
public function getArgument(string $key) {
if ($this->hasArgument($key)) {
@@ -82,6 +90,7 @@ class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
* Add argument to event.
*
* @since 18.0.0
+ * @deprecated 22.0.0
*/
public function setArgument($key, $value): GenericEvent {
$this->arguments[$key] = $value;
@@ -92,6 +101,7 @@ class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
* Getter for all arguments.
*
* @since 18.0.0
+ * @deprecated 22.0.0
*/
public function getArguments(): array {
return $this->arguments;
@@ -101,6 +111,7 @@ class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
* Set args property.
*
* @since 18.0.0
+ * @deprecated 22.0.0
*/
public function setArguments(array $args = []): GenericEvent {
$this->arguments = $args;
@@ -111,6 +122,7 @@ class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
* Has argument.
*
* @since 18.0.0
+ * @deprecated 22.0.0
*/
public function hasArgument($key): bool {
return array_key_exists($key, $this->arguments);
@@ -121,6 +133,7 @@ class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
*
* @link https://php.net/manual/en/iteratoraggregate.getiterator.php
* @since 18.0.0
+ * @deprecated 22.0.0
*/
public function getIterator(): Traversable {
return new ArrayIterator($this->arguments);
@@ -131,6 +144,7 @@ class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
*
* @link https://php.net/manual/en/arrayaccess.offsetexists.php
* @since 18.0.0
+ * @deprecated 22.0.0
*/
public function offsetExists($offset): bool {
return $this->hasArgument($offset);
@@ -141,6 +155,7 @@ class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
*
* @link https://php.net/manual/en/arrayaccess.offsetget.php
* @since 18.0.0
+ * @deprecated 22.0.0
*/
public function offsetGet($offset) {
return $this->arguments[$offset];
@@ -151,6 +166,7 @@ class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
*
* @link https://php.net/manual/en/arrayaccess.offsetset.php
* @since 18.0.0
+ * @deprecated 22.0.0
*/
public function offsetSet($offset, $value): void {
$this->setArgument($offset, $value);
@@ -161,6 +177,7 @@ class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
*
* @link https://php.net/manual/en/arrayaccess.offsetunset.php
* @since 18.0.0
+ * @deprecated 22.0.0
*/
public function offsetUnset($offset): void {
if ($this->hasArgument($offset)) {