You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Events could be available globally, not just on the class level; or it could be on both?
For instance, having a $database->onConnect(...) event caller is handy and segregates the event from something like $configuration->onLoad(...).
Perhaps a better way to do this would be to have $events->on('database.connect', ...) and $events->on('config.load', ...)?
The benefit to this is that you could potentially check if an event exists without having to reference the target class. This would allow for further decoupling so that, in the event of a database, you could use $events->hasEvent('database.connect') and, if that returns false, you could use $events->hasNamespace('database') to see if there are even any events in that namespace.
The issue with this, however, is that it could cause naming collisions if two libraries decide on using the same namespace. This would require extra checks to ensure that parameters exist and match.
The text was updated successfully, but these errors were encountered:
Events could be available globally, not just on the class level; or it could be on both?
For instance, having a $database->onConnect(...) event caller is handy and segregates the event from something like $configuration->onLoad(...).
Perhaps a better way to do this would be to have $events->on('database.connect', ...) and $events->on('config.load', ...)?
The benefit to this is that you could potentially check if an event exists without having to reference the target class. This would allow for further decoupling so that, in the event of a database, you could use $events->hasEvent('database.connect') and, if that returns false, you could use $events->hasNamespace('database') to see if there are even any events in that namespace.
The issue with this, however, is that it could cause naming collisions if two libraries decide on using the same namespace. This would require extra checks to ensure that parameters exist and match.
The text was updated successfully, but these errors were encountered: