Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FileValidator] Format file size in validation message according to binaryFormat option#27970

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@jfredon
Copy link
Contributor

@jfredonjfredon commentedJul 16, 2018
edited
Loading

QA
Branch?2.8 up to master
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#27682
LicenseMIT
Doc PR

The binaryFormat option of the constraint is not taken into account if the maxsize limit is defined by the php configuration files.
This patch correct this inconsistent behavior.

If the binaryOption is not set, the unit of measurement used remains in binary because it’s the unit used in php configuration files.

@jfredonjfredon changed the base branch frommaster to2.8July 16, 2018 20:49
@jfredon
Copy link
ContributorAuthor

I'm not very proud of how i changed the tests, i think i used a dirty trick.
TheFileValidator::factorizeSizes() method is private and so difficult to use in test.
What is the best way of doing this sort of thing ?
Should i change the visibility of the method? Maybe extract the method in a helper object?

@jfredonjfredonforce-pushed theissue-27682_b2.8-FileValidator-message-binaryFormat branch 2 times, most recently fromf48001d toe34d9a3CompareJuly 16, 2018 21:14
}

// Allows the invocation of a private method
publicfunctioninvokeMethod($object,$methodName,$params =array())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

let's do this inline, no need for a method when it is used only once here

@nicolas-grekasnicolas-grekas added this to the2.8 milestoneJul 23, 2018
@jfredonjfredonforce-pushed theissue-27682_b2.8-FileValidator-message-binaryFormat branch frome34d9a3 to8c7c023CompareJuly 23, 2018 21:31
@jfredonjfredon changed the title[WIP][FileValidator] Format file size in validation message according to binaryFormat option[FileValidator] Format file size in validation message according to binaryFormat optionJul 29, 2018
@jfredonjfredonforce-pushed theissue-27682_b2.8-FileValidator-message-binaryFormat branch from8c7c023 to45e5084CompareJuly 29, 2018 18:06
@jfredonjfredonforce-pushed theissue-27682_b2.8-FileValidator-message-binaryFormat branch from45e5084 to0edbbd3CompareJuly 29, 2018 18:16
@fabpot
Copy link
Member

Thank you@jfredon.

@fabpotfabpot merged commit0edbbd3 intosymfony:2.8Sep 4, 2018
fabpot added a commit that referenced this pull requestSep 4, 2018
…ording to binaryFormat option (jfredon)This PR was merged into the 2.8 branch.Discussion----------[FileValidator] Format file size in validation message according to binaryFormat option| Q             | A| ------------- | ---| Branch?       | 2.8 up to master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#27682| License       | MIT| Doc PR        |The binaryFormat option of the constraint is not taken into account if the maxsize limit is defined by the php configuration files.This patch correct this inconsistent behavior.If the binaryOption is not set, the unit of measurement used remains in binary because it’s the unit used in php configuration files.Commits-------0edbbd3 Format file size in validation message according to binaryFormat option
This was referencedSep 30, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

2.8

Development

Successfully merging this pull request may close these issues.

4 participants

@jfredon@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp