Commit Graph

44674 Commits

Author SHA1 Message Date
Nicolas Grekas
3b1655165e fix typo 2019-10-02 19:19:36 +02:00
Nicolas Grekas
e7f70415a5 bug #33814 [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array (mynameisbogdan)
This PR was submitted for the 4.3 branch but it was merged into the 3.4 branch instead (closes #33814).

Discussion
----------

[HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array

[HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #33769 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->

If `$_SESSION['_sf2_attributes']` is set to a string, `SessionBagProxy::initialize` will throw an error since it's argument is type-hinted as array. So this change is to check before if the data to be passed is truly an array.

Commits
-------

38782bceff [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array
2019-10-02 18:15:28 +02:00
bogdan
38782bceff [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array 2019-10-02 18:15:21 +02:00
Grégoire Pineau
c1917c2999 [DependencyInjection] added Ability to define a priority method for tagged service 2019-10-02 17:30:24 +02:00
Nicolas Grekas
d7e5dd120b Merge branch '4.3' into 4.4
* 4.3:
  fix merge
2019-10-02 17:04:54 +02:00
Nicolas Grekas
766162c4c7 fix merge 2019-10-02 17:03:35 +02:00
Nicolas Grekas
c2111be180 feature #33775 [Console] Add deprecation message for non-int statusCode (jschaedl)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Add deprecation message for non-int statusCode

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #33747 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | -

### What was done:

- [x] added deprecation message for non-int return value in Command::execute()
- [x] fixed all core commands to return proper int values
- [x] added proper return type-hint to Command::execute() method in all core Commands

Commits
-------

98c4f6a06c [Console] Command::execute() should always return int - deprecate returning null
2019-10-02 16:45:52 +02:00
Jan Schädlich
98c4f6a06c [Console] Command::execute() should always return int - deprecate returning null
- added deprecation message for non-int return value in Command::execute()
- fixed all core commands to return proper int values
- added proper return type-hint to Command::execute() method in all core Commands
2019-10-02 16:44:58 +02:00
Nicolas Grekas
3354bacc02 Merge branch '4.3' into 4.4
* 4.3:
  [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand
  [AnnotationCacheWarmer] add RedirectController to annotation cache
  [DI] add tests loading calls with returns-clone
  [EventDispatcher] Added tests for aliased events.
  [DI] Add CSV env var processor tests
2019-10-02 16:41:32 +02:00
Nicolas Grekas
bf62544a0c Merge branch '3.4' into 4.3
* 3.4:
  [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand
  [AnnotationCacheWarmer] add RedirectController to annotation cache
2019-10-02 16:38:26 +02:00
Justin Reherman
64aecab0a7
Don't let falsey usernames slip through 2019-10-02 10:20:10 -04:00
Nicolas Grekas
1fea53330d bug #33744 [DI] Add CSV env var processor tests / support PHP 7.4 (ro0NL)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] Add CSV env var processor tests / support PHP 7.4

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Similar as #32051

Commits
-------

82f341864c [DI] Add CSV env var processor tests
2019-10-02 14:58:58 +02:00
Nicolas Grekas
69928be76e minor #33795 [EventDispatcher] Added tests for aliased events (derrabus)
This PR was merged into the 4.3 branch.

Discussion
----------

[EventDispatcher] Added tests for aliased events

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

While working on #33793 I discovered that I could remove the event alias feature of `RegisterListenersPass` without breaking the component's tests. This PR adds the missing tests.

Commits
-------

8e8a6ed99b [EventDispatcher] Added tests for aliased events.
2019-10-02 14:57:27 +02:00
Nicolas Grekas
badb656f62 minor #33801 [DI] add tests loading calls with returns-clone (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] add tests loading calls with returns-clone

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

9a48def0c0 [DI] add tests loading calls with returns-clone
2019-10-02 14:55:34 +02:00
Nicolas Grekas
4d6fe5ce5d feature #33783 [WebProfilerBundle] Try to display the most useful panel by default (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebProfilerBundle] Try to display the most useful panel by default

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | -
| License       | MIT
| Doc PR        | -

Alternative to https://github.com/symfony/symfony/pull/32491, the goal stays the same.

I think reserving a data collector name is fine, isn'it ? It's not likely that end users use this name (that's why I added an underscore) + shouldn't be hard for them to just rename it.

I don't think adding a configuration option to toggle the "_best" behavior is useful, should be by default for DX IMHO.

Not adding an extension point for now (for end users to set their panel as the "best"), maybe later if someone request it?

Commits
-------

a45dd98b73 [WebProfilerBundle] Try to display the most useful panel by default
2019-10-02 14:22:29 +02:00
Christian Flothmann
fb5f8fb96a bug #33805 [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand (jschaedl)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #33747<!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | -

This is a follow-up PR caused by https://github.com/symfony/symfony/pull/33775#discussion_r330463216

Commits
-------

9b5ced20bb [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand
2019-10-02 14:13:41 +02:00
Jan Schädlich
9b5ced20bb [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand 2019-10-02 12:47:49 +02:00
Nicolas Grekas
db9ef8ae17 bug #33781 [AnnotationCacheWarmer] add RedirectController to annotation cache (jenschude)
This PR was submitted for the 4.3 branch but it was merged into the 3.4 branch instead (closes #33781).

Discussion
----------

[AnnotationCacheWarmer] add RedirectController to annotation cache

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #29357
| License       | MIT

This prevents to exclude the RedirectController from the warmed annotation cache which would lead to warnings when trying to use the warmed cache on read only file systems

Commits
-------

6b6c246c72 [AnnotationCacheWarmer] add RedirectController to annotation cache
2019-10-02 11:29:22 +02:00
Jens Schulze
6b6c246c72 [AnnotationCacheWarmer] add RedirectController to annotation cache
This prevents to exclude the RedirectController from the warmed annotation cache which would lead to warnings when trying to use the warmed cache on read only file systems

See #29357
2019-10-02 11:29:04 +02:00
Nicolas Grekas
e3aed1055d minor #33782 [DI] dont mandate a class on inline services with a factory (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] dont mandate a class on inline services with a factory

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This check is too strict, useless and boring for inline services :)

Commits
-------

a2665d17cd [DI] dont mandate a class on inline services with a factory
2019-10-02 11:23:07 +02:00
Nicolas Grekas
e04cf9155e minor #33803 [Serializer] Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in upgrade (pierredup)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in upgrade

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | N/A
| New feature?  | N/A
| Deprecations? | N/A
| Tickets       | https://github.com/symfony/symfony/pull/33789#issuecomment-537392407
| License       | MIT
| Doc PR        | N/A

Commits
-------

b4de582c18 Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in the upgrade guide
2019-10-02 11:19:55 +02:00
Thomas Calvet
a45dd98b73 [WebProfilerBundle] Try to display the most useful panel by default 2019-10-02 11:17:11 +02:00
Nicolas Grekas
41e452a906 Merge branch '4.3' into 4.4
* 4.3:
  fix merge
2019-10-02 11:13:07 +02:00
Pierre du Plessis
b4de582c18
Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in the upgrade guide 2019-10-02 11:08:22 +02:00
Nicolas Grekas
e490db8834 fix merge 2019-10-02 11:05:24 +02:00
Nicolas Grekas
d4f3b685df Merge branch '4.3' into 4.4
* 4.3:
  Sync Twig templateExists behaviors
  Fix the :only-of-type pseudo class selector
  [Serializer] Add CsvEncoder tests for PHP 7.4
  Copy phpunit.xsd to a predictable path
  [Security/Http] fix parsing X509 emailAddress
  [Serializer] fix denormalization of string-arrays with only one element #33731
  [Cache] fix known tag versions ttl check
2019-10-02 10:48:21 +02:00
Nicolas Grekas
b628210df7 Merge branch '3.4' into 4.3
* 3.4:
  Sync Twig templateExists behaviors
  Fix the :only-of-type pseudo class selector
  [Serializer] Add CsvEncoder tests for PHP 7.4
  Copy phpunit.xsd to a predictable path
  [Security/Http] fix parsing X509 emailAddress
  [Serializer] fix denormalization of string-arrays with only one element #33731
  [Cache] fix known tag versions ttl check
2019-10-02 10:36:26 +02:00
Nicolas Grekas
ff194d9844 minor #33792 Sync Twig templateExists behaviors (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

Sync Twig templateExists behaviors

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

There are 5 places in the code that does the same check, but they are not consistent. The difficulty here is to support Twig 1, 2 & 3. I think relying on `Environment::MAJOR_VERSION` is OK. `method_exists` are useless IMO. The proof is that they are currenty missing in some of them.

Basically if Twig >= 2 -> the method `exists` exists on the loader so just call it.

For Twig 1, check `ExistsLoaderInterface`, then check for `SourceContextLoaderInterface`, then call `getSource()`.

Commits
-------

d7682fee6c Sync Twig templateExists behaviors
2019-10-02 10:32:14 +02:00
Fabien Potencier
7020f2602b bug #33797 [Cache] Fixed Redis Sentinel usage when only one Sentinel specified (Rohaq)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] Fixed Redis Sentinel usage when only one Sentinel specified

Added check for $params['redis_sentinel'] to line 274, as by converting the array of hosts to a single host configuration (as you might in a test environment), this causes the class to initialise incorrectly.

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33796
| License       | MIT
| Doc PR        |

As from Issue #33796
In a Redis Sentinel setup, if only a single Redis Sentinel, or multiple Sentinels with the same host/port are specified (as we're currently doing in a test environment), then the call to `setSentinelTimeout` in `RedisTrait.php` throws an exception, as the wrong interface appears to be initialised as a result.

Adding a check for the `redis_sentinel` parameter, as was done with a check for the `redis_cluster` parameter, avoids this, and the Redis Client is initialised correctly.

Commits
-------

13233fcd8e Fixed Redis Sentinel usage when only one Sentinel specified
2019-10-02 10:31:34 +02:00
Fabien Potencier
526fd9fc44 feature #33701 [HttpKernel] wrap compilation of the container in an opportunistic lock (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] wrap compilation of the container in an opportunistic lock

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

https://github.com/symfony/symfony/pull/32764#issuecomment-516924305

This PR adds a lock around the compilation of the container. When two or more concurrent requests want to compile the container, the first one runs the computation and the others wait for its completion. If for any reasons the lock doesn't work, compilation happens as usual.

The effect is visible when developing locally:

Here is what all concurrent requests consume now:
![image](https://user-images.githubusercontent.com/243674/65603626-4e231d00-dfa6-11e9-8b6c-62dbd5eb30fe.png)

And here is what they will consume with this PR (they wait but reuse the just compiled container):
![image](https://user-images.githubusercontent.com/243674/65603733-7f9be880-dfa6-11e9-930b-ce793c3e280c.png)

Commits
-------

0b5b3ed7f9 [HttpKernel] wrap compilation of the container in an opportunistic lock
2019-10-02 10:09:14 +02:00
Nicolas Grekas
9a48def0c0 [DI] add tests loading calls with returns-clone 2019-10-02 10:03:02 +02:00
Nicolas Grekas
a2665d17cd [DI] dont mandate a class on inline services with a factory 2019-10-02 09:19:13 +02:00
Richard Hodgson
13233fcd8e
Fixed Redis Sentinel usage when only one Sentinel specified
Added check for $params['redis_sentinel'] to line 274, as by converting the array of hosts to a single host configuration (as you might in a test environment), this causes the class to initialise incorrectly.
2019-10-01 18:57:36 +01:00
Alexander M. Turek
8e8a6ed99b [EventDispatcher] Added tests for aliased events. 2019-10-01 18:40:32 +02:00
Fabien Potencier
5b7848c8ff feature #33789 [Serializer] Deprecate the XmlEncoder::TYPE_CASE_ATTRIBUTES constant (pierredup)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] Deprecate the XmlEncoder::TYPE_CASE_ATTRIBUTES constant

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | yes
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A
| Related       | #33788

Deprecate the `XmlEncoder::TYPE_CASE_ATTRIBUTES` constant in favour of `XmlEncoder::TYPE_CAST_ATTRIBUTES`

Commits
-------

9f51cf4a77 Deprecate the XmlEncoder::TYPE_CASE_ATTRIBUTES constant
2019-10-01 18:26:56 +02:00
Thomas Calvet
d7682fee6c Sync Twig templateExists behaviors 2019-10-01 17:13:36 +02:00
Fabien Potencier
d2b66ff592 bug #33777 Fix the :only-of-type pseudo class selector (jakzal)
This PR was squashed before being merged into the 3.4 branch (closes #33777).

Discussion
----------

Fix the :only-of-type pseudo class selector

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33773
| License       | MIT
| Doc PR        | -

Commits
-------

c2a9bf08f1 Fix the :only-of-type pseudo class selector
2019-10-01 13:57:42 +02:00
Jakub Zalas
c2a9bf08f1 Fix the :only-of-type pseudo class selector 2019-10-01 13:57:37 +02:00
Fabien Potencier
11da6f6eea minor #33787 [Mailer] Tweak some code (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Tweak some code

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Tweaks from the Notifier PR.

Commits
-------

ab094c02eb [Mailer] Tweak some code
2019-10-01 13:38:59 +02:00
Pierre du Plessis
9f51cf4a77
Deprecate the XmlEncoder::TYPE_CASE_ATTRIBUTES constant 2019-10-01 12:51:09 +02:00
Fabien Potencier
ab094c02eb [Mailer] Tweak some code 2019-10-01 12:10:05 +02:00
Fabien Potencier
3a1d36102f bug #33772 [WebserverBundle] Remove duplicated deprecation message (jschaedl)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebserverBundle] Remove duplicated deprecation message

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | -
| Tickets       | Fix #33765
| License       | MIT
| Doc PR        | -

Commits
-------

77534aa45d [WebserverBundle] Remove duplicated deprecation message
2019-10-01 01:14:25 +02:00
Fabien Potencier
871e8e9158 bug #32051 [Serializer] Add CsvEncoder tests for PHP 7.4 (ro0NL)
This PR was squashed before being merged into the 3.4 branch (closes #32051).

Discussion
----------

[Serializer] Add CsvEncoder tests for PHP 7.4

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? |no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Some CSV encoder tests to show the broken behavior of a trailing slash. Spotted in #31867, not sure what to do with it :)

Commits
-------

760354d533 [Serializer] Add CsvEncoder tests for PHP 7.4
2019-10-01 01:11:46 +02:00
Roland Franssen
760354d533 [Serializer] Add CsvEncoder tests for PHP 7.4 2019-10-01 01:11:32 +02:00
Fabien Potencier
befa5c69c2 feature #33776 Copy phpunit.xsd to a predictable path (julienfalque)
This PR was merged into the 3.4 branch.

Discussion
----------

Copy phpunit.xsd to a predictable path

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes-ish
| Deprecations? | no
| Tickets       | https://github.com/symfony/recipes/pull/652#discussion_r329446277
| License       | MIT
| Doc PR        | -

In symfony/recipes#652 I would like to make Flex create the `phpunit.xml.dist` file with a local URI for the `phpunit.xsd`. This is doable when using `phpunit/phpunit` standalone because the path to the XSD file is known. This PR aims to allow doing this when using the PHPUnit Bridge, which installs PHPUnit in a path that might change.

Is is simple `@copy()` call ok? Should I add some error handling?

Commits
-------

233dcb4b75 Copy phpunit.xsd to a predictable path
2019-10-01 01:07:55 +02:00
Fabien Potencier
f4af6d2273 minor #33762 [Console] remove duplicated test (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] remove duplicated test

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

4c1b66c6de remove duplicated test
2019-10-01 01:04:49 +02:00
Fabien Potencier
a824e08314 bug #33759 [Security/Http] fix parsing X509 emailAddress (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security/Http] fix parsing X509 emailAddress

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33636
| License       | MIT
| Doc PR        | -

Commits
-------

fceb86bde6 [Security/Http] fix parsing X509 emailAddress
2019-10-01 01:01:20 +02:00
Julien Falque
233dcb4b75
Copy phpunit.xsd to a predictable path 2019-09-30 22:33:19 +02:00
Jan Schädlich
77534aa45d [WebserverBundle] Remove duplicated deprecation message 2019-09-30 20:56:12 +02:00
Nicolas Grekas
a2cd56c12f bug #33733 [Serializer] fix denormalization of string-arrays with only one element (mkrauser)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] fix denormalization of string-arrays with only one element

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  |no
| Deprecations? |no
| Tickets       | Fix #33731
| License       | MIT
| Doc PR        |

This PR does almost the same as ac70edf8cd, just not only for arrays of objects.

Commits
-------

8814751b96 [Serializer] fix denormalization of string-arrays with only one element #33731
2019-09-30 16:55:04 +02:00