Skip to content

[Form] moved data trimming logic of TrimListener into StringUtil #14660

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

Closed
wants to merge 2 commits into from

Conversation

issei-m
Copy link
Contributor

@issei-m issei-m commented May 16, 2015

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

I introduced this PR at #14146, but I didn't make it on time for 2.7 feature freeze. So I'm opening the new PR for 2.8.

Following is my first introduction:

In the small job which needs not to build a form (e.g. just process a value gotten from Request), I want to reuse the trim logic.

@dosten
@Tobion
@xabbuh
@stof
@webmozart
Thanks for all your feedback. I have fixed all issues mentioned on #14146. Please re-consider it.

@nicolas-grekas
Copy link
Member

The feature looks strange to me: a StringUtil in the Form component to deal with non-form-related situations. If I'm the only one, then an entry in the CHANGELOG is missing :)

@issei-m
Copy link
Contributor Author

issei-m commented May 21, 2015

@nicolas-grekas
Although I said this feature is used without creating a form, this substantially concerns the form (as document explains, it focuses on processing data) I think.
It's just like the StringUtils in Security/Core.

btw, I have just updated CHANGELOG :)

@issei-m
Copy link
Contributor Author

issei-m commented May 21, 2015

Oh..., I marked deprecation "yes" mistakenly. There is no deprecation in this PR.

@issei-m
Copy link
Contributor Author

issei-m commented Jun 2, 2015

ping @webmozart

@webmozart webmozart added the Form label Jun 16, 2015
/**
* This class should not be instantiated.
*/
private function __construct()
Copy link
Contributor

Choose a reason for hiding this comment

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

Private methods should go after public methods.

Copy link
Member

Choose a reason for hiding this comment

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

Not in this case IMHO. Constructor are always first.

Copy link
Contributor

Choose a reason for hiding this comment

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

Even before static methods?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that's what we are doing in Symfony.

Copy link
Contributor

Choose a reason for hiding this comment

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

i think the most important should be first (which are the constructor and public methods). since the constructor is private it doesn't need to be first in this case as this is not what is of interest.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I think private constructor should be after too, but some util classes' constructor is first. (e.g. classes in Security/Core, FormUtil as well).

@webmozart
Copy link
Contributor

Thanks @issei-m! Could you rebase this onto 2.8 and fix the issues I mentioned? After that, I'm 👍.

@issei-m
Copy link
Contributor Author

issei-m commented Jun 20, 2015

@webmozart Thanks for your good. I've fixed code you mentioned and rebased onto 2.8.

@webmozart
Copy link
Contributor

Thanks @issei-m :)

@webmozart webmozart closed this in 3151614 Jun 22, 2015
@issei-m issei-m deleted the form-trim branch June 23, 2015 05:57
@fabpot fabpot mentioned this pull request Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants