Commit Graph

32329 Commits

Author SHA1 Message Date
Roland Franssen
1c85707946 [Form] SA fix 2019-01-14 10:45:52 +01:00
Christian Flothmann
189da22528 fix compatibility with PHPUnit 4.8 2019-01-14 10:12:36 +01:00
Christian Flothmann
1f31471ffe remove return type hint for PHP 5 compatibility 2019-01-14 09:43:48 +01:00
Fabien Potencier
1874369577 minor #29745 SCA: minor code tweaks (kalessil)
This PR was squashed before being merged into the 4.1 branch (closes #29745).

Discussion
----------

SCA: minor code tweaks

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

Eliminated a few excessive calls, tweaked query parameters sorting

Commits
-------

8887f76b64 SCA: minor code tweaks
2019-01-13 17:56:47 +01:00
Vladimir Reznichenko
8887f76b64 SCA: minor code tweaks 2019-01-13 17:56:40 +01:00
Fabien Potencier
3ea4901516 bug #29837 Fix SwiftMailerHandler to support Monolog's latest reset functionality (Seldaek)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix SwiftMailerHandler to support Monolog's latest reset functionality

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Monolog 1.24 added the ResettableInterface which is meant to support resetting handlers. Reset should also flush as if the request was ending, and it can be used for long running workers for example in between each job that is processed. Due to SwiftMailer's spool however the emails in case of errors are right now only sent at the very end of the worker's lifetime.

For older Monolog versions, this will be ignored, and is thus harmless.

Commits
-------

ada2d83b67 Fix SwiftMailerHandler to support Monolog's latest reset functionality
2019-01-13 17:54:10 +01:00
Fabien Potencier
f95036440a minor #29797 [Dotenv] improved code coverage and removed unreachable code (Stas-Soroka)
This PR was squashed before being merged into the 4.3-dev branch (closes #29797).

Discussion
----------

[Dotenv] improved code coverage and removed unreachable code

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

Commits
-------

34dac7c8fd [Dotenv] improved code coverage and removed unreachable code
2019-01-13 17:52:51 +01:00
Stas Soroka
34dac7c8fd [Dotenv] improved code coverage and removed unreachable code 2019-01-13 17:52:45 +01:00
Gordienko Vladislav
c7410bef29 Component CssSelector tests 2019-01-13 17:50:36 +01:00
Fabien Potencier
9e9506ebef feature #29148 Load original file metadata when loading Xliff 1.2 files (eternoendless)
This PR was squashed before being merged into the 4.3-dev branch (closes #29148).

Discussion
----------

Load original file metadata when loading Xliff 1.2 files

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

At PrestaShop, we maintain our translations catalog automatically using an internal tool based on our [TranslationToolsBundle](https://github.com/PrestaShop/TranslationToolsBundle), which is capable of reverse building a MessageCatalogue by parsing the source code, and then saving it to Xliff files.

Currently, this tool is only capable of building catalogs from scratch. We are currently moving to an incremental catalog where we only add new wordings, and keep old ones even if they are no longer present in the code (because of B/C). To do that, instead of starting from a clean MessageCatalogue, we load our current catalog using XliffLoader, and use that MessageCatalogue as a base. Easy peasy. But then we found a problem...

The Xliff 1.2 standard defines a list of `<trans-unit>` elements within a collection of `<file>` elements. The `<file>` element has a required attribute named `original`, which is supposed to contain the name of the file where the wordings are used in (at least in our case it does). **This attribute is currently ignored by XliffFileLoader**.

This means that it's currently impossible to read a Xliff 1.2 file using XliffFileloader, and save it back to Xliff without losing data.

This Pull Request adds a new `file` element to the messages' metadata (alongside `notes`, `target-attributes` and `id`). Right now, it only contains `original`, but it could be extended to contain all the other attributes from the `<file>` element if needed.

This required a small change in the loader where we loop through `<file>` elements before fetching their `<trans-unit>` children, instead of fetching all `<trans-unit>` elements at once.

Commits
-------

4073319d0f Load original file metadata when loading Xliff 1.2 files
2019-01-13 17:47:52 +01:00
Pablo Borowicz
4073319d0f Load original file metadata when loading Xliff 1.2 files 2019-01-13 17:47:46 +01:00
Fabien Potencier
ea68e28cf0 bug #29853 Revert "bug #29597 [DI] fix reporting bindings on overriden services as unused" (mmarynich)
This PR was merged into the 3.4 branch.

Discussion
----------

Revert "bug #29597 [DI] fix reporting bindings on overriden services as unused"

This reverts commit 44e9a91f30, reversing
changes made to 91b28ff081.

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

4.2.2 release changed the way tagged service are injected

As asked by @nicolas-grekas https://github.com/symfony/symfony/issues/29836#issuecomment-453464500

Commits
-------

b3e17d2101 Revert "bug #29597 [DI] fix reporting bindings on overriden services as unused (nicolas-grekas)"
2019-01-13 17:45:27 +01:00
Fabien Potencier
34365ec2fe feature #29840 [FrameworkBundle] pass project dir into the assets install command (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[FrameworkBundle] pass project dir into the assets install command

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

Commits
-------

b373d4206b pass project dir into the assets install command
2019-01-13 17:43:24 +01:00
Fabien Potencier
6573cd35b4 minor #29849 [Validator] Fixed exception wording (vudaltsov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Fixed exception wording

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

Commits
-------

8266262c9c Fixed exception wording
2019-01-13 17:39:55 +01:00
Thomas Calvet
4f690a31c6 [DebugClassLoader] Readd findFile() method 2019-01-13 17:36:47 +01:00
Robin Chalas
4db43f3e76 [Console] Fix composer.json suggest/provide 2019-01-12 12:06:42 +01:00
Mikhail Marynich
b3e17d2101 Revert "bug #29597 [DI] fix reporting bindings on overriden services as unused (nicolas-grekas)"
This reverts commit 44e9a91f30, reversing
changes made to 91b28ff081.
2019-01-11 16:53:30 +01:00
Christian Flothmann
4d21ab4e7b Merge branch '4.2'
* 4.2:
  account for the short array syntax in Twig
2019-01-11 15:23:08 +01:00
Christian Flothmann
2dddea4d0d Merge branch '4.1' into 4.2
* 4.1:
  account for the short array syntax in Twig
2019-01-11 15:22:29 +01:00
Christian Flothmann
c325155e10 Merge branch '3.4' into 4.1
* 3.4:
  account for the short array syntax in Twig
2019-01-11 15:09:01 +01:00
Valentin
8266262c9c Fixed exception wording 2019-01-11 17:00:45 +03:00
Christian Flothmann
b373d4206b pass project dir into the assets install command 2019-01-11 12:41:57 +01:00
Jordi Boggiano
ada2d83b67
Fix SwiftMailerHandler to support Monolog's latest reset functionality 2019-01-10 16:10:12 +01:00
Christian Flothmann
59a4dc609d account for the short array syntax in Twig 2019-01-10 09:15:17 +01:00
Christian Flothmann
4ba6397c5b Merge branch '4.2'
* 4.2:
  Fix docs
  enabled short array notation in CS
  [fabbot] enable short arrays
  bumped Symfony version to 4.2.3
  updated VERSION for 4.2.2
  updated CHANGELOG for 4.2.2
  bumped Symfony version to 4.1.11
  updated VERSION for 4.1.10
  updated CHANGELOG for 4.1.10
  bumped Symfony version to 3.4.22
  updated VERSION for 3.4.21
  update CONTRIBUTORS for 3.4.21
  updated CHANGELOG for 3.4.21
2019-01-10 08:43:17 +01:00
Christian Flothmann
2c9a3717a7 Merge branch '4.1' into 4.2
* 4.1:
  Fix docs
  enabled short array notation in CS
  [fabbot] enable short arrays
  bumped Symfony version to 4.1.11
  updated VERSION for 4.1.10
  updated CHANGELOG for 4.1.10
  bumped Symfony version to 3.4.22
  updated VERSION for 3.4.21
  update CONTRIBUTORS for 3.4.21
  updated CHANGELOG for 3.4.21
2019-01-10 08:34:23 +01:00
Christian Flothmann
7efc487333 Merge branch '3.4' into 4.1
* 3.4:
  Fix docs
  enabled short array notation in CS
  [fabbot] enable short arrays
  bumped Symfony version to 3.4.22
  updated VERSION for 3.4.21
  update CONTRIBUTORS for 3.4.21
  updated CHANGELOG for 3.4.21
2019-01-10 08:32:51 +01:00
Tom Van Looy
64a65e9cd1 Fix docs
symfony documentation tells people to pass null, and it is the default, but the method docs don't allow it so static analyzers complain about it (spotted by phan)
2019-01-09 19:02:24 +01:00
Nicolas Grekas
5e88dc63e2 [VarDumper] add caster for OpenSSL X.509 resources 2019-01-08 17:42:08 +01:00
Fabien Potencier
006dacd18d minor #29762 Improved performance of LoggerDataCollector (javiereguiluz)
This PR was squashed before being merged into the 4.3-dev branch (closes #29762).

Discussion
----------

Improved performance of LoggerDataCollector

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | -   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | -

My feeling is that Symfony's "dev" environment is more and more slow lately. After profiling the Symfony Demo app with Blackfire, I found that `getContainerCompilerLogs()` is one of the slowest methods.

Given that you rarely need or look at these "compiler logs", in this PR I propose to get them only when/if you really need them.

[The before/after profile comparison](https://blackfire.io/profiles/compare/4959d918-8e00-4cd7-9b0b-41919e73ae62/graph) confirms a nice performance improvement and thousands of functions no longer called.

Commits
-------

3b8d6d19ec Improved performance of LoggerDataCollector
2019-01-06 17:31:10 +01:00
Javier Eguiluz
3b8d6d19ec Improved performance of LoggerDataCollector 2019-01-06 17:31:01 +01:00
Fabien Potencier
0083ba1d88 feature #29781 [DI] Add trim env processor (ogizanagi)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[DI] Add trim env processor

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #26708  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | Todo

Which is especially useful in combination with the `file` env processor.

Commits
-------

e226492db7 [DI] Add trim env processor
2019-01-06 17:27:17 +01:00
Fabien Potencier
40a53d555a bumped Symfony version to 4.2.3 2019-01-06 17:25:15 +01:00
Fabien Potencier
c78e7482d5 updated VERSION for 4.2.2 2019-01-06 17:19:23 +01:00
Fabien Potencier
4ef814a19d bumped Symfony version to 4.1.11 2019-01-06 17:18:42 +01:00
Fabien Potencier
379d486959 updated VERSION for 4.1.10 2019-01-06 17:16:13 +01:00
Fabien Potencier
7f04e55856 bumped Symfony version to 3.4.22 2019-01-06 17:15:41 +01:00
Fabien Potencier
32863ef27b updated VERSION for 3.4.21 2019-01-06 16:53:59 +01:00
Fabien Potencier
fdb7a8f10c Merge branch '4.2'
* 4.2:
  Add Japanese translation for #28479
2019-01-06 15:14:12 +01:00
Fabien Potencier
9fe204ee92 Merge branch '4.1' into 4.2
* 4.1:
  Add Japanese translation for #28479
2019-01-06 15:13:54 +01:00
Fabien Potencier
64999e62d4 Merge branch '3.4' into 4.1
* 3.4:
  Add Japanese translation for #28479
2019-01-06 15:13:40 +01:00
Issei.M
7a0bddedea Add Japanese translation for #28479 2019-01-06 15:07:11 +01:00
Robin Chalas
af9920cf10 Merge branch '4.2'
* 4.2:
  properly fix tests on PHP 5
  fix tests on PHP 5
  remove doubled dot from exception message
  bug #29697 [DI] Fixed wrong factory method in exception (Wojciech Gorczyca)
  [Intl] make type-hinted arguments nullable
  [DI] Fixed wrong factory method in exception
  Changed gender choice types to color
  Fix unnecessary use
  remove no longer needed PHP version checks
  remove no longer needed PHP version checks
  Fixed groupBy argument value in DefaultChoiceListFactoryTest
  [HttpKernel] Correctly Render Signed URIs Containing Fragments
  [HttpFoundation] Fix request uri when it starts with double slashes
2019-01-05 17:38:08 +01:00
Robin Chalas
f27269330b Merge branch '4.1' into 4.2
* 4.1:
  properly fix tests on PHP 5
  fix tests on PHP 5
  remove doubled dot from exception message
  bug #29697 [DI] Fixed wrong factory method in exception (Wojciech Gorczyca)
  [Intl] make type-hinted arguments nullable
  [DI] Fixed wrong factory method in exception
  Changed gender choice types to color
  remove no longer needed PHP version checks
  remove no longer needed PHP version checks
  Fixed groupBy argument value in DefaultChoiceListFactoryTest
  [HttpKernel] Correctly Render Signed URIs Containing Fragments
  [HttpFoundation] Fix request uri when it starts with double slashes
2019-01-05 17:37:49 +01:00
Robin Chalas
1fa24cb363 Merge branch '3.4' into 4.1
* 3.4:
  properly fix tests on PHP 5
  fix tests on PHP 5
  bug #29697 [DI] Fixed wrong factory method in exception (Wojciech Gorczyca)
  Changed gender choice types to color
  remove no longer needed PHP version checks
  Fixed groupBy argument value in DefaultChoiceListFactoryTest
  [HttpKernel] Correctly Render Signed URIs Containing Fragments
  [HttpFoundation] Fix request uri when it starts with double slashes
2019-01-05 17:36:16 +01:00
Christian Flothmann
c8ced3a9a2 properly fix tests on PHP 5 2019-01-05 13:26:58 +01:00
Christian Flothmann
6d84aeb131 fix tests on PHP 5 2019-01-05 13:04:54 +01:00
Fabien Potencier
96b962d8c4 minor #29791 [PropertyAccess] remove doubled dot from exception message (xabbuh)
This PR was merged into the 4.1 branch.

Discussion
----------

[PropertyAccess] remove doubled dot from exception message

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

Commits
-------

4c04328b59 remove doubled dot from exception message
2019-01-05 12:58:34 +01:00
Christian Flothmann
4c04328b59 remove doubled dot from exception message 2019-01-05 12:52:22 +01:00
Fabien Potencier
3299f272fc minor #29782 [Intl] make type-hinted arguments nullable (xabbuh)
This PR was merged into the 4.1 branch.

Discussion
----------

[Intl] make type-hinted arguments nullable

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

Commits
-------

16ebeb395f [Intl] make type-hinted arguments nullable
2019-01-05 12:46:06 +01:00
Maxime Steinhausser
e226492db7 [DI] Add trim env processor 2019-01-05 12:09:07 +01:00
Fabien Potencier
0a3d3d4dff bug #29697 [DI] Fixed wrong factory method in exception (Wojciech Gorczyca)
This PR was submitted for the 4.2 branch but it was merged into the 4.1 branch instead (closes #29697).

Discussion
----------

[DI] Fixed wrong factory method in exception

| Q             | A
| ------------- | ---
| Branch?       |  4.2 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #29678   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | n/a <!-- required for new features -->

When a service definition with a factory defines invalid arguments, the [resulting exception message ](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/Compiler/ResolveNamedArgumentsPass.php#L70)incorrectly specifies the factory constructor instead of the factory method as not having the specified named arguments.

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Commits
-------

922885c892 [DI] Fixed wrong factory method in exception
2019-01-05 10:39:43 +01:00
Christian Flothmann
16ebeb395f [Intl] make type-hinted arguments nullable 2019-01-05 09:55:10 +01:00
Fabien Potencier
5c2cee5c0f feature #28902 [Debug] Detect virtual methods using @method (ro0NL)
This PR was squashed before being merged into the 4.3-dev branch (closes #28902).

Discussion
----------

[Debug] Detect virtual methods using @method

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | https://github.com/symfony/symfony/pull/28897#issuecomment-430542792
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/issues/10504

My first Debug PR, so im still on it. But early feedback welcome.

In #28901 we'll introduce a new virtual interface method using `@method` annotation. IIUC the idea is to trigger whenever such a method is overridden.

Commits
-------

38877c32ac [Debug] Detect virtual methods using @method
2019-01-05 09:11:12 +01:00
Roland Franssen
38877c32ac [Debug] Detect virtual methods using @method 2019-01-05 09:11:02 +01:00
Fabien Potencier
e38b5d2990 bug #29494 [HttpFoundation] Fix request uri when it starts with double slashes (alquerci)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Fix request uri when it starts with double slashes

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

When the `REQUEST_URI` starts with a slash no need to `parse_url()`. However to keep the same behaviour regarding the fragment we need to add a logic to remove it. While `parse_url()` handle all cases itself.

Commits
-------

cf850c1a15 [HttpFoundation] Fix request uri when it starts with double slashes
2019-01-05 09:05:37 +01:00
Fabien Potencier
5053bfec14 minor #29509 [Validator] Add tests in regex validator for objects with __toString method (raulfraile)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Validator] Add tests in regex validator for objects with __toString method

This PR adds tests to cover objects implementing the `__toString` method for the `Regex` validator.

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (careful when merging)
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Commits
-------

11e0df4f55 [Validator] Add tests in regex validator for objects with __toString method
2019-01-05 08:52:57 +01:00
Wojciech Gorczyca
922885c892 [DI] Fixed wrong factory method in exception 2019-01-05 08:48:02 +01:00
Fabien Potencier
482f49afde bug #29679 [HttpKernel] Correctly Render Signed URIs Containing Fragments (zanbaldwin)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Correctly Render Signed URIs Containing Fragments

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

- Rebuild the URL with the computed hash instead of appending it onto the end of the fragment.
- Update unit tests, and add new unit test to cover URIs that include fragments.

Commits
-------

b9ece6bde7 [HttpKernel] Correctly Render Signed URIs Containing Fragments
2019-01-05 08:46:55 +01:00
Maxime Steinhausser
d80bfad54e [Profiler] Still show locale and fallback locale even if no trans used 2019-01-05 08:44:15 +01:00
Aaron Somi
fdf98af58b Changed gender choice types to color
Signed-off-by: Aaron Somi <aaronsomi@gmail.com>
2019-01-05 06:17:43 +00:00
Maxime Steinhausser
b3093440d8 Fix unnecessary use 2019-01-04 19:00:57 +01:00
Fabien Potencier
a1c8da08f6 minor #29769 [Form] Fix FormDefaultChoiceListFactory test (vudaltsov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Fix FormDefaultChoiceListFactory test

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/29731#pullrequestreview-189023682
| License       | MIT
| Doc PR        | n/a

`$groupBy` is either `null` or `callable`. Passing `array()` is wrong.

Commits
-------

b8f6390ef9 Fixed groupBy argument value in DefaultChoiceListFactoryTest
2019-01-04 16:47:57 +01:00
Fabien Potencier
3ee1adbd90 minor #29776 remove no longer needed PHP version checks (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

remove no longer needed PHP version checks

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

Commits
-------

99448c6e78 remove no longer needed PHP version checks
2019-01-04 16:46:05 +01:00
Fabien Potencier
34c8a8b7ae minor #29778 remove no longer needed PHP version checks (xabbuh)
This PR was merged into the 4.1 branch.

Discussion
----------

remove no longer needed PHP version checks

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

Commits
-------

7a132fe156 remove no longer needed PHP version checks
2019-01-04 16:44:56 +01:00
Robin Chalas
44aa362419 Merge branch '4.2'
* 4.2:
  Ensure final input of CommandTester works with default
  Do not risk waiting 100 seconds
  [Intl] handle null date and time types
  Revert "minor #28610 [Form] Check for Intl availibility (ro0NL)"
  Do not ignore the choice groups for caching
2019-01-04 16:14:53 +01:00
Robin Chalas
b594ad65e1 Merge branch '4.1' into 4.2
* 4.1:
  Ensure final input of CommandTester works with default
  [Intl] handle null date and time types
  Do not ignore the choice groups for caching
2019-01-04 16:13:53 +01:00
Robin Chalas
2d84041a66 Merge branch '3.4' into 4.1
* 3.4:
  Ensure final input of CommandTester works with default
  [Intl] handle null date and time types
  Do not ignore the choice groups for caching
2019-01-04 16:13:30 +01:00
Christian Flothmann
7a132fe156 remove no longer needed PHP version checks 2019-01-04 16:09:47 +01:00
Christian Flothmann
99448c6e78 remove no longer needed PHP version checks 2019-01-04 14:48:06 +01:00
Eric Stern
6b87b67cf0 Ensure final input of CommandTester works with default
If the final element of `CommandTester::setInputs()` is an empty string (to send the default value), the internal stream the tester uses hits EOF and triggers the `Aborted` exception. This appends an additional EOL to the stream after the `implode` to simulate one final return key, allowing the final input to use the default value when used in the tester's documented style.
2019-01-04 05:42:43 +01:00
Valentin
b8f6390ef9 Fixed groupBy argument value in DefaultChoiceListFactoryTest 2019-01-04 02:14:05 +03:00
Fabien Potencier
44bb34680d bug #29695 [Form] Do not ignore the choice groups for caching (vudaltsov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Do not ignore the choice groups for caching

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| 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 working on a different issue I suddenly came over a strange behaviour.

```php
$builder
    ->add('choice1', ChoiceType::class, [
        'choices' => [
            'a' => 'a',
            'b' => 'b',
            'c' => 'c',
        ],
        'multiple' => true,
    ])
    ->add('choice2', ChoiceType::class, [
        'choices' => [
            'ab' => [
                'a' => 'a',
                'b' => 'b',
            ],
            'c' => 'c',
        ],
        'multiple' => true,
    ]);
```
The code above will result in two identical selects:

![image](https://user-images.githubusercontent.com/2552865/50459865-b3e36980-0980-11e9-8f3d-17f9cfa9a7f8.png)

The reason for this is hash generation in `Symfony\Component\Form\ChoiceList\Factory\CachingFactoryDecorator::createListFromChoices()` — it does not take array structure into account. See [the comment and the code below it](7f46dfb1c4/src/Symfony/Component/Form/ChoiceList/Factory/CachingFactoryDecorator.php (L116)).

The comment says that the same choice list should be returned for the same collection of choices no matter the structure. This is wrong, because `ChoiceListInterface` has a method `getStructuredValues()` and thus a list instance cannot identified by a hash which does not take structure into account.

I propose a simple change that fixes this and allows for similar choice fields with different groupings.

ping @HeahDude

Commits
-------

9007911a85 Do not ignore the choice groups for caching
2019-01-03 16:02:55 +01:00
Fabien Potencier
b948d5a987 feature #29680 [Form] Add new block_prefix option for an easy form theming (yceruto)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] Add new block_prefix option for an easy form theming

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

Commits
-------

bd50ac44fc Add block_prefix option for an easy form theming
2019-01-03 16:01:11 +01:00
Nicolas Grekas
4f567326d0 minor #29720 Revert "minor #28610 [Form] Check for Intl availibility (ro0NL)" (chalasr)
This PR was merged into the 4.2 branch.

Discussion
----------

Revert "minor #28610 [Form] Check for Intl availibility (ro0NL)"

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

Intl is an hard dependency for Form, these checks cannot be reached.

Commits
-------

3ac98a6a17 Revert "minor #28610 [Form] Check for Intl availibility (ro0NL)"
2019-01-03 16:00:40 +01:00
Nicolas Grekas
743b52fa4e bug #29755 Improved BIC + IBAN validator for some special cases (javiereguiluz)
This PR was squashed before being merged into the 4.3-dev branch (closes #29755).

Discussion
----------

Improved BIC + IBAN validator for some special cases

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

While blogging about [Improved Financial Constraints in Symfony 4.3](https://symfony.com/blog/new-in-symfony-4-3-improved-financial-constraints) I found this resource that mentions some exceptions when validating BIC + IBAN: https://wiki.xmldation.com/index.php?title=Support/EPC/IBAN_%26_BIC_relation

I don't know if that resource is fully reliable ... but I checked it in the official "European Banking Resources" website (https://www.ecbs.org/iban/) and most of it matches, so I think we can safely make this change.

Commits
-------

88a1696a64 Improved BIC + IBAN validator for some special cases
2019-01-03 15:56:41 +01:00
Javier Eguiluz
88a1696a64 Improved BIC + IBAN validator for some special cases 2019-01-03 15:56:35 +01:00
Nicolas Grekas
c573cfb4f5 bug #29738 [Intl] handle null date and time types (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] handle null date and time types

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

Commits
-------

6ded31a3b9 [Intl] handle null date and time types
2019-01-03 15:54:54 +01:00
Grégoire Paris
9f45af4a2b
Do not risk waiting 100 seconds
It this happens, and it happens, this will make the build quite slow.
Refs #29760
2019-01-03 15:48:52 +01:00
Christian Flothmann
6ded31a3b9 [Intl] handle null date and time types 2019-01-03 13:58:33 +01:00
Christian Flothmann
3860d685f4 Merge branch '4.2'
* 4.2:
  update years in license files
  Fix: Adjust DocBlock
  \"ParserTest->getParserTestData()\" -> only some more tests
  access the container getting it from the kernel
  Replace slave and master by replica and primary
  Fix erasing cookies issue
  [Lock] Pedantic improvements for lock
  [EventDispatcher] Fixed phpdoc on interface
  update year in license files
  [VarExporter] fix exporting array indexes
  [SecurityBundle] Fix traceable voters
  [Console] Fix help text for single command applications
  Fix random test failure on lock
  improve error message when using test client without the BrowserKit component
  Fixed minor typos in an error message
  [Event Dispatcher] fixed 29703: TraceableEventDispatcher reset now sets callStack to null with test to dispatch after reset.
  Fixed minor typos
  Fix: Method can also return null
  [Stopwatch] Fixed phpdoc for category name
2019-01-03 10:16:58 +01:00
Christian Flothmann
36110b1e95 update years in license files 2019-01-03 10:09:06 +01:00
Christian Flothmann
3007e36a5c Merge branch '4.1' into 4.2
* 4.1:
  Fix: Adjust DocBlock
  \"ParserTest->getParserTestData()\" -> only some more tests
  access the container getting it from the kernel
  [Lock] Pedantic improvements for lock
  [EventDispatcher] Fixed phpdoc on interface
  update year in license files
  [Console] Fix help text for single command applications
  Fix random test failure on lock
  improve error message when using test client without the BrowserKit component
  [Event Dispatcher] fixed 29703: TraceableEventDispatcher reset now sets callStack to null with test to dispatch after reset.
  Fixed minor typos
  Fix: Method can also return null
  [Stopwatch] Fixed phpdoc for category name
2019-01-03 10:07:35 +01:00
Christian Flothmann
4973a5e9e1 Merge branch '3.4' into 4.1
* 3.4:
  Fix: Adjust DocBlock
  \"ParserTest->getParserTestData()\" -> only some more tests
  [Lock] Pedantic improvements for lock
  [EventDispatcher] Fixed phpdoc on interface
  update year in license files
  [Console] Fix help text for single command applications
  Fix random test failure on lock
  improve error message when using test client without the BrowserKit component
  [Event Dispatcher] fixed 29703: TraceableEventDispatcher reset now sets callStack to null with test to dispatch after reset.
  Fixed minor typos
  Fix: Method can also return null
  [Stopwatch] Fixed phpdoc for category name
2019-01-03 10:05:57 +01:00
Daniel Gonzalez
91e8057d9a [DebugBundle] Added 'theme' option to change the color of dump() when rendered inside templates 2019-01-03 04:26:06 +01:00
Andreas Möller
f8be46be0e
Fix: Adjust DocBlock 2019-01-02 22:24:08 +01:00
Fabien Potencier
10b3d0055a feature #24576 [FrameworkBundle] Added ControllerTrait::isFormValid (lyrixx)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[FrameworkBundle] Added `ControllerTrait::isFormValid`

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

Commits
-------

1a8c844f0e [FrameworkBundle] Added `ControllerTrait::isFormValid`
2019-01-02 13:07:52 +01:00
Fabien Potencier
556a9206ca feature #29483 [HttpKernel] Set the default locale early (thewilkybarkid)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpKernel] Set the default locale early

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

Similar to #29186, the default locale isn't set till after the router so isn't available when trying to handle errors there (well, only the _default_ default locale is).

Commits
-------

02c9f352d9 Set the default locale early
2019-01-02 11:31:36 +01:00
Fabien Potencier
2ce6a34881 feature #29186 [HttpKernel] Increase priority of AddRequestFormatsListener (thewilkybarkid)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpKernel] Increase priority of AddRequestFormatsListener

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

Currently `AddRequestFormatsListener` has a low priority, so it won't fire before others like `RouterListener` which can create problems (eg when listening for a HTTP exception thrown by the router you don't have access for any custom types).

IMO this map should be in the application rather than set on every request, but the same can be achieved by giving it a high priority. (Can't think of a reason for it to not be first...)

Commits
-------

9bf313660d Increase priority of AddRequestFormatsListener
2019-01-02 11:02:59 +01:00
Fabien Potencier
c7d6bda56a feature #29658 [Validator] Choices constraint improvement (nikophil)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Validator] Choices constraint improvement

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

Hi,

here is a little improvement for the choice constraint:  expose a new `choices` wildcard for the messages, in order to provide a way to display easily the valid choices to the user.

thanks.

Commits
-------

71dfa35a21 add new `choices` wildcard in message
2019-01-02 10:34:24 +01:00
Lars Moelleken
a95a8e418b \"ParserTest->getParserTestData()\" -> only some more tests 2019-01-02 10:30:52 +01:00
Christian Flothmann
68ea3f1a64 access the container getting it from the kernel 2019-01-02 10:28:14 +01:00
Raphaëll Roussel
f06e6b46ef Replace slave and master by replica and primary
Remove racially charged terms.
2019-01-02 10:25:07 +01:00
Yonel Ceruto
bd50ac44fc Add block_prefix option for an easy form theming 2019-01-01 19:34:10 -05:00
Fabien Potencier
23cdc73a35 feature #29283 [Serializer] CsvEncoder no header option (encode / decode) (redecs)
This PR was squashed before being merged into the 4.3-dev branch (closes #29283).

Discussion
----------

[Serializer] CsvEncoder no header option (encode / decode)

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

This PR wants to introduce a new context option for the CsvEncoder, `CsvEncoder::NO_HEADERS_KEY` (boolean), that allows CSV encoding/decoding when you don't have/need a header.

By default this is assumed to be false, so the headers are included in the CSV output or assumed to be present in the CSV input.

When the option is set to true, the following behaviour occurs.

Encoding
===
The following PHP input
```php
array(array('a','b'), array('c', 'd'))
```
will generate this CSV output
```csv
a,b
c,d
```

Decoding
===
Considering the CSV input to be
```csv
a,b
c,d
```
the following PHP array will be returned
```php
array (
  0 => array (
    0 => 'a',
    1 => 'b',
  ),
  1 => array (
    0 => 'c',
    1 => 'd',
  ),
)
```

Commits
-------

0e63c61190 [Serializer] CsvEncoder no header option (encode / decode)
2019-01-01 19:36:14 +01:00
Mihai Nica
0e63c61190 [Serializer] CsvEncoder no header option (encode / decode) 2019-01-01 19:36:06 +01:00
Emanuele Iannone
b40801a492 Fix erasing cookies issue
Prevent replacing existing cookies when starting or regenerating session on PHP < 7.3 with 'cookie_samesite' option.
See issue https://github.com/symfony/symfony/issues/29675
2019-01-01 19:29:22 +01:00
Fabien Potencier
c4d6d15e03 feature #29718 [PHPUnit bridge] Bump php version of PHPUnit-bridge (gmponos)
This PR was squashed before being merged into the 4.3-dev branch (closes #29718).

Discussion
----------

[PHPUnit bridge] Bump php version of PHPUnit-bridge

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no (?)
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Related to https://github.com/symfony/symfony/pull/29623#issuecomment-450400625

I checked the BC page I think I couldn't find any related to BC changes... anyway...

As far as I understood from the comment above I must target `master` branch.

Commits
-------

59313095d3 [PHPUnit bridge] Bump php version of PHPUnit-bridge
2019-01-01 19:14:04 +01:00
George Mponos
59313095d3 [PHPUnit bridge] Bump php version of PHPUnit-bridge 2019-01-01 19:13:57 +01:00
Fabien Potencier
99c92210c9 minor #29743 [EventDispatcher] Fixed phpdoc on interface (samnela)
This PR was merged into the 3.4 branch.

Discussion
----------

[EventDispatcher] Fixed phpdoc on interface

| Q             | A
| ------------- | ---
| Branch?       |  3.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | n/a <!-- required for new features -->

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Commits
-------

94bd28ebb0 [EventDispatcher] Fixed phpdoc on interface
2019-01-01 19:08:36 +01:00