Closed butschster closed 8 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
9206d2a
) 93.11% compared to head (adbadd0
) 93.46%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This pull request introduces significant improvements to the class generator for Centrifugo handlers. The refactor enhances the functionality of the generator, enabling it to create diverse handler types catering to various aspects of Centrifugo server interaction.
Changes
Expanded Handler Types: The generator now supports multiple handler types:
connect
,subscribe
,rpc
,refresh
, andpublish
. Each type corresponds to different interactions with the Centrifugo server, providing tailored functionality for specific use cases.Default Handler Type: The default command (
php app.php create:centrifugo-handler Simple
) now generates aconnect
type handler, aligning with the most common use case.Enhanced Code Templates: Each handler type comes with its specific code template, ensuring that generated classes are immediately relevant and useful. This update enhances developer experience and reduces the need for manual modifications post-generation.
Before
Here are example of handlers:
Connect
Command:
Result:
Subscribe
Command:
Result:
RPC
Command:
Result:
Refresh
Command:
Result:
Publish
Command:
Result:
Before
After
This enhancement fosters a more efficient and streamlined workflow for developers working with Centrifugo in our PHP environment. It not only saves time but also ensures consistency and adherence to best practices across different types of handlers.