Skip to content

Commit

Permalink
bug #58 Update custom listener documentation (maciekpaprocki)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.8-dev branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | any since the implementation
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | just doc
| License         | MIT

The current doc is a bit outdated. 

You need to implement the right interface to tell the system which hook should be run.  

Hopefully, that will help someone in the future trying to figure out why their listener is not working.

Commits
-------

2ec967b Update custom listener documentation
  • Loading branch information
lchrusciel authored Jul 4, 2022
2 parents 2fee62c + 2ec967b commit 65e2eae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/custom_listener.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ final class DirectoryPurgerListener extends AbstractListener implements BeforeSu
}
```

The next step is to register this listener:
If you want to listen to different/more event(s) instead of BeforeSuiteListenerInterface implement one or more of those interfaces:
- AfterFixtureListenerInterface
- AfterSuiteListenerInterface
- BeforeFixtureListenerInterface
- BeforeSuiteListenerInterface

The next step is to register this listener ( you can avoid this step when using autoconfiguration ):

```xml
<service id="app.listener.directory_purger" class="App\Fixture\DirectoryPurgerListener">
Expand Down

0 comments on commit 65e2eae

Please sign in to comment.