Repository navigation
Fix raw input formatting - #766
Conversation
|
Can you add a test case and description to the PR showing what this is fixing? |
add test
|
add test |
| * Gets phone metadata for a non-geographical region. | ||
| */ | ||
| public function getMetadataForNonGeographicalRegion(int $countryCallingCode): PhoneMetadata; | ||
| public function getMetadataForNonGeographicalRegion(?int $countryCallingCode): PhoneMetadata; |
There was a problem hiding this comment.
Why are the function declarations being changed?
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The interface change is backward-incompatible, and null may be forwarded to a non-nullable parameter.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Updates phone number formatting for raw-input-only instances and adds regression coverage.
Changes:
- Preserve raw input when the national number is unset.
- Add nullable country-code handling.
- Add regression tests.
| File | Description |
|---|---|
tests/core/PhoneNumberUtilTest.php |
Adds raw-input formatting coverage. |
src/PhoneNumberUtil.php |
Handles unset national numbers and nullable metadata lookups. |
src/MultiFileMetadataSourceImpl.php |
Updates metadata lookup parameter handling. |
src/MetadataSourceInterface.php |
Updates the metadata source contract. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #766 +/- ##
============================================
- Coverage 85.94% 85.86% -0.09%
- Complexity 1304 1318 +14
============================================
Files 31 31
Lines 3430 3445 +15
============================================
+ Hits 2948 2958 +10
- Misses 482 487 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for the fix. I've reduced the changes slightly whilst maintaining the passing test case you added. |


fix odolbeau/phone-number-bundle#217