-
Notifications
You must be signed in to change notification settings - Fork 2
Introduce DateFormatter and NumberFormatter #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4 +/- ##
============================================
+ Coverage 99.27% 99.31% +0.04%
- Complexity 132 141 +9
============================================
Files 12 14 +2
Lines 276 294 +18
============================================
+ Hits 274 292 +18
Misses 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds two new built-in formatters for common number and date formatting needs, with documentation and unit tests.
Changes:
- Introduces
NumberFormatter(wrapsnumber_format) andDateFormatter(wrapsDateTime+date_format) implementingFormatter - Adds unit tests covering typical formatting and “return input unchanged” behavior
- Adds formatter documentation pages and links them from the README
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/NumberFormatter.php | Implements numeric string formatting via number_format() with configurable separators/decimals |
| src/DateFormatter.php | Implements date parsing/formatting via DateTime + date_format() |
| tests/Unit/NumberFormatterTest.php | Adds coverage for numeric formatting and non-numeric passthrough |
| tests/Unit/DateFormatterTest.php | Adds coverage for date formatting and unparsable-input passthrough |
| docs/NumberFormatter.md | Documents NumberFormatter usage and behavior |
| docs/DateFormatter.md | Documents DateFormatter usage and behavior |
| README.md | Adds the new formatters to the documentation table and updates contributor metadata |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d688379 to
abc04a6
Compare
Introduce formatters for the typical use cases of formatting numbers and dates. Internally, those formatters use `number_format` and `date_format` respectively. If a date cannot be parsed in runtime, the formatter will return the input unmodified. Similarly, if some input is not numeric, the numeric formatter will return it unchanged.
Introduce formatters for the typical use cases of formatting numbers and dates.
Internally, those formatters use
number_formatanddate_formatrespectively.If a date cannot be parsed in runtime, the formatter will return the input unmodified. Similarly, if some input is not numeric, the numeric formatter will return it unchanged.