fix(server): deduplicate generateUuid() into Phlix\Common\Uuid::v4() (Step C2)#335
Closed
detain wants to merge 1 commit into
Closed
fix(server): deduplicate generateUuid() into Phlix\Common\Uuid::v4() (Step C2)#335detain wants to merge 1 commit into
detain wants to merge 1 commit into
Conversation
Step C2: Consolidate ~32 duplicate private generateUuid() methods into a single shared Phlix\Common\Uuid::v4() implementation. - Add new Phlix\Common\Uuid final readonly class with static v4() method producing RFC 4122 v4 UUIDs matching the historical sprintf format. - Replace all private generateUuid() method bodies with 'return Uuid::v4()' as BC wrappers (callers unchanged). - For PluginRepository, keep public static generateUuid() as BC wrapper. - Remove now-unused UUID_FORMAT constant from PluginRepository. - Add comprehensive UuidTest covering format, version digit, variant digit, and uniqueness across multiple calls. - Remove duplicate UUID_FORMAT constant from WebhookDispatcher (unused). - All call sites preserved; no behaviour change. PHPStan level 9: clean. PHPCS PSR-12: clean. Integration tests: 41 pass (5 skipped).
|
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 | 37 medium 1 minor |
| Documentation | 12 minor |
| CodeStyle | 13 minor |
🟢 Metrics 7 complexity · 0 duplication
Metric Results Complexity 7 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.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #335 +/- ##
============================================
- Coverage 59.93% 59.93% -0.01%
- Complexity 13005 13007 +2
============================================
Files 480 481 +1
Lines 42399 42123 -276
============================================
- Hits 25413 25246 -167
+ Misses 16986 16877 -109 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Step C2 of the deduplication plan: consolidate ~32 duplicate
generateUuid()methods into a single shared implementation.What changed
src/Common/Uuid.php: Afinal readonlyclass with a single staticv4()method producing RFC 4122 v4 UUIDs matching the historical per-class implementation format.private function generateUuid()now delegates toUuid::v4()— all call sites unchanged (BC wrappers preserved).public static function generateUuid()is kept as a BC wrapper callingUuid::v4().UUID_FORMATconstant fromPluginRepository(was only used by the replaced method);UUID_FORMATconstant fromWebhookDispatcher(was only used by the replaced method).tests/Unit/Common/UuidTest.php: 7 focused tests covering format compliance, version digit, variant digit, length, and uniqueness.Verification
Note on Unit test suite
The full
phpunitsuite (Unit tests) has a pre-existing bootstrap failure:WorkermanArrTransportTest.phpreferencesPhlix\Shared\Arr\Transport\ArrTransportInterfacewhich does not exist indetain/phlix-shared: 0.10.0. This is unrelated to this PR — it fails onorigin/mastertoo. The Integration suite runs clean.