1 | <?php |
||
26 | final class Events |
||
27 | { |
||
28 | const BOOT_INIT = 'bonefish.boot'; |
||
29 | const CACHE_INIT = 'bonefish.cache.init'; |
||
30 | const ANNOTATION_READER_INIT = 'bonefish.annotations.init'; |
||
31 | const REFLECTION_SERVICE_INIT = 'bonefish.reflection.init'; |
||
32 | const CONTAINER_INIT = 'bonefish.container.init'; |
||
33 | const CONTAINER_SETUP = 'bonefish.container.setup'; |
||
34 | const REQUEST_INIT = 'bonefish.request.init'; |
||
35 | const COLLECTORS_INIT = 'bonefish.collectors.init'; |
||
36 | const REQUEST_BEFORE_HANDLE = 'bonefish.request.before'; |
||
37 | const REQUEST_HANDLE = 'bonefish.request.handle'; |
||
38 | const RESPONSE_BEFORE_SEND = 'bonefish.response.before'; |
||
39 | const RESPONSE_AFTER_SEND = 'bonefish.response.after'; |
||
40 | } |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.