fix/9.1: Add shared Relay frame types#6
Merged
Conversation
…, RelayFrame) Add Phlix\Shared\Relay\ namespace with the shared relay wire protocol types: - RelayFrameType: PHP 8.3 backed enum with 8 frame type constants (HELLO=0x01 through ERROR=0x08) for the multiplexed WS relay protocol - RelayWireCodecInterface: interface for encode/decode operations on relay frames - RelayFrame: immutable value object representing a relay frame Bump version to 0.5.0 and update CHANGELOG. Tests: - RelayFrameTypeTest: 47 tests covering all enum cases, fromValue, isValid, label - RelayFrameTest: tests for value object properties and type-check methods Refs: phlix-hub/docs/ws-multiplexer-plan.md Section 9.1 Phase 1
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| BestPractice | 21 medium |
| CodeStyle | 23 minor |
| Complexity | 1 medium |
🟢 Metrics 38 complexity · 0 duplication
Metric Results Complexity 38 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add shared relay wire protocol types in
Phlix\Shared\Relay\namespace for the multiplexed WebSocket relay protocol (Section 9.1 Phase 1).Changes
New files in
src/Relay/RelayFrameType.php— PHP 8.3 backed enum with 8 frame type constants:HELLO(0x01),HELLO_ACK(0x02),CLIENT_CONNECT(0x03),CLIENT_DISCONNECT(0x04)DATA(0x05),HEARTBEAT(0x06),DISCONNECTED(0x07),ERROR(0x08)fromValue(),isValid(), andlabel()methodsRelayWireCodecInterface.php— interface for encode/decode operations:encode(RelayFrameType, int seq, string payload): stringencodeHello(string enrollmentJwt, string serverId): string(JSON text)encodeHelloAck(string relaySessionId, string tunnelId): string(JSON text)decode(string bytes): ?RelayFrameRelayFrame.php— immutable value object:type (RelayFrameType),seq (int),payload (string)isData(),isHeartbeat(),isClientConnect(), etc.Updated files
src/Version.php— bump to0.5.0CHANGELOG.md— add 0.5.0 entrytests/Relay/RelayFrameTypeTest.php— 47 tests for enum cases and helper methodstests/Relay/RelayFrameTest.php— tests for value object properties and type-check methodsVerification
Related
phlix-hub/docs/ws-multiplexer-plan.md(Section 9.1 Phase 1)detain/phlix-serverPRfix/9.1-server-relay-wiringto consume these types