Commit Graph

25868 Commits

Author SHA1 Message Date
Fabien Potencier
eb40f161d7 feature #18440 Add the kernel.controller_arguments event (stof)
This PR was merged into the 3.1-dev branch.

Discussion
----------

Add the kernel.controller_arguments event

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

I'm not sure this can be integrated in 3.1 due to the feature freeze, but it would be great if it is, as it is a must-have to be able to make the ``@Security`` annotation compatible with the new argument resolver system (as we need to be able to run the security assertion after the resolving).

I made the arguments mutable here for consistency with ``kernel.controller`` (and @fabpot replied LGTM in the RFC when I suggested it).

Commits
-------

af02e2a Add the kernel.controller_arguments event
2016-04-07 17:31:25 +02:00
Fabien Potencier
cd8679754d bug #18360 [PropertyInfo] Extract nullable and collection key type for Doctrine associations (teohhanhui)
This PR was merged into the 2.8 branch.

Discussion
----------

[PropertyInfo] Extract nullable and collection key type for Doctrine associations

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

Commits
-------

3008228 [PropertyInfo] Extract nullable and collection key type for Doctrine associations
2016-04-07 17:25:20 +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
1db0925e2d bug #18457 [WebProfilerBundle] Fixed error from unset twig variable (simonsargeant)
This PR was squashed before being merged into the 2.8 branch (closes #18457).

Discussion
----------

[WebProfilerBundle] Fixed error from unset twig variable

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

Minor bug, fixes error from twig variable which was removed in 2.8
Here was where it was originally set https://github.com/symfony/symfony/blob/2.7/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig#L69

Replaced with expected class name

Commits
-------

3e2c4c9 [WebProfilerBundle] Fixed error from unset twig variable
2016-04-07 17:07:59 +02:00
Simon Sargeant
3e2c4c9df7 [WebProfilerBundle] Fixed error from unset twig variable 2016-04-07 17:07:50 +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
Fabien Potencier
0d4a533183 minor #18412 changelogs missing features after #17589 (HeahDude)
This PR was merged into the 3.1-dev branch.

Discussion
----------

changelogs missing features after #17589

| Q             | A
| ------------- | ---
| Branch?       | master
| License       | MIT

Commits
-------

724fd3b updated changelogs after #17589
2016-04-07 17:01:28 +02:00
Christophe Coevoet
af02e2abe1 Add the kernel.controller_arguments event 2016-04-07 16:51:22 +02:00
Christophe Coevoet
71c5444c2a bug #18469 Force profiler toolbar svg display (pyrech)
This PR was merged into the 2.8 branch.

Discussion
----------

Force profiler toolbar svg display

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

When applying `display: block` on all svg of our website, we found that toolbar's svg were also impacted:

![capture du 2016-04-07 10-57-05](https://cloud.githubusercontent.com/assets/2021641/14345830/7d531388-fcaf-11e5-88ad-92f5522b4e98.png)

Just apply a default display on toolbar's svg fixes the issue.

Commits
-------

467d8c7 Force profiler toolbar svg display
2016-04-07 14:59:12 +02:00
Nicolas Grekas
41526342ea [FrameworkBundle] Add default pool & system adapter 2016-04-07 14:29:40 +02:00
Loïck Piera
467d8c722d Force profiler toolbar svg display 2016-04-07 11:11:53 +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
Fabien Potencier
ccac12e6a9 minor #18453 [Form] fix tests (use non-deprecated options) (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[Form] fix tests (use non-deprecated options)

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

* reference form type by its FQCN instead of its string name
* use the `entry_type` and `entry_options` options instead of the
  deprecated `type` and `options` options

Commits
-------

f82a25f fix tests (use non-deprecated options)
2016-04-07 09:57:56 +02:00
Jules Pietri
724fd3b477 updated changelogs after #17589 2016-04-06 20:10:02 +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
f82a25f288 fix tests (use non-deprecated options)
* reference form type by its FQCN instead of its string name
* use the `entry_type` and `entry_options` options instead of the
  deprecated `type` and `options` options
2016-04-05 20:37:30 +02: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
16ac46be44 Merge branch '2.7' into 2.8
* 2.7:
  [HttpFoundation] Improve phpdoc
  [Logging] Add support for firefox in ChromePhpHandler
  Windows 10 version check in just one line
  Detect CLI color support for Windows 10 build 10586
  [Security] Fixed SwitchUserListener when exiting an impersonication with AnonymousToken
  [EventDispatcher] Try first if the event is Stopped
  [FrameworkBundle] fixes grammar in container:debug command manual.
  [Form] fix "prototype" not required when parent form is not required
2016-04-05 18:36:54 +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
Fabien Potencier
45b557a5a7 minor #18373 [FrameworkBundle] Upgrade notice for the Controller::json() method (derrabus)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[FrameworkBundle] Upgrade notice for the Controller::json() method

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

PR #17642 added a `json()` method to the `Controller` class. This might break existing code extending the class. This PR adds a note about this to the UPGRADE-3.1 document.

Commits
-------

ca6694a Upgrade notice for the Controller::json() method.
2016-04-05 18:21: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
714b916d5d [FrameworkBundle] Add & use Psr6CacheClearer 2016-04-05 16:36:41 +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
Alexander M. Turek
ca6694ab19 Upgrade notice for the Controller::json() method. 2016-04-05 15:02:01 +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
Nicolas Grekas
6dbda505bf minor #18419 [Process] Fixes & testNonBlockingNorClearingIteratorOutput (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Process] Fixes & testNonBlockingNorClearingIteratorOutput

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

hasCallback (added on master in #17427) always returns true currently.

Commits
-------

3a109a2 [Process] Fixes & testNonBlockingNorClearingIteratorOutput
2016-04-04 17:07:09 +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
Nicolas Grekas
3a109a296c [Process] Fixes & testNonBlockingNorClearingIteratorOutput 2016-04-04 12:18:36 +02:00
Nicolas Grekas
4740c5ccfb [FrameworkBundle] use abstract cache.pool decoration and aliases 2016-04-04 11:49:17 +02:00
Christian Flothmann
92b1a20613 [FrameworkBundle] Fix and add tests for cache pool wiring 2016-04-04 11:41:15 +02:00
Nicolas Grekas
e44bfdcde9 [FrameworkBundle] Add cache-pool tag and wiring 2016-04-04 11:41:14 +02:00
Christian Flothmann
281eafa5cb [FrameworkBundle] Integrate the Cache component 2016-04-04 11:41:14 +02:00
Nicolas Grekas
bc51fdeec3 [Cache] Normalize constructor arguments order 2016-04-04 11:41:14 +02:00