pradosoft / prado

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

#984 TEventSubscription for temporary handler in an event #985

Closed belisoful closed 12 months ago

belisoful commented 12 months ago

This adds a second order functionality of temporary items in lists/arrays. When the subscription is dereferenced, the item is removed from the list. I wanted this for temporary event handlers for the "interrupt" and "terminate" linux process signals. This makes use of the Collection classes in a most utilitarian way and found a few places to upgrade.

1- TArraySubscription uses pass by reference and can do subscriptions with arrays and ArrayAccess objects. 2- TCollectionSubscription uses normal object references for ArrayAccess to prevent original variable manipulation 3- TEventSubscription use a TComponent and an event name.

belisoful commented 12 months ago

dunno why the first run of the updated PHPStan wasn't giving the error. I'm getting the error now with the latest PHPStan.

ctrlaltca commented 12 months ago

Master contains a fix, please rebase