Commit Graph

23654 Commits

Author SHA1 Message Date
JhonnyL
87c4f23764 [DependencyInjection] Add coverage for all invalid arguments in exportParameters 2016-04-10 20:31:05 +02:00
Christian Flothmann
0a469a418f anonymous services are always private 2016-04-09 16:46:37 +02:00
Jules Pietri
ea5375c7b7 [Form] refactor CheckboxListMapper and RadioListMapper
fixes #14712 and #17789.

`ChoiceType` now always use `ChoiceToValueTransformer` or
`ChoicesToValuesTransformer` depending on `multiple` option.
Hence `CheckboxListMapper` and `RadioListMapper` don’t handle
the transformation anymore.
Fixes pre selection of choice with model values such as `null`,
`false` or empty string.
2016-04-09 15:28:45 +02:00
Jules Pietri
71841c737c Revert "[Form] refactor RadioListMapper::mapDataToForm()"
closes #18173.

This reverts commit 8f918e5f84.
2016-04-09 15:28:10 +02:00
Christian Flothmann
064aedf9e3 Merge branch '2.3' into 2.7
* 2.3:
  [DependencyInjection] Resolve aliases before removing abstract services + add tests
  Fix Dom Crawler select option with empty value
  Remove unnecessary option assignment
  remove unused variable
  [PropertyAccess] Fix regression
2016-04-09 12:56:56 +02:00
Fabien Potencier
416f7d751f bug #18449 [PropertyAccess] Fix regression (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[PropertyAccess] Fix regression

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

All credits go to @MisatoTremor

I don't measure any perf impact.

Commits
-------

2b30d48 [PropertyAccess] Fix regression
2016-04-07 17:14:27 +02:00
Fabien Potencier
283875b325 bug #18429 [Console] Correct time formatting. (camporter)
This PR was squashed before being merged into the 2.7 branch (closes #18429).

Discussion
----------

[Console] Correct time formatting.

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

The previous behavior caused dramatic jumps in the reported time instead of smoothly transitioning between time ranges.
Added tests around the new behavior and the transitions between seconds, minutes, and days.

Commits
-------

b264b66 [Console] Correct time formatting.
2016-04-07 17:12:31 +02:00
Cameron Porter
b264b66a90 [Console] Correct time formatting. 2016-04-07 17:12:27 +02:00
Fabien Potencier
004a6678d2 bug #18467 [DependencyInjection] Resolve aliases before removing abstract services + add tests (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[DependencyInjection] Resolve aliases before removing abstract services + add tests

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

Commits
-------

9802a41 [DependencyInjection] Resolve aliases before removing abstract services + add tests
2016-04-07 17:04:06 +02:00
Christophe Coevoet
abf4f67605 bug #18460 [DomCrawler] Fix select option with empty value (Matt Wells)
This PR was merged into the 2.3 branch.

Discussion
----------

[DomCrawler] Fix select option with empty value

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

While using the Laravel's testing suite which makes use of the Symfony DOM Crawler (v3.0.2). I have been populating a form with a select which has a value which can be an empty value.

For example, with this select you can choose your gender or leave it empty if you don't want to specify:

```html
<select name="gender">
  <option selected></option>
  <option>Female</option>
  <option>Male</option>
</select>
```

When the `DomCrawler\Field::getValue()` is called I was expect to get the value `''` however I was actually getting `'on'`. This is caused by the [DomCrawler\Field::buildOptionValue()](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php#L262-L271) sets the default value to 'on' when there is no value which makes sense for ratios and checkboxes but not for select.

I have tracked this bug back to v2.3 but it is still present in v3, however, the default value was changed from '1' to 'on' in v2.5 which means that this patch will conflict when merging up the maintained versions.

Commits
-------

58276a2 Fix Dom Crawler select option with empty value
2016-04-07 10:21:15 +02:00
Nicolas Grekas
9802a41b3c [DependencyInjection] Resolve aliases before removing abstract services + add tests 2016-04-06 19:38:23 +02:00
Matt Wells
58276a274e Fix Dom Crawler select option with empty value 2016-04-06 14:13:46 +01:00
Tobias Schultze
5c94dccd59 minor #18452 [Security] mock the proper method (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] mock the proper method

| 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
-------

4b78d03 mock the proper method
2016-04-06 13:28:56 +02:00
Tobias Schultze
e251e36467 minor #18456 [Form] Remove unnecessary option assignment (sergeyfedotov)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Remove unnecessary option assignment

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

Option assignment is not required because the prototype inherits this option from the parent form via standard inheritance mechanism.

Related pull requests: #16959, #18317

Commits
-------

da8a197 Remove unnecessary option assignment
2016-04-06 13:21:17 +02:00
Fabien Potencier
192e821211 minor #18451 [Security] remove unused variable (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Security] remove unused variable

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

Commits
-------

d5964ae remove unused variable
2016-04-06 09:46:14 +02:00
Sergey Fedotov
da8a19728b Remove unnecessary option assignment 2016-04-05 23:03:15 +03:00
Christian Flothmann
d5964aee96 remove unused variable 2016-04-05 20:29:19 +02:00
Christian Flothmann
4b78d03379 mock the proper method 2016-04-05 20:28:19 +02:00
Nicolas Grekas
2b30d486db [PropertyAccess] Fix regression 2016-04-05 18:42:48 +02:00
Fabien Potencier
034f47635c Merge branch '2.3' into 2.7
* 2.3:
  [HttpFoundation] Improve phpdoc
  [Logging] Add support for firefox in ChromePhpHandler
  [Security] Fixed SwitchUserListener when exiting an impersonication with AnonymousToken
  [Form] fix "prototype" not required when parent form is not required
2016-04-05 18:36:43 +02:00
Fabien Potencier
5b6da77a96 bug #18425 [Security] Fixed SwitchUserListener when exiting an impersonation with AnonymousToken (lyrixx)
This PR was merged into the 2.3 branch.

Discussion
----------

[Security] Fixed SwitchUserListener when exiting an impersonation with AnonymousToken

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

If you configure a firewall with switch user with `role: IS_AUTHENTICATED_ANONYMOUSLY` it's impossible to exit the
impersonation because the next line `$this->provider->refreshUser($original->getUser())` will fail. It fails because `RefreshUser`
expects an instance of `UserInterface` and here it's a string.

Therefore, it does not make sense to refresh an Anonymous Token, right ?

Commits
-------

59fea72 [Security] Fixed SwitchUserListener when exiting an impersonication with AnonymousToken
2016-04-05 18:29:34 +02:00
Fabien Potencier
134a7c9c72 bug #18317 [Form] fix "prototype" not required when parent form is not required (HeahDude)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] fix "prototype" not required when parent form is not required

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

Commits
-------

7df9ca2 [Form] fix "prototype" not required when parent form is not required
2016-04-05 18:24:57 +02:00
Nicolas Grekas
019e316aa0 minor #18442 [HttpFoundation] Improve phpdoc (mnapoli)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #18442).

Discussion
----------

[HttpFoundation] Improve phpdoc

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

Improve the phpdoc for the `$default` parameter of the `get()` method. It wasn't clear when the default value would be used (whether the key would not exist or the value was `null` or nullish).

The comment is now in sync with `Symfony\Component\HttpFoundation\ParameterBag::get()`.

Commits
-------

6bfbb2e [HttpFoundation] Improve phpdoc
2016-04-05 17:56:10 +02:00
Matthieu Napoli
6bfbb2e25f [HttpFoundation] Improve phpdoc
Improve the phpdoc for the `$default` parameter of the `get()` method. It wasn't clear when the default value would be used (whether the key would not exist or the value was `null` or nullish).

The comment is now in sync with `Symfony\Component\HttpFoundation\ParameterBag::get()`.
2016-04-05 17:56:01 +02:00
Nicolas Grekas
511e41a897 bug #18439 [Logging] Add support for Firefox (43+) in ChromePhpHandler (arjenm)
This PR was merged into the 2.3 branch.

Discussion
----------

[Logging] Add support for Firefox (43+) in ChromePhpHandler

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

Firefox added support for Chrome Logger a while back in [version 43](https://www.mozilla.org/en-US/firefox/43.0/releasenotes/).
Support for Firefox was added in the ChromePHPHandler of [Monolog 1.18.0](https://github.com/Seldaek/monolog/issues/721), although its not mentioned in the changelog.

This PR is basically just to replace the originally copied regular expression, [with this new one](fa96f6aa8f).

There should be no BC breakage, even though users may be using Monolog versions between 1.11 and 1.18. Monolog's ChromePHPHandler only got minor touch ups and its protocol (and thus output) remained the same.
This fix in fact also adds support for Firefox 43+ to older Monolog's when using the Symfony-version of that handler (which they should be using), since the Symfony-version of ChromePhpHandler completely overwrites the 'headersAccepted'-check of Monolog.

Commits
-------

c8efc4d [Logging] Add support for firefox in ChromePhpHandler
2016-04-05 16:28:06 +02:00
Arjen van der Meijden
c8efc4dfc2 [Logging] Add support for firefox in ChromePhpHandler 2016-04-04 20:48:53 +02:00
Michele Locati
5f5a71770b Windows 10 version check in just one line 2016-04-04 19:11:39 +02:00
Nicolas Grekas
01fb26b4d2 Merge branch '2.3' into 2.7
* 2.3:
  Detect CLI color support for Windows 10 build 10586
  [EventDispatcher] Try first if the event is Stopped
  [FrameworkBundle] fixes grammar in container:debug command manual.

Conflicts:
	src/Symfony/Component/EventDispatcher/EventDispatcher.php
	src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
2016-04-04 19:08:16 +02:00
Nicolas Grekas
5fbfcb05d5 bug #18385 Detect CLI color support for Windows 10 build 10586 (mlocati)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #18385).

Discussion
----------

Detect CLI color support for Windows 10 build 10586

Newer Windows 10 versions (builds starting from 10586) offer VT100 color support.
See http://www.nivot.org/blog/post/2016/02/04/Windows-10-TH2-(v1511)-Console-Host-Enhancements

| Q             | A
| ------------- | ---
| Branch?       | master - Maybe it could be backported to other branches too
| Bug fix?      | maybe 😉 - Do you you consider a bug not having colors on Windows?
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

472a7bf Detect CLI color support for Windows 10 build 10586
2016-04-04 19:01:24 +02:00
Michele Locati
472a7bffee Detect CLI color support for Windows 10 build 10586 2016-04-04 19:01:16 +02:00
Nicolas Grekas
18ddc88fb0 bug #18426 [EventDispatcher] Try first if the event is Stopped (lyrixx)
This PR was merged into the 2.3 branch.

Discussion
----------

[EventDispatcher] Try first if the event is Stopped

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

If you trigger 2 events with the same instance of Event and if a listener in the first dispatch stop the propagation, then the very first listener of the second dispatch is called. It should not IMHO.

Commits
-------

a30e166 [EventDispatcher] Try first if the event is Stopped
2016-04-04 18:56:17 +02:00
Grégoire Pineau
59fea72a43 [Security] Fixed SwitchUserListener when exiting an impersonication with AnonymousToken
If you configure a firewall with switch user with `role: IS_AUTHENTICATED_ANONYMOUSLY` it's impossible to exit the
impersonation because the next line `$this->provider->refreshUser($original->getUser())` will fail. It fails because `RefreshUser`
expects an instance of `UserInterface` and here it's a string.

Therefore, it does not make sense to refresh an Anonymous Token, right ?
2016-04-04 14:27:18 +02:00
Grégoire Pineau
a30e1662d8 [EventDispatcher] Try first if the event is Stopped 2016-04-04 11:22:54 +02:00
Nicolas Grekas
41fd14a564 minor #18430 [FrameworkBundle] fixes grammar in container:debug command manual. (hhamon)
This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] fixes grammar in container:debug command manual.

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

Commits
-------

c3c092d [FrameworkBundle] fixes grammar in container:debug command manual.
2016-04-04 11:11:32 +02:00
Hugo Hamon
c3c092de0f [FrameworkBundle] fixes grammar in container:debug command manual. 2016-04-04 10:38:46 +02:00
Nicolas Grekas
eb23f056f0 Merge branch '2.3' into 2.7
* 2.3:
  [travis] Disable hirak/prestissimo for deps=low/high tests
  [HttpFoundation] fix phpdoc of UploadedFile
  [ci] Skip dns-sensitive tests when DnsMock is not found
  Optimize ReplaceAliasByActualDefinitionPass
  [Process] use __METHOD__ where applicable

Conflicts:
	.travis.yml
	src/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php
	src/Symfony/Component/Process/Process.php
	src/Symfony/Component/Process/ProcessBuilder.php
2016-04-02 09:48:01 +02:00
Nicolas Grekas
131436525f minor #18404 [HttpFoundation] fix phpdoc of UploadedFile (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpFoundation] fix phpdoc of UploadedFile

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

Commits
-------

cbcac56 [HttpFoundation] fix phpdoc of UploadedFile
2016-04-02 09:17:49 +02:00
Nicolas Grekas
2ce5d54fbe minor #18410 [travis] Disable hirak/prestissimo for deps=low/high tests (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[travis] Disable hirak/prestissimo for deps=low/high tests

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

Concurrent composer updates + prestissimo for deps=low/high matrix lines make tests transient.
Lets test each component in its own `$HOME`.

Commits
-------

b8205a8 [travis] Disable hirak/prestissimo for deps=low/high tests
2016-04-02 09:17:12 +02:00
Nicolas Grekas
b8205a8330 [travis] Disable hirak/prestissimo for deps=low/high tests 2016-04-02 09:08:03 +02:00
Tobias Schultze
cbcac5632b [HttpFoundation] fix phpdoc of UploadedFile 2016-04-01 13:54:44 +02:00
Fabien Potencier
83bb723dbb minor #18400 Lower complexity of Form:isValid() (krzysiekpiasecki)
This PR was squashed before being merged into the 2.7 branch (closes #18400).

Discussion
----------

Lower complexity of Form:isValid()

| 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

Replace #18391
- use Yoda condition,
- merge into 2.7 branch

Why?

- lower LOC
- less return expressions
- lower complexity
- more readable comparison

Commits
-------

d583ec3 Lower complexity of Form:isValid()
2016-04-01 09:09:21 +02:00
Krzysztof Piasecki
d583ec3543 Lower complexity of Form:isValid() 2016-04-01 09:09:19 +02:00
Fabien Potencier
c5b792c65f minor #18389 Exclude Bridge\PhpUnit from composer.json by default (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

Exclude Bridge\PhpUnit from composer.json by default

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

Commits
-------

4f90495 Exclude Bridge\PhpUnit from composer.json by default
2016-04-01 08:35:52 +02:00
Fabien Potencier
b3580ce832 minor #18398 skipped dns-sensitive tests when DnsMock is not found (2.7) (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

skipped dns-sensitive tests when DnsMock is not found (2.7)

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

Commits
-------

efc1de7 skipped dns-sensitive tests when DnsMock is not found
2016-04-01 08:18:52 +02:00
Fabien Potencier
ffb4ff3fec bug #18394 [FrameworkBundle][2.7] Return the invokable service if its name is the class name (dunglas)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle][2.7] Return the invokable service if its name is the class name

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

Backport #18289 to 2.7 as this is a bug fix.

Commits
-------

5c87d76 [FrameworkBundle] Return the invokable service if its name is the class name
2016-04-01 08:15:08 +02:00
Fabien Potencier
efc1de7786 skipped dns-sensitive tests when DnsMock is not found 2016-04-01 08:10:39 +02:00
Fabien Potencier
9d45acc6a5 minor #18392 [ci] Skip dns-sensitive tests when DnsMock is not found (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[ci] Skip dns-sensitive tests when DnsMock is not found

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

Commits
-------

7e01187 [ci] Skip dns-sensitive tests when DnsMock is not found
2016-04-01 08:07:56 +02:00
Kévin Dunglas
5c87d766d5 [FrameworkBundle] Return the invokable service if its name is the class name 2016-03-31 22:45:44 +02:00
Nicolas Grekas
7e01187781 [ci] Skip dns-sensitive tests when DnsMock is not found 2016-03-31 22:06:39 +02:00
Nicolas Grekas
4f90495e59 Exclude Bridge\PhpUnit from composer.json by default 2016-03-31 20:43:11 +02:00