1

The GenericEvent of the symfony/event-dispatcher package provides two properties -- subject and arguments. If I understand the docu correctly, the arguments can be used for passing context data into the Event object. But I'm not getting, how to use the other property.

How is the GenericEvent#subject intended to be used?

automatix
  • 14,018
  • 26
  • 105
  • 230

2 Answers2

0

Look at this artikel: https://symfony.com/doc/current/components/event_dispatcher/generic_event.html

You can get the Subject with getSubject() and pass it. But more usefull it isn't.

0

It's not so much a 'subject line', as an object that can be attached. The type of the property in the documentation is 'mixed', not 'string', or in other words - anything.

So, hit can be used as "here's the subject of the event, and some arguments about what to do with it."

Alister Bulman
  • 34,482
  • 9
  • 71
  • 110