Hooks Trait

This PHP trait provides methods for adding ‘hooks’ into a class, similar to how WordPress actions and hooks work: https://bitbucket.org/dgifford/hooks-trait

Initially, I needed this to modify some legacy code, but it could be useful in other classes where you want to intercept and modify variables within standard methods.

Perhaps needing this trait is a ‘code smell’ but sometimes needs must.