├── .circleci └── config.yml ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── composer.json ├── composer.lock ├── example.phpunit.xml ├── src ├── Alias.php ├── BetterWpHooks.php ├── Contracts │ ├── AbstractListener.php │ ├── Dispatcher.php │ ├── ErrorHandler.php │ └── EventMapper.php ├── Dispatchers │ └── WordpressDispatcher.php ├── Exceptions │ ├── ConfigurationException.php │ ├── DuplicateListenerException.php │ ├── ExecutionErrorHandler.php │ ├── InvalidListenerException.php │ ├── TestException.php │ └── UnremovableListenerException.php ├── Key.php ├── ListenerFactory.php ├── Listeners │ ├── ClassListener.php │ ├── ClosureListener.php │ ├── ContainedListener.php │ └── InstanceListener.php ├── Mappers │ └── WordpressEventMapper.php ├── Mixin.php ├── Testing │ ├── BetterWpHooksTestCase.php │ └── FakeDispatcher.php ├── Traits │ ├── BetterWpHooksFacade.php │ ├── DispatchesConditionally.php │ ├── IsAction.php │ ├── ListensConditionally.php │ └── StopsPropagation.php ├── WordpressApi.php └── functions.php └── tests ├── CustomAssertions.php ├── Exceptions ├── ActionInsteadOfFilterException.php ├── DidAction.php └── DidClosureAction.php ├── StackInfo.php ├── TestDependencies ├── ComplexConstructorDependency.php ├── ComplexListener.php ├── ComplexMethodDependency.php ├── Dependency.php ├── SimpleClass.php ├── SimpleConstructorDependency.php └── SimpleMethodDependency.php ├── TestEvents ├── ActionEvent.php ├── ActionEvent2.php ├── ConditionalEvent.php ├── EventFakeStub.php ├── EventWithDefaultLogic.php ├── EventWithDefaultNoTypeHit.php ├── EventWithDefaults.php ├── FilterableEvent.php ├── FilterableWithoutDefault.php ├── WithCustomPayload.php └── WithoutCustomPayload.php ├── TestListeners ├── ActionListener.php ├── ConditionalListener.php ├── ImpossibleListener.php ├── InvokeableListener.php ├── ListenerWithReturn2.php ├── ListenerWithReturn3.php ├── ListenerWithReturnConditional.php ├── StdClassListener.php ├── StopListener.php └── ThrowExceptionListener.php ├── TestStubs ├── DifferentContainer.php ├── Plugin1.php └── Plugin2.php ├── Unit ├── BetterWpHooksFacadeTestingTest.php ├── BetterWpHooksTest.php ├── CustomizedPayloadTest.php ├── FakeDispatcherTest.php ├── HooksOrderTest.php ├── StripEmptyStringTest.php └── WordpressDispatcherTest.php ├── UnitTestCaseTests └── BetterWpHooksTestCaseTest.php └── bootstrap.php /.circleci/config.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/.circleci/config.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/.gitignore -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/CHANGELOG.md -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/CONTRIBUTING.md -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/LICENSE.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/README.md -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/composer.json -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/composer.lock -------------------------------------------------------------------------------- /example.phpunit.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/example.phpunit.xml -------------------------------------------------------------------------------- /src/Alias.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Alias.php -------------------------------------------------------------------------------- /src/BetterWpHooks.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/BetterWpHooks.php -------------------------------------------------------------------------------- /src/Contracts/AbstractListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Contracts/AbstractListener.php -------------------------------------------------------------------------------- /src/Contracts/Dispatcher.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Contracts/Dispatcher.php -------------------------------------------------------------------------------- /src/Contracts/ErrorHandler.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Contracts/ErrorHandler.php -------------------------------------------------------------------------------- /src/Contracts/EventMapper.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Contracts/EventMapper.php -------------------------------------------------------------------------------- /src/Dispatchers/WordpressDispatcher.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Dispatchers/WordpressDispatcher.php -------------------------------------------------------------------------------- /src/Exceptions/ConfigurationException.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Exceptions/ConfigurationException.php -------------------------------------------------------------------------------- /src/Exceptions/DuplicateListenerException.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Exceptions/DuplicateListenerException.php -------------------------------------------------------------------------------- /src/Exceptions/ExecutionErrorHandler.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Exceptions/ExecutionErrorHandler.php -------------------------------------------------------------------------------- /src/Exceptions/InvalidListenerException.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Exceptions/InvalidListenerException.php -------------------------------------------------------------------------------- /src/Exceptions/TestException.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Exceptions/TestException.php -------------------------------------------------------------------------------- /src/Exceptions/UnremovableListenerException.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Exceptions/UnremovableListenerException.php -------------------------------------------------------------------------------- /src/Key.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Key.php -------------------------------------------------------------------------------- /src/ListenerFactory.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/ListenerFactory.php -------------------------------------------------------------------------------- /src/Listeners/ClassListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Listeners/ClassListener.php -------------------------------------------------------------------------------- /src/Listeners/ClosureListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Listeners/ClosureListener.php -------------------------------------------------------------------------------- /src/Listeners/ContainedListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Listeners/ContainedListener.php -------------------------------------------------------------------------------- /src/Listeners/InstanceListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Listeners/InstanceListener.php -------------------------------------------------------------------------------- /src/Mappers/WordpressEventMapper.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Mappers/WordpressEventMapper.php -------------------------------------------------------------------------------- /src/Mixin.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Mixin.php -------------------------------------------------------------------------------- /src/Testing/BetterWpHooksTestCase.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Testing/BetterWpHooksTestCase.php -------------------------------------------------------------------------------- /src/Testing/FakeDispatcher.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Testing/FakeDispatcher.php -------------------------------------------------------------------------------- /src/Traits/BetterWpHooksFacade.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Traits/BetterWpHooksFacade.php -------------------------------------------------------------------------------- /src/Traits/DispatchesConditionally.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Traits/DispatchesConditionally.php -------------------------------------------------------------------------------- /src/Traits/IsAction.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Traits/IsAction.php -------------------------------------------------------------------------------- /src/Traits/ListensConditionally.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Traits/ListensConditionally.php -------------------------------------------------------------------------------- /src/Traits/StopsPropagation.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/Traits/StopsPropagation.php -------------------------------------------------------------------------------- /src/WordpressApi.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/WordpressApi.php -------------------------------------------------------------------------------- /src/functions.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/src/functions.php -------------------------------------------------------------------------------- /tests/CustomAssertions.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/CustomAssertions.php -------------------------------------------------------------------------------- /tests/Exceptions/ActionInsteadOfFilterException.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/Exceptions/ActionInsteadOfFilterException.php -------------------------------------------------------------------------------- /tests/Exceptions/DidAction.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/Exceptions/DidAction.php -------------------------------------------------------------------------------- /tests/Exceptions/DidClosureAction.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/Exceptions/DidClosureAction.php -------------------------------------------------------------------------------- /tests/StackInfo.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/StackInfo.php -------------------------------------------------------------------------------- /tests/TestDependencies/ComplexConstructorDependency.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestDependencies/ComplexConstructorDependency.php -------------------------------------------------------------------------------- /tests/TestDependencies/ComplexListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestDependencies/ComplexListener.php -------------------------------------------------------------------------------- /tests/TestDependencies/ComplexMethodDependency.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestDependencies/ComplexMethodDependency.php -------------------------------------------------------------------------------- /tests/TestDependencies/Dependency.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestDependencies/Dependency.php -------------------------------------------------------------------------------- /tests/TestDependencies/SimpleClass.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestDependencies/SimpleClass.php -------------------------------------------------------------------------------- /tests/TestDependencies/SimpleConstructorDependency.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestDependencies/SimpleConstructorDependency.php -------------------------------------------------------------------------------- /tests/TestDependencies/SimpleMethodDependency.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestDependencies/SimpleMethodDependency.php -------------------------------------------------------------------------------- /tests/TestEvents/ActionEvent.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestEvents/ActionEvent.php -------------------------------------------------------------------------------- /tests/TestEvents/ActionEvent2.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestEvents/ActionEvent2.php -------------------------------------------------------------------------------- /tests/TestEvents/ConditionalEvent.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestEvents/ConditionalEvent.php -------------------------------------------------------------------------------- /tests/TestEvents/EventFakeStub.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestEvents/EventFakeStub.php -------------------------------------------------------------------------------- /tests/TestEvents/EventWithDefaultLogic.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestEvents/EventWithDefaultLogic.php -------------------------------------------------------------------------------- /tests/TestEvents/EventWithDefaultNoTypeHit.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestEvents/EventWithDefaultNoTypeHit.php -------------------------------------------------------------------------------- /tests/TestEvents/EventWithDefaults.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestEvents/EventWithDefaults.php -------------------------------------------------------------------------------- /tests/TestEvents/FilterableEvent.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestEvents/FilterableEvent.php -------------------------------------------------------------------------------- /tests/TestEvents/FilterableWithoutDefault.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestEvents/FilterableWithoutDefault.php -------------------------------------------------------------------------------- /tests/TestEvents/WithCustomPayload.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestEvents/WithCustomPayload.php -------------------------------------------------------------------------------- /tests/TestEvents/WithoutCustomPayload.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestEvents/WithoutCustomPayload.php -------------------------------------------------------------------------------- /tests/TestListeners/ActionListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestListeners/ActionListener.php -------------------------------------------------------------------------------- /tests/TestListeners/ConditionalListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestListeners/ConditionalListener.php -------------------------------------------------------------------------------- /tests/TestListeners/ImpossibleListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestListeners/ImpossibleListener.php -------------------------------------------------------------------------------- /tests/TestListeners/InvokeableListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestListeners/InvokeableListener.php -------------------------------------------------------------------------------- /tests/TestListeners/ListenerWithReturn2.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestListeners/ListenerWithReturn2.php -------------------------------------------------------------------------------- /tests/TestListeners/ListenerWithReturn3.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestListeners/ListenerWithReturn3.php -------------------------------------------------------------------------------- /tests/TestListeners/ListenerWithReturnConditional.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestListeners/ListenerWithReturnConditional.php -------------------------------------------------------------------------------- /tests/TestListeners/StdClassListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestListeners/StdClassListener.php -------------------------------------------------------------------------------- /tests/TestListeners/StopListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestListeners/StopListener.php -------------------------------------------------------------------------------- /tests/TestListeners/ThrowExceptionListener.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestListeners/ThrowExceptionListener.php -------------------------------------------------------------------------------- /tests/TestStubs/DifferentContainer.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestStubs/DifferentContainer.php -------------------------------------------------------------------------------- /tests/TestStubs/Plugin1.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestStubs/Plugin1.php -------------------------------------------------------------------------------- /tests/TestStubs/Plugin2.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/TestStubs/Plugin2.php -------------------------------------------------------------------------------- /tests/Unit/BetterWpHooksFacadeTestingTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/Unit/BetterWpHooksFacadeTestingTest.php -------------------------------------------------------------------------------- /tests/Unit/BetterWpHooksTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/Unit/BetterWpHooksTest.php -------------------------------------------------------------------------------- /tests/Unit/CustomizedPayloadTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/Unit/CustomizedPayloadTest.php -------------------------------------------------------------------------------- /tests/Unit/FakeDispatcherTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/Unit/FakeDispatcherTest.php -------------------------------------------------------------------------------- /tests/Unit/HooksOrderTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/Unit/HooksOrderTest.php -------------------------------------------------------------------------------- /tests/Unit/StripEmptyStringTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/Unit/StripEmptyStringTest.php -------------------------------------------------------------------------------- /tests/Unit/WordpressDispatcherTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/Unit/WordpressDispatcherTest.php -------------------------------------------------------------------------------- /tests/UnitTestCaseTests/BetterWpHooksTestCaseTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/UnitTestCaseTests/BetterWpHooksTestCaseTest.php -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calvinalkan/better-wordpress-hooks/HEAD/tests/bootstrap.php --------------------------------------------------------------------------------