Skip to content

Conversation

@MisatoTremor
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #13389
License MIT
Doc PR symfony/symfony-docs#4817

Replaces #13390

@webmozart webmozart added the Form label Jun 22, 2015
Copy link
Contributor

Choose a reason for hiding this comment

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

is the header copied from other files?

i think you should be named here @MisatoTremor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is the standard copyright header.
I've put my name at the class author PHPDoc as usual. ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, i didn't know.

thank you!

@jewome62
Copy link
Contributor

jewome62 commented Oct 5, 2015

🆒 !!!

When that will be integrated into the 2.8?

Copy link
Member

Choose a reason for hiding this comment

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

IMO, this if/else should be outside the try/catch, avoiding the need to catch TransformationFailedException as is (and it should use an early return)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, makes absolute sense to put it outside.
But is it really OK to just return null if the value is something the transformer does not expect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stof
Just saw again that this throw > catch > throw pattern is also used in DateTimeToStringTransformer. Most probably I got it originally from there.

So maybe both should be changed (DateTimeToStringTransformer in another PR then) or just be left as is.

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Simplifying the DateTimeToStringTransformer in another PR makes sense yeah. but it should indeed be a separate PR

@MisatoTremor MisatoTremor force-pushed the add_dateinterval_type_2_8 branch from b7498b3 to 8045bc5 Compare October 14, 2015 08:30
Also add dateinterval widget to twig templates.
@MisatoTremor MisatoTremor force-pushed the add_dateinterval_type_2_8 branch from 0d8f42e to f235fef Compare October 14, 2015 09:55
@MisatoTremor
Copy link
Contributor Author

@stof Ok, simplified the transformer and also moved the format check out of the try/catch as this also was a throw > catch > throw.
Also fixed the deprecated form type by string name references and squashed commits.

AppVeyor build failure seems because of something else, as it also fails for the same tests in other PRs, etc. and Form component test passes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@MisatoTremor
Copy link
Contributor Author

Rebased on master

fabpot added a commit that referenced this pull request Jun 22, 2016
…m type (MisatoTremor)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[Form][FrameworkBundle][Bridge] Add a DateInterval form type

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #13389
| License       | MIT
| Doc PR        | symfony/symfony-docs#4817

Replaces #15030

Commits
-------

f7669be [Form] Add a DateInterval form type Also add dateinterval widget to twig templates.
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.

6 participants