upgraded dependencies
This commit is contained in:
26
vendor/symfony/event-dispatcher/GenericEvent.php
vendored
26
vendor/symfony/event-dispatcher/GenericEvent.php
vendored
@@ -11,12 +11,17 @@
|
||||
|
||||
namespace Symfony\Component\EventDispatcher;
|
||||
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Event encapsulation class.
|
||||
*
|
||||
* Encapsulates events thus decoupling the observer from the subject they encapsulate.
|
||||
*
|
||||
* @author Drak <drak@zikula.org>
|
||||
*
|
||||
* @implements \ArrayAccess<string, mixed>
|
||||
* @implements \IteratorAggregate<string, mixed>
|
||||
*/
|
||||
class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
|
||||
{
|
||||
@@ -38,7 +43,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
|
||||
/**
|
||||
* Getter for subject property.
|
||||
*
|
||||
* @return mixed The observer subject
|
||||
* @return mixed
|
||||
*/
|
||||
public function getSubject()
|
||||
{
|
||||
@@ -48,13 +53,11 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
|
||||
/**
|
||||
* Get argument by key.
|
||||
*
|
||||
* @param string $key Key
|
||||
*
|
||||
* @return mixed Contents of array key
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \InvalidArgumentException if key is not found
|
||||
*/
|
||||
public function getArgument($key)
|
||||
public function getArgument(string $key)
|
||||
{
|
||||
if ($this->hasArgument($key)) {
|
||||
return $this->arguments[$key];
|
||||
@@ -66,12 +69,11 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
|
||||
/**
|
||||
* Add argument to event.
|
||||
*
|
||||
* @param string $key Argument name
|
||||
* @param mixed $value Value
|
||||
* @param mixed $value Value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setArgument($key, $value)
|
||||
public function setArgument(string $key, $value)
|
||||
{
|
||||
$this->arguments[$key] = $value;
|
||||
|
||||
@@ -91,8 +93,6 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
|
||||
/**
|
||||
* Set args property.
|
||||
*
|
||||
* @param array $args Arguments
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setArguments(array $args = [])
|
||||
@@ -105,11 +105,9 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
|
||||
/**
|
||||
* Has argument.
|
||||
*
|
||||
* @param string $key Key of arguments array
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasArgument($key)
|
||||
public function hasArgument(string $key)
|
||||
{
|
||||
return \array_key_exists($key, $this->arguments);
|
||||
}
|
||||
@@ -174,7 +172,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
|
||||
/**
|
||||
* IteratorAggregate for iterating over the object like an array.
|
||||
*
|
||||
* @return \ArrayIterator
|
||||
* @return \ArrayIterator<string, mixed>
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function getIterator()
|
||||
|
Reference in New Issue
Block a user