Commit Graph

35477 Commits

Author SHA1 Message Date
Nicolas Grekas
75894936ac Merge branch '2.7' into 2.8
* 2.7:
  [HttpFoundation] fixed return type of method HeaderBag::get
  [HttpFoundation] Added "resource" type on Request::create docblock
  Revert "bug #25789  Enableable ArrayNodeDefinition is disabled for empty configuration (kejwmen)"
  Revert "bug #25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)"
  [Validator] add missing parent isset and add test
2018-01-21 20:03:25 +01:00
Nicolas Grekas
f33382da34 bug #24864 Have weak_vendors ignore deprecations from outside (greg0ire)
This PR was merged into the 3.3 branch.

Discussion
----------

Have weak_vendors ignore deprecations from outside

phar:// and eval() can execute code that may or may not come from the vendors.

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | not yet
| Fixed tickets | #24853
| License       | MIT

I haven't managed to get the phar test to pass yet, but before I do, is it ok for me to commit a test phar in Symfony? I'm thinking trust issues? Although the phar is almost plain text.

~~Next, I'm stuck because it looks like symfony does not know how to load classes anymore... should I somehow load `vendor/autoload.php` from the phar or something like that?~~ solved, had nothing to do with that.

Commits
-------

9ce0ae2 Have weak_vendors ignore deprecations from outside
2018-01-21 19:49:14 +01:00
Grégoire Paris
9ce0ae23ae
Have weak_vendors ignore deprecations from outside
phar:// and eval() can execute code that may or may not come from the vendors.
2018-01-21 19:42:21 +01:00
Nicolas Grekas
44a03b1017 minor #24949 [HttpFoundation] fixed return type of method HeaderBag::get (AmsTaFFix)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpFoundation] fixed return type of method HeaderBag::get

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

<!--
- 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.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

6b608e8 [HttpFoundation] fixed return type of method HeaderBag::get
2018-01-21 17:38:39 +01:00
AmsTaFFix
6b608e8a5a [HttpFoundation] fixed return type of method HeaderBag::get 2018-01-21 17:36:17 +01:00
Nicolas Grekas
b7d6963ef6 minor #25875 [HttpFoundation] Added "resource" type on Request::create docblock (Jack Wright)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpFoundation] Added "resource" type on Request::create docblock

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

Replaces #24902

Commits
-------

d1a96ca [HttpFoundation] Added "resource" type on Request::create docblock
2018-01-21 17:31:25 +01:00
Robin Chalas
6b2267b836 bug #25873 [Console] Fix using finally where the catch can also fail (nicolas-grekas)
This PR was merged into the 4.0 branch.

Discussion
----------

[Console] Fix using finally where the catch can also fail

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

Restores code to 3.4 state, which is free from the issue.

Commits
-------

763a914 [Console] Fix using finally where the catch can also fail
2018-01-21 17:29:43 +01:00
Jack Wright
d1a96ca9d3 [HttpFoundation] Added "resource" type on Request::create docblock 2018-01-21 17:28:26 +01:00
Nicolas Grekas
8ff4136d7a bug #25848 [Validator] add missing parent isset and add test (Simperfit)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] add missing parent isset and add test

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #25843 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |

This is a little PR to fix the error and to add the parent::__isset to the Constraints class, I'm adding a test too to be sure that this is not possible again.

Btw, since this is instagihub, I'm coding at home and then I see a squirrel :
![img_3187 heic](https://user-images.githubusercontent.com/3451634/35149517-a9ddc0ba-fd16-11e7-9e22-cdba0b677071.jpeg)

Commits
-------

bcb79a3 [Validator] add missing parent isset and add test
2018-01-21 16:35:33 +01:00
Nicolas Grekas
02e5c67fb7 bug #25869 [Process] Skip environment variables with false value in Process (francoispluchino)
This PR was merged into the 3.3 branch.

Discussion
----------

[Process] Skip environment variables with false value in Process

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

With the commit 03adce239d, all env variables are injecting in the process, and the env variable with the `false` value are converted in empty string.

For example, it's problematic with the bundle SymfonyWebServerBundle and the last version of the [symfony/framework-bundle recipe](https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/3.3/public/index.php#L11), because the WebServer override the value of `APP_ENV` with `false` to override previously loaded variables (c5a1218555), and with the commit 03adce239d, the `APP_ENV` variable is injected with a empty string value, instead of not being injected, as was the case before.

This PR not use the same logic as the [getDefaultEnv()](https://github.com/symfony/symfony/blob/4.0/src/Symfony/Component/Process/Process.php#L1553) method.

Commits
-------

2daf4f9 [Process] Skip environment variables with false value in Process
2018-01-21 16:22:08 +01:00
Nicolas Grekas
f456b0f376 feature #22253 [Config] allow changing the path separator (bburnichon)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Config] allow changing the path separator

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

In bundles configuration, no dots are allowed in key names, but as a standalone config, there is no such limitation that should be enforced.

By using current `NodeBuilder` it should be possible to change path separator used (for example: `/`)

Commits
-------

15e05e1 Add feature allowing change of Path Separator
2018-01-21 16:17:35 +01:00
Benoît Burnichon
15e05e1e17 Add feature allowing change of Path Separator 2018-01-21 16:11:55 +01:00
Nicolas Grekas
763a9145a8 [Console] Fix using finally where the catch can also fail 2018-01-21 15:52:44 +01:00
Fabien Potencier
7d8577be8a bug #25864 [Yaml] don't split lines on carriage returns when dumping (xabbuh)
This PR was merged into the 3.3 branch.

Discussion
----------

[Yaml] don't split lines on carriage returns when dumping

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

Commits
-------

845eb88f3b don't split lines on carriage returns when dumping
2018-01-21 13:26:08 +01:00
Fabien Potencier
4d70f9b695 bug #25863 [Yaml] trim spaces from unquoted scalar values (xabbuh)
This PR was merged into the 4.0 branch.

Discussion
----------

[Yaml] trim spaces from unquoted scalar values

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

Commits
-------

5e70ee898e trim spaces from unquoted scalar values
2018-01-21 13:23:47 +01:00
François Pluchino
2daf4f98ff [Process] Skip environment variables with false value in Process 2018-01-21 12:04:49 +01:00
Nicolas Grekas
5e750ec4b5 [DI] Fix initialization of legacy containers by delaying include_once 2018-01-21 10:59:06 +01:00
Fabien Potencier
bccab35aa2 minor #25854 [DI] compilation perf tweak (nicolas-grekas)
This PR was merged into the 3.3 branch.

Discussion
----------

[DI] compilation perf tweak

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

![image](https://user-images.githubusercontent.com/243674/35181621-94c5c10a-fdc5-11e7-83fb-c640a0ed2fa9.png)

Commits
-------

ad8aff4203 [DI] compilation perf tweak
2018-01-21 08:39:11 +01:00
Fabien Potencier
ac3e1b172d minor #25870 Formatting fix in upgrade 3.0 document (Piotr Błasiak)
This PR was merged into the 2.8 branch.

Discussion
----------

Formatting fix in upgrade 3.0 document

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

Fixes formatting in upgrade file.
This fix was already done in https://github.com/symfony/symfony/pull/22436 but applied to 3.2.
Formatting error still exists in 2.8, 3.0, 3.1. I don't know if this was intentional.

Commits
-------

dc6d5e1083 Formatting fix in upgrade 3.0 document
2018-01-21 08:36:45 +01:00
Fabien Potencier
9312f794e8 Revert "bug #25789 Enableable ArrayNodeDefinition is disabled for empty configuration (kejwmen)"
This reverts commit 132cec44f2, reversing
changes made to d41130153e.
2018-01-21 08:24:24 +01:00
Fabien Potencier
1fedcffbb9 bug #25861 do not conflict with egulias/email-validator 2.0+ (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

do not conflict with egulias/email-validator 2.0+

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

Not allowing `egulias/email-validator` 2.0+ will prevent applications using this package from updating to the next patch release.

Commits
-------

1a1aaa74d6 Revert "bug #25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)"
2018-01-21 08:22:52 +01:00
Piotr Błasiak
dc6d5e1083 Formatting fix in upgrade 3.0 document 2018-01-20 23:34:15 +01:00
Christian Flothmann
845eb88f3b don't split lines on carriage returns when dumping 2018-01-20 16:04:53 +01:00
Christian Flothmann
5e70ee898e trim spaces from unquoted scalar values 2018-01-20 15:02:12 +01:00
Christian Flothmann
1a1aaa74d6 Revert "bug #25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)"
This reverts commit f1f18ad608, reversing
changes made to 8e8ee09747.
2018-01-20 13:12:25 +01:00
Fabien Potencier
aae79986a8 Merge branch '2.8' into 3.3
* 2.8:
  [Validator] Conflict with egulias/email-validator 2.0
2018-01-20 11:54:14 +01:00
Fabien Potencier
420789c694 Merge branch '2.7' into 2.8
* 2.7:
  [Validator] Conflict with egulias/email-validator 2.0
2018-01-20 11:50:52 +01:00
Fabien Potencier
f1f18ad608 bug #25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] Conflict with egulias/email-validator 2.0

| Q             | A
| ------------- | ---
| Branch?       | 2.7 (and 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

For code that uses `EmailValidator` with strict email checking using `egulias/email-validator` and that aims to support both Symfony 2.8 LTS and Symfony 3.4/4.0, it is impossible to have a working set of dependencies with Symfony 2.7/Symfony 2.8 if one wishes to use `egulias/email-validator: ^1.2|^2.1`.

This is because Composer happily installs `egulias/email-validator` latest 2.1.x which is not compatible with Symfony 2.8.

This would prevent installation of v2.1.x on Symfony 2.7/2.8.

Commits
-------

72d8e8adb0 [Validator] Conflict with egulias/email-validator 2.0
2018-01-20 11:43:40 +01:00
Nicolas Grekas
ad8aff4203 [DI] compilation perf tweak 2018-01-20 09:34:19 +01:00
Edi Modrić
72d8e8adb0 [Validator] Conflict with egulias/email-validator 2.0 2018-01-20 00:08:53 +01:00
Fabien Potencier
2aa54b8cbd feature #25493 [Serializer] default_constructor_arguments context option for denormalization (Nek-)
This PR was squashed before being merged into the 4.1-dev branch (closes #25493).

Discussion
----------

[Serializer] `default_constructor_arguments` context option for denormalization

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

## Problems

In the case you want to deserialize value-objects, if all the data required by its constructor are **not** given as input, the serializer will throw a simple `RuntimeException` exception. This makes impossible to catch it. (as current fix on my projects I use exception message to be sure to catch the good one X.x")

The second problem is a missing feature to fill the required object with an empty one. This needs to be defined by the user because the serializer can't guess how to build it.

Here is a project that exposes the problem of the current behavior. https://github.com/Nek-/api-platform-value-object

## Solutions suggested

I suggest a solution in 2 parts because the second part is more touchy.

1. Replace the current exception by a new specific one
2. Add a new `empty_data` option to the context of deserialization so you can specify data for objects impossible to instantiate, this is great because the serializer no more throw exception and the validator can then work as expected and send violations to the user. This solution is inspired by forms solutions to fix the issue with value objects

Here is what you can do with this feature:
```php
class DummyValueObject
{
    public function __construct($foo, $bar) { $this->foo = $foo; $this->bar = $bar; }
}

$empty = new DummyValueObject('', '');
$result = $normalizer->denormalize(['foo' => 'Hello'], DummyValueObject::class, 'json', [
    'empty_data' => [
        DummyValueObject::class => $empty,
    ],
]);

// It's impossible to construct a DummyValueObject with only "foo" value. So the serializer
// will replace it with the given empty data
```

There are 2 commits so I can quickly provide you only the first point if you want. Hope you'll like this.

## Solution after discussion

1. New exception `MissingConstructorArgumentsException`
2. New context option `default_constructor_arguments`

```php
class DummyValueObject
{
    public function __construct($foo, $bar) { $this->foo = $foo; $this->bar = $bar; }
}

$result = $normalizer->denormalize(['foo' => 'Hello'], DummyValueObject::class, 'json', [
    'default_constructor_arguments' => [
        DummyValueObject::class => ['foo' => '', 'bar' => ''],
    ],
]);

// DummyValueObject is contructed with the given `foo` and empty `bar`
```

Commits
-------

1523a85542 [Serializer]  context option for denormalization
2018-01-19 13:05:43 +01:00
Maxime Veber
1523a85542 [Serializer] context option for denormalization 2018-01-19 13:05:41 +01:00
Fabien Potencier
fe3e2c3adc feature #25839 [SecurityBundle] Deprecate in_memory.user abstract service (chalasr)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[SecurityBundle] Deprecate in_memory.user abstract service

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

Commits
-------

75a4117b66 [SecurityBundle] Deprecate in_memory.user abstract service
2018-01-19 12:59:28 +01:00
Amrouche Hamza
bcb79a39ef
[Validator] add missing parent isset and add test 2018-01-19 12:39:28 +01:00
Robin Chalas
75a4117b66 [SecurityBundle] Deprecate in_memory.user abstract service 2018-01-19 12:36:48 +01:00
Robin Chalas
9b0e73715b Merge branch '4.0'
* 4.0:
  [Serializer] fix undefined class
  [FrameworkBundle] fix DI extension tests
2018-01-19 12:32:05 +01:00
Robin Chalas
3d011e0e37 Merge branch '3.4' into 4.0
* 3.4:
  [Serializer] fix undefined class
  [FrameworkBundle] fix DI extension tests
2018-01-19 12:28:59 +01:00
Robin Chalas
d2a316f0db minor #25846 [Serializer] Fix undefined class (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Fix undefined class

| 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

bad merge

Commits
-------

bc7b5d2 [Serializer] fix undefined class
2018-01-19 12:28:17 +01:00
Robin Chalas
bc7b5d2943 [Serializer] fix undefined class 2018-01-19 12:19:37 +01:00
Robin Chalas
f5d2d67508 Merge branch '3.3' into 3.4
* 3.3:
  [FrameworkBundle] fix DI extension tests
2018-01-19 12:19:01 +01:00
Robin Chalas
38abc7bb8f minor #25847 [FrameworkBundle] fix DI extension tests (xabbuh)
This PR was merged into the 3.3 branch.

Discussion
----------

[FrameworkBundle] fix DI extension tests

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

The failing tests relied on the assets integration being enabled. Since
we never did enable this explicitly, the assets related definitions are
removed now that #25789 was merged which fixed #25760.

Commits
-------

1cb8f69 [FrameworkBundle] fix DI extension tests
2018-01-19 12:17:11 +01:00
Christian Flothmann
1cb8f6918f [FrameworkBundle] fix DI extension tests
The failing tests relied on the assets integration being enabled. Since
we never did enable this explicitly, the assets related definitions are
removed now that #25789 was merged which fixed #25760.
2018-01-19 12:05:40 +01:00
Robin Chalas
86a7dede86 Merge branch '4.0'
* 4.0:
  fix merge
2018-01-19 11:07:49 +01:00
Robin Chalas
77465e3495 Merge branch '3.4' into 4.0
* 3.4:
  fix merge
2018-01-19 11:07:28 +01:00
Robin Chalas
39557e25c4 fix merge 2018-01-19 11:06:48 +01:00
Robin Chalas
1b1ed670a6 Merge branch '3.3' into 3.4
* 3.3:
  [SecurityBundle] Don't register in memory users as services
2018-01-19 11:03:45 +01:00
Robin Chalas
2c6e23cb3e Merge branch '4.0'
* 4.0:
  Fix translation test
  [SecurityBundle] Don't register in memory users as services
2018-01-19 10:39:33 +01:00
Robin Chalas
6cab776316 Fix translation test 2018-01-19 10:38:27 +01:00
Robin Chalas
34a3e25c1f Merge branch '3.3' into 4.0
* 3.3:
  [SecurityBundle] Don't register in memory users as services
2018-01-19 10:33:46 +01:00
Robin Chalas
00621d4840 Merge branch '2.8' into 3.3
* 2.8:
  [SecurityBundle] Don't register in memory users as services
2018-01-19 10:28:48 +01:00