2608637210
HandlerListManager: track RegisteredListenerCache directly
...
This change improves the performance of calling an event with 0 handlers by about 10% with no other changes.
Since we have to access the list eventually anyway, we can cut out some unnecessary work by returning the handlers from the cache directly, instead of fetching the HandlerList for no reason.
This also improves the performance of Event::hasHandlers() by about 40%, which is pretty significant (120 ns -> 80 ns).
2023-08-01 17:37:49 +01:00
3b6ff3c42b
Apply union types in some places (BC breaks)
2022-11-23 14:03:35 +00:00
dce8bd6d21
CS: Standardize new with braces
2022-08-15 17:16:23 +01:00
38d6284671
Use PHP-CS-Fixer to enforce file header presence
2022-06-04 17:34:49 +01:00
eb95e2a97e
Modernize private property declarations in src/event
2022-05-17 20:45:50 +01:00
aa6bd4438a
Replace disallowed operators in src/event/
2022-01-20 19:17:17 +00:00
2ad5de379f
HandlerListManager::unregisterAll() accepts RegisteredListener
...
since all this function is doing is passing the object on to the HandlerList, it should accept RegisteredListener, like HandlerList::unregister().
2021-08-10 15:28:11 +01:00
041d314190
HandlerListManager: apply class-string type for getListFor() parameter
2021-08-05 20:11:58 +01:00
fb4b92d1f4
HandlerListManager: fixed missing null type flag
2020-09-06 16:12:54 +01:00
b3df5f4e95
CS: strip unneeded phpdoc
2020-06-18 20:01:49 +01:00
cc549630e5
HandlerListManager: fixed @param doc comment not referring to correct ReflectionClass
...
phpstan doesn't notice this because of the phpstan-param doc directly underneath.
2020-05-30 22:29:30 +01:00
85f3dca11b
HandlerListManager: make resolveNearestHandleableParent() a little easier to follow
...
and also sidestep phpstan complaining about using loop vars outside of loop
2020-02-07 22:07:36 +00:00
a3bffd375b
master-specific addendum to cd55cdf5c6
2020-01-22 15:07:47 +00:00
67bcc1c0fb
phpdoc armageddon for master, pass 1
2020-01-22 11:55:03 +00:00
0e1cea043a
added some phpstan-specific generic type annotations
2020-01-13 15:05:02 +00:00
e5b02ee5e0
make logic for fetching handler lists more consistent
2019-08-23 17:16:07 +01:00
5499ac620c
Removed pocketmine subdirectory, map PSR-4 style
2019-07-30 19:14:57 +01:00