pradosoft / prado

Prado - Component Framework for PHP
Other
186 stars 70 forks source link

#848 TComponent Events support Closures and all callable types (with unit tests) #928

Closed belisoful closed 1 year ago

belisoful commented 1 year ago

Unit tests to make sure Closures work. Minor change to TComponent to support Closures.

belisoful commented 1 year ago

Support for Closures as event handlers was first built into TWeakCallableCollection, the collection of handlers. Then it was built into behavior events. TComponent raiseEvent supporting closures is the last piece for integrating Closure into Prado as event handlers.

belisoful commented 1 year ago

are there any questions I can answer about this merge?

$handler is a callable so it must be a string, invokable object (aka Closure fits this category), or an array.

ctrlaltca commented 1 year ago

Sorry, this slipped under my radar, let me know when it's ready for review

belisoful commented 1 year ago

no problem. I think the latest iteration is the best it'll be. Nothing I was working on "required" it to be updated, thankfully. it was actually good that you didn't see it. synchronistically, I needed to correct it.