This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -25,19 +25,16 @@ use Symfony\Contracts\EventDispatcher\Event;
*/
class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
{
protected mixed $subject;
protected array $arguments;
/**
* Encapsulate an event with $subject and $arguments.
*
* @param mixed $subject The subject of the event, usually an object or a callable
* @param array $arguments Arguments to store in the event
*/
public function __construct(mixed $subject = null, array $arguments = [])
{
$this->subject = $subject;
$this->arguments = $arguments;
public function __construct(
protected mixed $subject = null,
protected array $arguments = [],
) {
}
/**
@@ -59,7 +56,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
return $this->arguments[$key];
}
throw new \InvalidArgumentException(sprintf('Argument "%s" not found.', $key));
throw new \InvalidArgumentException(\sprintf('Argument "%s" not found.', $key));
}
/**