Make file size messages human-readable#803
Open
samdark wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the File validation rule to render size-related placeholders ({limit}, {exactly}) as human-readable values (e.g. 50 MB) instead of raw byte counts, and aligns defaults, tests, and documentation with that behavior.
Changes:
- Format
{limit}/{exactly}placeholders as human-readable sizes inFileHandler. - Update default
Filesize messages to use{limit}/{exactly}directly (no ICU number/plural formatting). - Add regression tests and document the new placeholder behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
src/Rule/FileHandler.php |
Formats size placeholders before they’re passed into error message parameters. |
src/Rule/File.php |
Updates default size messages and placeholder documentation to reflect human-readable sizing. |
tests/Rule/FileTest.php |
Adds/updates regression cases asserting new human-readable size output. |
docs/guide/en/built-in-rules-file.md |
Documents that size placeholders are now human-readable. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4700917 to
3dfc85b
Compare
79319f6 to
b4e4c86
Compare
53fb650 to
7d12a71
Compare
7d12a71 to
f93aa4a
Compare
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.
Resolves #802.
Summary
Tests
Full vendor/bin/phpunit was also run; it fails only on existing EmailTest DNS-dependent cases for gmail.com and ñandu.cl domains in this environment.