Commit Graph

23654 Commits

Author SHA1 Message Date
Graham Campbell b36de36697 Fixed typos in the expectedException annotations 2016-06-30 13:18:54 +02:00
Nicolas Grekas 3ef96b9458 minor #19240 [travis] Fix deps=low/high patching (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[travis] Fix deps=low/high patching

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

Deps=low/high are broken since we added depth=1 to the git checkout on travis...
This fixes the situation and ensures it won't happen again by adding a missing error check.

Commits
-------

5ec92e8 [travis] Fix deps=low/high patching
2016-06-30 08:47:42 +02:00
Nicolas Grekas 5ec92e8af3 [travis] Fix deps=low/high patching 2016-06-30 08:35:34 +02:00
Nicolas Grekas 79fbbded0d minor #19225 [ci] Upgrade phpunit wrapper deps (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[ci] Upgrade phpunit wrapper deps

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

To get https://github.com/sebastianbergmann/exporter/pull/14 in.

Commits
-------

9f916a8 [ci] Upgrade phpunit wrapper deps
2016-06-29 15:02:48 +02:00
Nicolas Grekas 9f916a8279 [ci] Upgrade phpunit wrapper deps 2016-06-29 14:53:38 +02:00
Nicolas Grekas 692740b57a bug #19217 [HttpKernel] Inline ValidateRequestListener logic into HttpKernel (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel] Inline ValidateRequestListener logic into HttpKernel

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18688 #19216
| License       | MIT
| Doc PR        | -

I propose to inline the listener introduced in #18688 into HttpKernel.

Commits
-------

9d3ae85 [HttpKernel] Inline ValidateRequestListener logic into HttpKernel
2016-06-29 13:28:26 +02:00
Nicolas Grekas 9d3ae85301 [HttpKernel] Inline ValidateRequestListener logic into HttpKernel 2016-06-29 12:24:37 +02:00
Fabien Potencier eae78e208a minor #19216 fixed HttpKernel dependencies after #18688 (HeahDude)
This PR was merged into the 2.7 branch.

Discussion
----------

fixed HttpKernel dependencies after #18688

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

Commits
-------

f809f3e fixed HttpKernel dependencies after #18688
2016-06-29 10:26:41 +02:00
Jules Pietri f809f3e340 fixed HttpKernel dependencies after #18688 2016-06-29 10:18:30 +02:00
Fabien Potencier 2d3723007d bug #18688 [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For (magnusnordlander)
This PR was squashed before being merged into the 2.7 branch (closes #18688).

Discussion
----------

[HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For

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

Emit a warning when a request has both a trusted Forwarded header and a trusted X-Forwarded-For header, as this is most likely a misconfiguration which causes security issues.

Commits
-------

ee8842f [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For
2016-06-29 09:01:56 +02:00
Magnus Nordlander ee8842fedb [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For 2016-06-29 09:01:55 +02:00
Fabien Potencier 96f32b6512 bug #19173 [Console] Decouple SymfonyStyle from TableCell (ro0NL)
This PR was squashed before being merged into the 2.7 branch (closes #19173).

Discussion
----------

[Console] Decouple SymfonyStyle from TableCell

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

Alternative approach, ie BC, for #19136 (i prefer that one though, as it also _fixes_ #19123 )

Commits
-------

51f59d6 [Console] Decouple SymfonyStyle from TableCell
2016-06-29 07:44:56 +02:00
Roland Franssen 51f59d6f62 [Console] Decouple SymfonyStyle from TableCell 2016-06-29 07:44:54 +02:00
Fabien Potencier b111d37594 minor #19198 removed dots at the end of @param and @return (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

removed dots at the end of @param and @return

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

For phpdocs, we only add dots for sentences like description, but not for @param and @return for instance. This PR fixes this issue.

This should probably be added to PHP-CS-Fixer as well (/cc @phansys @keradus).

Commits
-------

554303e removed dots at the end of @param and @return
2016-06-29 07:22:22 +02:00
Fabien Potencier a980774e91 minor #19199 fixed typo (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

fixed typo

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

/cc @pborreli This one is for me :)

Commits
-------

e334960 fixed typo
2016-06-29 06:58:45 +02:00
Fabien Potencier 554303e339 removed dots at the end of @param and @return 2016-06-28 08:24:06 +02:00
Fabien Potencier 7dbd849d0f bug #17822 [WIP] [2.7] [Form] fix `empty_data` option in expanded `ChoiceType` (HeahDude)
This PR was merged into the 2.7 branch.

Discussion
----------

[WIP] [2.7] [Form] fix `empty_data` option in expanded `ChoiceType`

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

It might happen because in `Form::submit()` the handling of `empty_data` [line 597](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Form.php#L597) comes after each child of a compound field has been submitted [line 549](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Form.php#L549).

So when `ChoiceType` is `expanded`, `compound` option is defaulted to `true` and it passes its empty submitted data to its children before handling its own `empty_data` option.

This PR uses the listener already added in `ChoiceType` only when `expanded` is true to handle `empty_data` at `PRE_SUBMIT` [line 539](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Form.php#L539).

- [ ] Fix FQCN in tests for 2.8
- [ ] Remove `choices_as_values` in tests for 3.0

Commits
-------

d479adf [Form] fix `empty_data` option in expanded `ChoiceType`
2016-06-28 08:17:04 +02:00
Fabien Potencier e334960776 fixed typo 2016-06-28 07:56:13 +02:00
Fabien Potencier d8dd7f6fae minor #19176 [CS] Respect PSR2 4.2 (phansys)
This PR was merged into the 2.7 branch.

Discussion
----------

[CS] Respect PSR2 4.2

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

http://www.php-fig.org/psr/psr-2/#4-2-properties

I'm writing a [new fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1889) (`single_class_element_per_statement`), which intends to avoid multiple class elements in one statement.
This PR is a POC about the result of this fixer, so I'd like to know what do you think about, since it will be also added to the `@Symfony` ruleset.
Please note that class constants are considered too, but here isn't any offending code about that.

Example output:
```
$ ./php-cs-fixer.phar fix . --rules=single_class_element_per_statement -vvv
   1) src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php (single_class_element_per_statement)
   2) src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php (single_class_element_per_statement)
   3) src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php (single_class_element_per_statement)
   4) src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/includes/foo.php (single_class_element_per_statement)
```

Commits
-------

d250b1d [CS] Respect PSR2 4.2
2016-06-27 07:50:33 +02:00
Javier Spagnoletti d250b1d0f0 [CS] Respect PSR2 4.2
| Q             | A
| ------------- | ---
| Branch        | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

http://www.php-fig.org/psr/psr-2/#4-2-properties
2016-06-25 13:30:09 -03:00
Jules Pietri d479adf073 [Form] fix `empty_data` option in expanded `ChoiceType` 2016-06-25 16:15:36 +02:00
Fabien Potencier fad545aff9 minor #19163 [Console] removed unneeded private methods (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] removed unneeded private methods

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | 3871e1a950 (r68286709)
| License       | MIT
| Doc PR        | n/a

Commits
-------

35f32eb [Console] removed unneeded private methods
2016-06-24 07:34:54 +02:00
Fabien Potencier 35f32ebe12 [Console] removed unneeded private methods 2016-06-24 07:18:49 +02:00
Fabien Potencier 448a390970 bug #19134 Distinguish between first and subsequent progress bar displays (rquadling)
This PR was merged into the 2.7 branch.

Discussion
----------

Distinguish between first and subsequent progress bar displays

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19133
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

Fixes https://github.com/symfony/symfony/issues/19133

When a progress bar is first displayed, if it is multi-line, previously output lines are erased, depending upon the number of lines in the progress bar.

This patch fixes that be distinguishing between the first display (no erasing of previous output) and subsequent displays of the progress bar.

Commits
-------

3871e1a Differentiate between the first time a progress bar is displayed and subsequent times
2016-06-23 15:30:31 +02:00
Fabien Potencier b8c767e0bf minor #19150 sync min email validator version (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

sync min email validator version

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

I stumbled upon this while trying to run the min deps version tests while installing everything from the global `composer.json` file. In the Validator component, we already have this present for a long time sine b1b5cca41c.

Commits
-------

c484db1 sync min email validator version
2016-06-23 09:35:34 +02:00
Christian Flothmann c484db18cf sync min email validator version 2016-06-23 08:40:35 +02:00
Fabien Potencier 97c3102382 minor #19148 [TwigBridge] Fix inconsistency in LintCommand help (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBridge] Fix inconsistency in LintCommand help

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/19139#discussion_r68058993
| License       | MIT
| Doc PR        | ~

Actually, the `lint:yaml` command's help looks like this:

![](http://image.prntscr.com/image/95dddf38ebcf408b8e2e23cf09c3ddf6.png)

The last `Or` about STDIN is syntactically wrong, and is the only one to have a code example with indentation. This gives the same indentation for all code blocks and move the STDIN-related part as first, as proposed in https://github.com/symfony/symfony/pull/19139#discussion_r68049018 .

Now it looks like:

![](http://image.prntscr.com/image/8877349f6be746c981c2e9037d2d17ff.png)

Commits
-------

f54bb16 [TwigBridge] Fix inconsistency in LintCommand help
2016-06-23 07:23:24 +02:00
Fabien Potencier 989f821703 minor #19147 [Validator] explicitly forbid e-mail validator 2.0 or higher (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] explicitly forbid e-mail validator 2.0 or higher

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

Commits
-------

81a6d8e explicitly forbid e-mail validator 2.0 or higher
2016-06-23 07:20:59 +02:00
Robin Chalas f54bb16862
[TwigBridge] Fix inconsistency in LintCommand help 2016-06-22 23:40:57 +02:00
Christian Flothmann 81a6d8ed88 explicitly forbid e-mail validator 2.0 or higher 2016-06-22 23:25:31 +02:00
Fabien Potencier e8901b1669 bug #19061 [FORM] fix post_max_size_message translation (alt. 2) (David Badura)
This PR was merged into the 2.7 branch.

Discussion
----------

[FORM] fix post_max_size_message translation (alt. 2)

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15479, #18543
| License       | MIT
| Doc PR        | -

Commits
-------

9d8a5e5 fix post_max_size_message translation
2016-06-22 13:59:59 +02:00
Fabien Potencier dadf570c7b bug #19100 [Console] Fixed SymfonyQuestionHelper multi-choice with defaults (sstok)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #19100).

Discussion
----------

[Console] Fixed SymfonyQuestionHelper multi-choice with defaults

|Q            |A  |
|---          |---|
|Bug Fix?     |yes|
|New Feature? |no |
|BC Breaks?   |no |
|Deprecations?|no |
|Tests Pass?  |yes|
|Fixed Tickets|   |
|License      |MIT|
|Doc PR       |   |

When you use the SymfonyStyle with a multi-choice question and multiple defaults.
You get an notice because the key is used as-is `0,1` instead of splitting the value.

This pull-request changes the SymfonyQuestionHelper to checks if the Choice is a multi-choice
and displays the selected values correctly `[blue, yellow]`.

Note: Tests are missing, but both the SymfonyStyle and SymfonyQuestionHelper classes
have almost no tests. Making it really hard 😇 hopefully #19097 will make this easier 👍

Commits
-------

a8f6f85 Fixed SymfonyQuestionHelper multi-choice with defaults
2016-06-22 13:33:19 +02:00
Sebastiaan Stok a8f6f85748 Fixed SymfonyQuestionHelper multi-choice with defaults 2016-06-22 13:33:19 +02:00
Fabien Potencier 80057b07e0 bug #18924 [DoctrineBridge] Don't use object IDs in DoctrineChoiceLoader when passing a value closure (webmozart)
This PR was merged into the 2.7 branch.

Discussion
----------

[DoctrineBridge] Don't use object IDs in DoctrineChoiceLoader when passing a value closure

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

This PR is porting an optimization done for `loadChoicesForValues()` in 64c80a6791 to `loadValuesForChoices()`.

Commits
-------

f6e5298 [DoctrineBridge] Don't use object IDs in DoctrineChoiceLoader when passing a value closure
2016-06-22 13:11:55 +02:00
Bernhard Schussek f6e5298f02 [DoctrineBridge] Don't use object IDs in DoctrineChoiceLoader when passing a value closure 2016-06-22 11:11:07 +02:00
Richard Quadling 3871e1a950 Differentiate between the first time a progress bar is displayed and subsequent times 2016-06-22 09:44:25 +01:00
Fabien Potencier eaca0bb0fa bug #19138 [DomCrawler] No more exception on field name with strange format (guiled, fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

[DomCrawler] No more exception on field name with strange format

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18569, #18570
| License       | MIT
| Doc PR        | n/a

Commits
-------

e204913 finished previous commit
953a383 No more exception for malformed input name
2016-06-22 08:42:02 +02:00
Fabien Potencier e204913a67 finished previous commit 2016-06-22 08:40:44 +02:00
guiled 953a3835a2 No more exception for malformed input name 2016-06-22 08:06:22 +02:00
David Badura 9d8a5e5a04 fix post_max_size_message translation 2016-06-21 22:32:24 +02:00
Fabien Potencier f28eb9a617 bug #18935 [Form] Consider a violation even if the form is not submitted (egeloen)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Consider a violation even if the form is not submitted

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes (only for the behavior)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11493
| License       | MIT
| Doc PR        |

Hey!

I'm currently implementing an API using the form component in order to validate the payload sent (in conjonction with the FOSRestBundle). Unfortunatelly, we dig into an issue about the PATCH request which don't map some of our validation rules to the form. Basically, the violations are lost in the middle of the process.

### Use case

We have an entity with the following fields "type", "image" & "video". The field "type"can be either "default", "image" or "video" and then accordingly we use the appropriate field (none for the "default" type, video for the "video" type and image for the "image" type. Then, in our form, we change the validation groups according to our entity type in order to make the "image" field mandatory if the type is "image" and the same for the video field if the type is "video".

### Current behavior

The current behavior (since 2.5) seems to not propages a violation to a form if this form is not submitted but in our use case, changing the field "type" via a PATCH request triggers some new validation which should be reported to end user (inform that a field (video or image) is missing in the PATCH request).

### Expected behavior

The current behavior was introduced in #10567 but IMO, this update is a bug as suggested by @webmozart in https://github.com/symfony/symfony/issues/11493#issuecomment-59549054 Instead, the form component should still map validation errors to the form even if the field was not submitted. If the initial data is not valid, then your initial data was buggy from the beginning but the form should not accept it and instead of silently ignoring the errors, end users should be informed and fix it.

WDYT?

Commits
-------

c483a0f [Form] Consider a violation even if the form is not submitted
2016-06-21 22:19:14 +02:00
Fabien Potencier bbb75faa15 bug #19127 [Form] Add exception to FormRenderer about non-unique block names (enumag)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Add exception to FormRenderer about non-unique block names

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

Commits
-------

c6db6f3 [Form] Add exception to FormRenderer about non-unique block names
2016-06-21 22:02:08 +02:00
Romain Neutron ec19a527be bug #19118 [Process] Fix pipes cleaning on Windows (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Process] Fix pipes cleaning on Windows

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

Commits
-------

d54cd02 [Process] Fix pipes cleaning on Windows
2016-06-21 15:46:37 +02:00
Nicolas Grekas a65fe45ec9 bug #19128 Avoid phpunit 5.4 warnings on getMock (2.7+) (iltar)
This PR was merged into the 2.7 branch.

Discussion
----------

Avoid phpunit 5.4 warnings on getMock (2.7+)

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19125
| License       | MIT
| Doc PR        | ~

Avoids calling `getMock()` in phpunit 5.4 which will trigger a warning (and thus failing test suite) when used by developers as this TestCase is an extension point.

Commits
-------

b05014c Avoid phpunit 5.4 warnings on getMock
2016-06-21 15:39:41 +02:00
Nicolas Grekas d54cd02d06 [Process] Fix pipes cleaning on Windows 2016-06-21 14:37:54 +02:00
Iltar van der Berg b05014c2e9 Avoid phpunit 5.4 warnings on getMock 2016-06-21 09:59:55 +02:00
Jáchym Toušek c6db6f3d50 [Form] Add exception to FormRenderer about non-unique block names 2016-06-21 09:39:01 +02:00
Fabien Potencier 0854c121c9 minor #19121 Php cs fixer (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

Php cs fixer

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

7cc3ca5 fixed CS
fdef804 tweaked default CS fixer config
2016-06-21 07:29:01 +02:00
Fabien Potencier 7cc3ca59d0 fixed CS 2016-06-20 18:47:20 +02:00
Fabien Potencier fdef8041f8 tweaked default CS fixer config 2016-06-20 18:47:15 +02:00