reactphp / reactphp

Event-driven, non-blocking I/O with PHP.

Home Page:https://reactphp.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Improvement] Switch from magic strings to constants

michaelcullum opened this issue · comments

Currently there are often magic strings used like data and connection, constants (essentially as enums?) or having a series of different methods should be used instead ideally.

Do like the suggestion and I think constants are the easiest way to implement currently. Using methods would add 3 methods for each type (on, remove, and remove all).

@michaelcullum Thanks for raising this issue and trying to spark this discussion.

While this has gained little traction, there's an open PR in reactphp/stream#134. The little attention this has received seems to imply there's little interest in pursuing this further, but if this is something you or anybody else is interested in, make sure to contribute to the discussion in the PR 👍