Skip to content

Conversation

@alganet
Copy link
Member

@alganet alganet commented Jan 31, 2026

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.

@alganet alganet marked this pull request as ready for review January 31, 2026 18:37
@alganet alganet requested a review from Copilot January 31, 2026 18:37
@codecov-commenter
Copy link

codecov-commenter commented Jan 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.31%. Comparing base (99829b7) to head (727892f).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a 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 (wraps number_format) and DateFormatter (wraps DateTime + date_format) implementing Formatter
  • 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.

@alganet alganet force-pushed the number-date branch 3 times, most recently from d688379 to abc04a6 Compare January 31, 2026 18:57
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants