Commit Graph

39135 Commits

Author SHA1 Message Date
Laurent VOULLEMIER
a96690cce5 [FrameworkBundle][Routing] Add link to source to router:match 2020-03-20 10:40:16 +01:00
Benjamin Morel
d43833a821 Prevent warning in proc_open() 2020-03-20 07:07:50 +01:00
Guillaume Pédelagrabe
c6ace13e34 [FrameworkBundle] Fix Router Cache 2020-03-19 21:46:03 +01:00
Nicolas Grekas
836a72acba minor #36128 [Form][CheckboxType] Remove _false_is_empty flag (fancyweb)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Form][CheckboxType] Remove _false_is_empty flag

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

Cleanup of https://github.com/symfony/symfony/pull/35938.

Commits
-------

6fac6d4086 [Form][CheckboxType] Remove _false_is_empty flag
2020-03-19 21:44:30 +01:00
Thomas Calvet
6fac6d4086 [Form][CheckboxType] Remove _false_is_empty flag 2020-03-18 14:08:05 +01:00
Laurent VOULLEMIER
dadd1ba967 [FrameworkBundle][PropertyAccess] Add missing argument placeholders 2020-03-18 13:34:23 +01:00
Fabien Potencier
efb4a7f0bc minor #36105 [FrameworkBundle] Fix deprecation message for booting a kernel twice (jschaedl)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Fix deprecation message for booting a kernel twice

| 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       | - <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->
<!--
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/releases):
 - 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 master.
-->

Commits
-------

a0a6243a21 Fix deprecation messages
2020-03-18 09:09:03 +01:00
Nicolas Grekas
4dd6e2f0b2 Merge branch '5.0'
* 5.0:
  [DI] Fix CheckTypeDeclarationPass
  [Security/Http] don't require the session to be started when tracking its id
  [DI] fix preloading script generation
2020-03-18 09:01:26 +01:00
Nicolas Grekas
ea0eb11bcf Merge branch '4.4' into 5.0
* 4.4:
  [DI] Fix CheckTypeDeclarationPass
  [Security/Http] don't require the session to be started when tracking its id
  [DI] fix preloading script generation
2020-03-18 09:00:37 +01:00
Fabien Potencier
e457b24ea7 bug #36103 [DI] fix preloading script generation (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] fix preloading script generation

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

(fabbot failure is a false positive)

On master, we should work on being able to preload more classes (esp. all cache-warmup artifacts).

But for 4.4, this is good enough. Submitted as a bug fix because 1. the current code that deals with preloading kinda-works, but only on "dev" mode... and 2. fixing it provides a nice boost!

Small bench on a hello world:
- before: 380 req/s
- after: 580 req/s

That's +50%!

Pro-tip: adding a few `class_exists()` as done in this PR for the classes that are always used in the implementations (e.g. `new Foo()` in the constructor) will help the preload-script generator to work optimally. Without them, it will discover the symbols to preload only if they're found on methods.

Some of those `class_exists()` are mandatory, in relation to anonymous classes and https://bugs.php.net/79349

Commits
-------

a10fc4da5d [DI] fix preloading script generation
2020-03-18 08:51:32 +01:00
Fabien Potencier
dd4d393a3c feature #36117 [PropertyAccess][DX] Added an UninitializedPropertyException (HeahDude)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[PropertyAccess][DX] Added an `UninitializedPropertyException`

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

Feature version of #36073 for master. Again, better be reviewed without whitespace changes, thanks!

Commits
-------

2b2fd12b0d [PropertyAccess] Added an `UninitializedPropertyException`
2020-03-18 08:43:41 +01:00
Fabien Potencier
e383b41f53 minor #36120 [FrameworkBundle][PropertyAccess] Use injection for info extractors (HeahDude)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle][PropertyAccess] Use injection for info extractors

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

Follows #30704.

Commits
-------

693d4c0a2d [FrameworkBundle][PropertyAccess] Use injection for info extractors
2020-03-18 08:42:17 +01:00
Fabien Potencier
6902a56e75 bug #36119 [PropertyAccess] Added missing new args in PropertyAccessorBuilder (HeahDude)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[PropertyAccess] Added missing new args in `PropertyAccessorBuilder`

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

Following #30704.

Commits
-------

e1be8cd61b [PropertyAccess] Added missing new args in PropertyAccessorBuilder
2020-03-18 08:31:56 +01:00
Fabien Potencier
abefccfbe9 bug #36118 [Security/Http] don't require the session to be started when tracking its id (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security/Http] don't require the session to be started when tracking its id

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

`$session->getId()` returns the empty string when the session is not yet started.
When this happens, the session tracking logic wrongly detects that a new session was created and thus disables HTTP caching.

This fixes the issue by looking at the value of the session cookie instead.
(the case for `true` is when using `MockArraySessionStorage` as done in tests)

Commits
-------

c39188a7cc [Security/Http] don't require the session to be started when tracking its id
2020-03-18 08:28:07 +01:00
Fabien Potencier
7baec325fc bug #36108 [DI] Fix CheckTypeDeclarationPass (guillbdx)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[DI] Fix CheckTypeDeclarationPass

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

Bug 1: The lint container threw an error if a class buit with a factory was declared as callable while this factory method returne a callabe (#35863)

Bug 2: Sodium Exception was not caught in the CheckTypeDeclarationsPass. We have extended the exception caught to \Exception, instead of EnvNotFoundException and RuntimeException only.

Commits
-------

cbf4dfd10f [DI] Fix CheckTypeDeclarationPass
2020-03-18 08:18:50 +01:00
Guillaume Pédelagrabe
cbf4dfd10f [DI] Fix CheckTypeDeclarationPass 2020-03-18 08:18:44 +01:00
Fabien Potencier
56a7969f37 Merge branch '5.0'
* 5.0:
  [VarDumper] fix side-effect by not using mt_rand()
2020-03-18 08:17:09 +01:00
Fabien Potencier
079d85da45 Merge branch '4.4' into 5.0
* 4.4:
  [VarDumper] fix side-effect by not using mt_rand()
2020-03-18 08:16:55 +01:00
Fabien Potencier
104387ab92 Merge branch '3.4' into 4.4
* 3.4:
  [VarDumper] fix side-effect by not using mt_rand()
2020-03-18 08:15:43 +01:00
Jules Pietri
693d4c0a2d
[FrameworkBundle][PropertyAccess] Use injection for info extractors 2020-03-17 23:36:24 +01:00
Nicolas Grekas
8c85f91b9c [VarDumper] fix side-effect by not using mt_rand() 2020-03-17 23:27:36 +01:00
Jules Pietri
e1be8cd61b
[PropertyAccess] Added missing new args in PropertyAccessorBuilder 2020-03-17 22:56:56 +01:00
Nicolas Grekas
c39188a7cc [Security/Http] don't require the session to be started when tracking its id 2020-03-17 22:55:56 +01:00
Jules Pietri
2b2fd12b0d
[PropertyAccess] Added an UninitializedPropertyException 2020-03-17 22:10:22 +01:00
Nicolas Grekas
3f23a45207 Merge branch '5.0'
* 5.0:
  fix merge
  Fix more quotes in exception messages
  Fix more quotes in exception messages
  Fix more quotes in exception messages
  [3.4] Minor fixes
  [PropertyAccess] Improved errors when reading uninitialized properties
2020-03-17 21:06:25 +01:00
Nicolas Grekas
a10fc4da5d [DI] fix preloading script generation 2020-03-17 20:51:46 +01:00
Jan Schädlich
a0a6243a21 Fix deprecation messages 2020-03-17 20:48:51 +01:00
Nicolas Grekas
000ffb29e1 Merge branch '4.4' into 5.0
* 4.4:
  fix merge
2020-03-17 10:54:50 +01:00
Nicolas Grekas
3ae3244b8c fix merge 2020-03-17 10:54:35 +01:00
Jules Pietri
2ff1f886d7
[Form] Added "collection_entry" block prefix to CollectionType entries 2020-03-17 10:07:29 +01:00
Nicolas Grekas
c650fe6dfc minor #35945 Leverage PHP8's get_debug_type() (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

Leverage PHP8's get_debug_type()

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

See https://github.com/symfony/polyfill/pull/226 for background.

We might have to port part of the patch to 4.4 when we'll work on having it support PHP 8, but that's not needed for now.

Commits
-------

daf1c6605e Leverage PHP8's get_debug_type()
2020-03-16 18:33:00 +01:00
Fabien Potencier
955752b74c Fix more quotes in exception messages 2020-03-16 17:47:01 +01:00
Nicolas Grekas
daf1c6605e Leverage PHP8's get_debug_type() 2020-03-16 17:46:21 +01:00
Fabien Potencier
e7e5f334e7 Merge branch '4.4' into 5.0
* 4.4:
  Fix more quotes in exception messages
  Fix more quotes in exception messages
  [3.4] Minor fixes
  [PropertyAccess] Improved errors when reading uninitialized properties
2020-03-16 17:38:48 +01:00
Fabien Potencier
34583b7562 feature #35936 [String] Add AbstractString::containsAny() (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[String] Add AbstractString::containsAny()

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

We decided to not have a `contains()` method because we didn't know how to handle the case where several needles are passed. But https://wiki.php.net/rfc/str_contains made me reconsider this idea and I think `containsAny()` works great. WDYT?

Commits
-------

de79ae7f35 [String] Add AbstractString::containsAny()
2020-03-16 17:24:27 +01:00
Fabien Potencier
c79fe029e7 Fix more quotes in exception messages 2020-03-16 17:13:17 +01:00
Fabien Potencier
cbe50a79a8 Merge branch '3.4' into 4.4
* 3.4:
  Fix more quotes in exception messages
  [3.4] Minor fixes
  [PropertyAccess] Improved errors when reading uninitialized properties
2020-03-16 17:04:53 +01:00
Fabien Potencier
313d865456 Merge branch '5.0'
* 5.0:
  [Notifier] Add tests for AbstractChannel and ChannelPolicy
2020-03-16 17:00:50 +01:00
Fabien Potencier
4ab6156c5a Fix more quotes in exception messages 2020-03-16 16:51:59 +01:00
Fabien Potencier
2c4c19ce8b bug #36073 [PropertyAccess][DX] Improved errors when reading uninitialized properties (HeahDude)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyAccess][DX] Improved errors when reading uninitialized properties

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

An attempt to fix #36051 by providing better error messages when trying to read uninitialized properties either via calling a return-type-hinted method from PHP 7.0 or by accessing public-typed properties from PHP 7.4.

It would be nice to have a proper exception class in master.

Commits
-------

a71023ba65 [PropertyAccess] Improved errors when reading uninitialized properties
2020-03-16 16:16:37 +01:00
Fabien Potencier
6c37f66f3f Fix quotes in exception messages 2020-03-16 15:27:25 +01:00
Fabien Potencier
16ed2b9f7d minor #35847 [Notifier] Add unit tests (jschaedl)
This PR was merged into the 5.0 branch.

Discussion
----------

[Notifier] Add unit tests

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

- [x] `AbstractChannel`
- [x] `ChannelPolicy`
- [x] `RecipientTest` (done in PR #35773)
- [x] `EmailRecipientTest` (done in PR #35773)
- [x] `SmsRecipientTest` (done in PR #35773)
- [x] `Transports` (see PR #35834)

Commits
-------

022c1707e2 [Notifier] Add tests for AbstractChannel and ChannelPolicy
2020-03-16 14:29:03 +01:00
Fabien Potencier
1866a2a88c Merge branch '5.0'
* 5.0:
  Fix quotes in exception messages
  Fix quotes in exception messages
  Fix quotes in exception messages
  Fix quotes in exception messages
  Fix quotes in exception messages
2020-03-16 14:12:54 +01:00
Fabien Potencier
bc60b9c5e4 Fix quotes in exception messages 2020-03-16 14:02:39 +01:00
Fabien Potencier
42df4f434b Fix quotes in exception messages 2020-03-16 13:36:05 +01:00
Fabien Potencier
e903750b9c Merge branch '4.4' into 5.0
* 4.4:
  Fix quotes in exception messages
  Fix quotes in exception messages
  Fix quotes in exception messages
2020-03-16 13:10:54 +01:00
Fabien Potencier
aab0e40cd2 Fix quotes in exception messages 2020-03-16 12:24:17 +01:00
Thomas Calvet
019350022c [3.4] Minor fixes 2020-03-16 11:48:37 +01:00
Fabien Potencier
1ae2da01ff Fix quotes in exception messages 2020-03-16 10:45:04 +01:00
Fabien Potencier
09ee51aa4d Merge branch '3.4' into 4.4
* 3.4:
  Fix quotes in exception messages
2020-03-16 09:56:54 +01:00
Fabien Potencier
48102d96f3 Fix quotes in exception messages 2020-03-16 09:31:04 +01:00
Fabien Potencier
eda7aad51e Merge branch '5.0'
* 5.0:
  [FrameworkBundle] start session on flashbag injection
  [Validator] Remove commas in translations
  [Console] Fallback to default answers when unable to read input
2020-03-16 07:35:57 +01:00
Fabien Potencier
af72aa1d08 Merge branch '4.4' into 5.0
* 4.4:
  [FrameworkBundle] start session on flashbag injection
  [Validator] Remove commas in translations
  [Console] Fallback to default answers when unable to read input
2020-03-16 07:35:48 +01:00
Fabien Potencier
74011262dd Merge branch '3.4' into 4.4
* 3.4:
  [FrameworkBundle] start session on flashbag injection
  [Validator] Remove commas in translations
2020-03-16 07:35:38 +01:00
Fabien Potencier
78b11a591d bug #36063 [FrameworkBundle] start session on flashbag injection (William Arslett)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] start session on flashbag injection

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix [#33084](https://github.com/symfony/symfony/issues/33084)
| License       | MIT

This PR addresses an issue whereby if the FlashBag is injected into the application using the default service configuration, we cannot rely that the session has been started. This behaviour is in contradiction to [the docs](https://symfony.com/doc/current/session.html#avoid-starting-sessions-for-anonymous-users):

> Sessions are automatically started whenever you read, write or even check for the existence of data in the session.

This is because symfony ensures the session has been started on calls to getFlashBag() which is normally how the flashbag will be accessed but this is not called if you inject the FlashBag directly into the container.

I have addressed this issue by changing the way the Flashbag service is built so that it uses Session as a factory service and getFlashBag as a factory method. This means that anywhere in symfony where FlashBag is injected can now rely on the fact the session is started.

I have also added a new functional test to verify this behaviour.

Commits
-------

e8b4d35616 [FrameworkBundle] start session on flashbag injection
2020-03-16 07:35:10 +01:00
William Arslett
e8b4d35616 [FrameworkBundle] start session on flashbag injection 2020-03-16 07:35:04 +01:00
Fabien Potencier
b4f03d0c3b feature #35744 [Validator] Add AtLeastOne constraint and validator (przemyslaw-bogusz)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Validator] Add AtLeastOne constraint and validator

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

This constraint allows you to apply a collection of constraints to a value, and it will be considered valid, if it satisfies at least one of the constraints from the collection.

Some examples:

```php
    /**
     * @Assert\AtLeastOne({
     *     @Assert\Length(min=5),
     *     @Assert\EqualTo("bar")
     * })
     */
    public $name = 'foo';

    /**
     * @Assert\AtLeastOne({
     *     @Assert\All({@Assert\GreaterThanOrEqual(10)}),
     *     @Assert\Count(20)
     * })
     */
    public $numbers = ['3', '5'];

    /**
     * @Assert\All({
     *     @Assert\AtLeastOne({
     *          @Assert\GreaterThanOrEqual(5),
     *          @Assert\LessThanOrEqual(3)
     *     })
     * })
     */
    public $otherNumbers = ['4', '5'];
```

The respective default messages would be:
`name: This value should satisfy at least one of the following constraints: [1] This value is too short. It should have 5 characters or more. [2] This value should be equal to "bar".`

`numbers: This value should satisfy at least one of the following constraints: [1] Each element of this collection should satisfy its own set of constraints. [2] This collection should contain exactly 20 elements.`

`otherNumbers[0]: This value should satisfy at least one of the following constraints: [1] This value should be greater than or equal to 5. [2] This value should be less than or equal to 3.`

But of course you could also create a simple custom message like `None of the constraints are satisfied`.

Commits
-------

e6209a697c [Validator] Add AtLeastOne constraint and validator
2020-03-16 07:29:24 +01:00
Przemysław Bogusz
e6209a697c [Validator] Add AtLeastOne constraint and validator 2020-03-16 07:29:18 +01:00
Fabien Potencier
06a1a1b5bc feature #35729 [Form] Correctly round model with PercentType and add a rounding_mode option (VincentLanglet)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Form] Correctly round model with PercentType and add a rounding_mode option

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #35296
| License       | MIT
| Doc PR        | symfony/symfony-docs#13138

Commits
-------

d97565dcee [Form] Correctly round model with PercentType and add a rounding_mode option
2020-03-16 07:22:47 +01:00
Vincent Langlet
d97565dcee [Form] Correctly round model with PercentType and add a rounding_mode option 2020-03-16 07:22:42 +01:00
Fabien Potencier
e0bddeeef0 feature #35733 [Form] Added a "choice_filter" option to ChoiceType (HeahDude)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Form] Added a "choice_filter" option to ChoiceType

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | Fix #32657
| License       | MIT
| Doc PR        | symfony/symfony-docs#13223

Finally opening this PR for a very old branch, based on both #34550 (merged) and #30994 (merged).

~Until #30994 is merged, this PR should better be reviewed by commits. Thanks!~

Commits
-------

ed2c312609 [Form] Added a "choice_filter" option to ChoiceType
2020-03-16 07:19:38 +01:00
Fabien Potencier
0fb0371029 bug #36069 [DI] skip untyped properties in AutowireRequiredPropertiesPass (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[DI] skip untyped properties in AutowireRequiredPropertiesPass

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

Commits
-------

048d09213e [DI] skip untyped properties in AutowireRequiredPropertiesPass
2020-03-16 07:13:08 +01:00
Fabien Potencier
693cf11b8e feature #36003 [ErrorHandler][FrameworkBundle] better error messages in failing tests (guillbdx)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[ErrorHandler][FrameworkBundle] better error messages in failing tests

| Q             | A
| ------------- | ---
| Branch?       | master for features
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #32752
| License       | MIT
| Doc PR        |

Purpose of this PR is to enhance tests by giving a way to report an exception that occured during the processing of the request.

The ErrorHandler will add an X-Debug-Exception, and the assertThat() method of WebTestCase will throw an exception if this header exists and status code is 5xx.

In practice, this adds the "Caused by" section in this example:

```
Time: 374 ms, Memory: 20.00 MB

There was 1 failure:

1) App\Tests\Controller\HomeControllerTest::testC
Failed asserting that the Response has header "Content-Type" with value "application/json".

/srv/symfony/src/Symfony/Bundle/FrameworkBundle/Test/BrowserKitAssertionsTrait.php:132
/srv/symfony/src/Symfony/Bundle/FrameworkBundle/Test/BrowserKitAssertionsTrait.php:66
/srv/blog/tests/Controller/HomeControllerTest.php:29

Caused by
Exception: This a test exception. in /the/file.php:139
Stack trace:
[...]
```

Commits
-------

0da9469ee2 [ErrorHandler][FrameworkBundle] better error messages in failing tests
2020-03-16 07:11:56 +01:00
Guillaume Pédelagrabe
0da9469ee2 [ErrorHandler][FrameworkBundle] better error messages in failing tests 2020-03-16 07:11:50 +01:00
Fabien Potencier
bd1aaf1f98 bug #36031 [Console] Fallback to default answers when unable to read input (ostrolucky)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Fallback to default answers when unable to read input

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

Alternative to https://github.com/symfony/symfony/pull/36027.

This fixes linked issues without having to revert fix for #30726. Successfully tested with composer script, `docker run` and `docker run -it`.

Commits
-------

8ddaa20b29 [Console] Fallback to default answers when unable to read input
2020-03-16 07:07:59 +01:00
Fabien Potencier
1897e03d7f feature #36034 [PhpUnitBridge] Deprecate @expectedDeprecation annotation (hkdobrev)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[PhpUnitBridge] Deprecate @expectedDeprecation annotation

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

Addresses https://github.com/orgs/symfony/projects/1#card-32934769 as a follow-up to #35192.

Deprecating `@expectedDeprecation` annotation on tests in favour of the `expectDeprecation()` method similar to other PHPUnit deprecations of annotations in favour of methods.

Commits
-------

36a57cc7c2 [PhpUnitBridge] Deprecate @expectedDeprecation annotation
2020-03-16 07:05:20 +01:00
Haralan Dobrev
36a57cc7c2 [PhpUnitBridge] Deprecate @expectedDeprecation annotation 2020-03-16 07:05:14 +01:00
Fabien Potencier
d5c4ba980b feature #35924 [HttpClient] make HttpClient::create() return an AmpHttpClient when amphp/http-client is found but curl is not or too old (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpClient] make `HttpClient::create()` return an `AmpHttpClient` when `amphp/http-client` is found but curl is not or too old

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

Follows #35115

Let's use `amphp/http-client` by default, after `curl` and before `fopen()`.

Commits
-------

7991685e04 [HttpClient] made `HttpClient::create()` return an `AmpHttpClient` when `amphp/http-client` is found but curl is not or too old
2020-03-16 07:03:39 +01:00
Fabien Potencier
7a4be744fd minor #36021 [Validator] Remove commas in translations (przemyslaw-bogusz)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Validator] Remove commas in translations

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| License       | MIT

These translations were originally modified in #21335.

Commits
-------

5688f97bad [Validator] Remove commas in translations
2020-03-16 06:59:27 +01:00
Przemysław Bogusz
5688f97bad [Validator] Remove commas in translations 2020-03-16 06:59:20 +01:00
Jules Pietri
ed2c312609
[Form] Added a "choice_filter" option to ChoiceType 2020-03-15 16:49:24 +01:00
Fabien Potencier
c46d7027e5 Add missing dots at the end of exception messages 2020-03-15 15:54:58 +01:00
Fabien Potencier
d6dd06ba89 Merge branch '5.0'
* 5.0:
  Add missing dots at the end of exception messages
  Add missing dots at the end of exception messages
  [DI][Form] Fixed test suite (TimeType changes & unresolved merge conflict)
  Fix bad merge
  Add missing dots at the end of exception messages
2020-03-15 15:51:35 +01:00
Tobias Schultze
901e62a98f remove unused uuid property
leftover from https://github.com/symfony/symfony/pull/36074
2020-03-15 15:41:40 +01:00
Fabien Potencier
81cf96749b Add missing dots at the end of exception messages 2020-03-15 15:37:05 +01:00
Fabien Potencier
20a19884ac Merge branch '4.4' into 5.0
* 4.4:
  Add missing dots at the end of exception messages
  [DI][Form] Fixed test suite (TimeType changes & unresolved merge conflict)
  Fix bad merge
  Add missing dots at the end of exception messages
2020-03-15 15:33:06 +01:00
Fabien Potencier
6dad402e97 Add missing dots at the end of exception messages 2020-03-15 15:17:26 +01:00
Wouter de Jong
18f5b17249 [DI][Form] Fixed test suite (TimeType changes & unresolved merge conflict) 2020-03-15 15:10:11 +01:00
Fabien Potencier
bfca6b985e bug #36082 [Framework-Bundle] fixed kernel.secret not being overridden when loaded from extension using MicroKernelTrait (jrushlow)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Framework-Bundle] fixed kernel.secret not being overridden when loaded from extension using MicroKernelTrait

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

Previously, when extending `Kernel::class` and using the `MicroKernelTrait::class` setting the `secret` like
```
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)
    {
        $container->loadFromExtension('framework', [ 'secret' => 'foo',]);
```
would not replace the `kernel.secret` parameter set by `$container->setParameter('kernel.secret', '%env(APP_SECRET)%');`  in the `MicroKernelTrait`.

Initiating a service with a secret argument without a `APP_ENV` value set in `.env` would throw:
`Symfony\Component\DependencyInjection\Exception\EnvNotFoundException : Environment variable not found: "APP_SECRET".`

This PR allows the `kernel.secret`  set in the `MicroKernelTrait::registerContainerConfiguration()` to be overridden in a class extending `Kernel` while using the trait.

Thanks @nicolas-grekas for the help on this one.

Commits
-------

76d398851f fixed kernel.secret not being overridden when loaded from extension
2020-03-15 15:04:16 +01:00
Fabien Potencier
691bd88dda feature #36072 [SecurityBundle] Added XSD for the extension configuration (HeahDude)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[SecurityBundle] Added XSD for the extension configuration

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

Commits
-------

66ac3f7f5d [SecurityBundle] Added XSD for the extension configuration
2020-03-15 14:55:40 +01:00
Jules Pietri
a71023ba65
[PropertyAccess] Improved errors when reading uninitialized properties 2020-03-15 14:27:18 +01:00
Jesse Rushlow
76d398851f
fixed kernel.secret not being overridden when loaded from extension 2020-03-15 07:30:16 -04:00
Jules Pietri
66ac3f7f5d
[SecurityBundle] Added XSD for the extension configuration 2020-03-15 11:26:52 +01:00
Fabien Potencier
14f2d22158 Merge branch '3.4' into 4.4
* 3.4:
  Add missing dots at the end of exception messages
2020-03-15 11:05:03 +01:00
Fabien Potencier
66a46f0fab Merge branch '5.0'
* 5.0:
  [HttpClient] Fix typo
  [Mime] Fix boundary header
  ignore microseconds submitted by Edge
2020-03-15 10:56:56 +01:00
Fabien Potencier
c9cdf93d5f Merge branch '4.4' into 5.0
* 4.4:
  [HttpClient] Fix typo
  [Mime] Fix boundary header
  ignore microseconds submitted by Edge
2020-03-15 10:56:47 +01:00
Fabien Potencier
8848de5a6f Merge branch '3.4' into 4.4
* 3.4:
  ignore microseconds submitted by Edge
2020-03-15 10:56:32 +01:00
Fabien Potencier
bb8a66e3fc Add missing dots at the end of exception messages 2020-03-15 10:38:08 +01:00
Nicolas Grekas
d8479adc49 [Uid] add AbstractUid and interop with base-58/32/RFC4122 encodings 2020-03-15 10:01:22 +01:00
Roland Franssen
cbb6d233a1 [UID] Rename NullUuid to NilUuid 2020-03-15 09:07:00 +01:00
Fabien Potencier
68dec1a068 minor #36077 [Uid] Add support for UUIDv6 (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Uid] Add support for UUIDv6

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

See https://github.com/uuid6/uuid6-ietf-draft/blob/master/draft-peabody-dispatch-new-uuid-format-00.txt

A v6 UUID is a lexicographically-sortable-v1.
This makes it db-index friendly (same as ULIDs).

For reference:
- v1 has no benefits over v6 except being in the current official RFC
- v6 is order-friendly and leaks time data + stable entropy (potentially bound to a MAC address or equivalent)
- ULID is also order-friendly and leaks time data, with high entropy (crypto random source)
- v4 is pure crypto random source, aka no order and no leak of anything.

Commits
-------

b705ee1b4b [Uid] Add support for UUIDv6
2020-03-15 09:05:32 +01:00
Nicolas Grekas
a0e8d24144 [Uid] work around slow generation of v4 UUIDs 2020-03-15 01:46:42 +01:00
Nicolas Grekas
b705ee1b4b [Uid] Add support for UUIDv6 2020-03-15 01:13:53 +01:00
Matthieu Mota
186ee831d7 [HttpClient] Fix typo 2020-03-14 19:54:59 +01:00
Nicolas Grekas
62f6ac4d36 [Uid] use one class per type of UUID 2020-03-14 14:51:56 +01:00
Nicolas Grekas
0e05c6de80 [Uid] improve base convertion logic 2020-03-14 13:53:24 +01:00
Fabien Potencier
f166fe5a16 bug #36026 [Mime] Fix boundary header (guillbdx)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Mime] Fix boundary header

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #35443 (fixes the second problem described in this ticket)
| License       | MIT

The boundary value of Content-Type header was enclosed in quotes, cause of the "=" symbol.

Commits
-------

453078ff37 [Mime] Fix boundary header
2020-03-14 09:10:33 +01:00
Guillaume Pédelagrabe
453078ff37 [Mime] Fix boundary header 2020-03-14 09:10:28 +01:00
Fabien Potencier
42c76d7683 feature #36042 [Uid] add support for Ulid (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Uid] add support for Ulid

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

ULIDs are useful alternatives to UUIDs.

From https://github.com/ulid/spec:

UUID can be suboptimal for many use-cases because:

- It isn't the most character efficient way of encoding 128 bits of randomness
- UUID v1/v2 is impractical in many environments, as it requires access to a unique, stable MAC address
- UUID v3/v5 requires a unique seed and produces randomly distributed IDs, which can cause fragmentation in many data structures
- UUID v4 provides no other information than randomness which can cause fragmentation in many data structures

Instead, herein is proposed ULID:

- 128-bit compatibility with UUID
- 1.21e+24 unique ULIDs per millisecond
- Lexicographically sortable!
- Canonically encoded as a 26 character string, as opposed to the 36 character UUID
- Uses Crockford's base32 for better efficiency and readability (5 bits per character)
- Case insensitive
- No special characters (URL safe)
- Monotonic sort order (correctly detects and handles the same millisecond)

Commits
-------

59044f914b [Uid] add support for Ulid
2020-03-14 09:05:51 +01:00
Nicolas Grekas
048d09213e [DI] skip untyped properties in AutowireRequiredPropertiesPass 2020-03-13 23:17:44 +01:00
Nicolas Grekas
49efe9a5a9 [Uid] remove Uuid::getVariant() 2020-03-13 20:12:33 +01:00
Nicolas Grekas
59044f914b [Uid] add support for Ulid 2020-03-13 15:21:35 +01:00
Nicolas Grekas
cc73b1eafa minor #36058 [Uid] make Uuid::equals method accept any types of argument for more flexibility (hhamon)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Uid] make `Uuid::equals` method accept any types of argument for more flexibility

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

I suggest to weaken the `Uuid:equals` method argument type to accept any types of value to compare against. This makes one able to compare the `Uuid` instance with any values.

Commits
-------

46721c19f9 [Uid] make `Uuid::equals()` accept any types of argument for more flexibility
2020-03-13 15:20:10 +01:00
Hugo Hamon
46721c19f9 [Uid] make Uuid::equals() accept any types of argument for more flexibility 2020-03-13 15:19:40 +01:00
Nicolas Grekas
08bb79b174 minor #36053 [Uid] make Uuid::getTime() return subseconds info (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Uid] make Uuid::getTime() return subseconds info

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

A UUID timestamp contains 60bit of data, but a timestamp barely contains 31bit.
Let's return a float instead.

Commits
-------

5a170b80ed [Uid] make Uuid::getTime() return subseconds info
2020-03-13 14:59:23 +01:00
Christian Flothmann
20971dff82 ignore microseconds submitted by Edge 2020-03-13 14:04:07 +01:00
Nicolas Grekas
d028a503e6 feature #35995 [FrameworkBundle] add --deprecations on debug:container command (Simperfit, noemi-salaun)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] add --deprecations on debug:container command

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

_I apologize in advance, I am not fluent in English_

Continuity of @Simperfit work from his PR https://github.com/symfony/symfony/pull/32584

I added support for XML, JSON and markdown formats as well as unit tests for all formats.

## XML format

```xml
<?xml version="1.0" encoding="UTF-8"?>
<deprecations remainingCount="5">
  <deprecation count="3">
    <message>Some deprecation message.</message>
    <file>/path/to/some/file.php</file>
    <line>39</line>
  </deprecation>
  <deprecation count="2">
    <message>An other deprecation message.</message>
    <file>/path/to/an/other/file.php</file>
    <line>25</line>
  </deprecation>
</deprecations>
```

## JSON format

```json
{
  "remainingCount": 5,
  "deprecations": [
    {
      "message": "Some deprecation message.",
      "file": "\/path\/to\/some\/file.php",
      "line": 39,
      "count": 3
    },
    {
      "message": "An other deprecation message.",
      "file": "\/path\/to\/an\/other\/file.php",
      "line": 25,
      "count": 2
    }
  ]
}
```

## Markdown format

## Remaining deprecations (5)

- 3x: "Some deprecation message." in /path/to/some/file.php:39
- 2x: "An other deprecation message." in /path/to/an/other/file.php:25

I added a new commit on top of @Simperfit 's one, but I don't know how you would like to have the git history writed.

Commits
-------

ee6391eb29 [FrameworkBundle] add all formats support for debug:container --deprecations command
161f659146 [FrameworkBundle] add --deprecations on debug:container command
2020-03-13 13:34:29 +01:00
Noémi Salaün
ee6391eb29 [FrameworkBundle] add all formats support for debug:container --deprecations command 2020-03-13 13:34:21 +01:00
Nicolas Grekas
66e53fb1b5 [String] fix test 2020-03-13 12:22:22 +01:00
Nicolas Grekas
53b0f63bc3 [String] leverage Stringable from PHP 8 2020-03-13 11:54:27 +01:00
Nicolas Grekas
5428fef8cb Merge branch '5.0'
* 5.0:
  [Security/Core] fix merge
  fix typo
  [Validator] clarify stringable type annotations
  [Security/Core] fix some annotations
2020-03-13 11:40:02 +01:00
Nicolas Grekas
2f9438677c Merge branch '4.4' into 5.0
* 4.4:
  [Security/Core] fix merge
  fix typo
  [Validator] clarify stringable type annotations
  [Security/Core] fix some annotations
2020-03-13 11:39:51 +01:00
Nicolas Grekas
228b59da56 [Security/Core] fix merge 2020-03-13 11:38:56 +01:00
Nicolas Grekas
162758317c Merge branch '3.4' into 4.4
* 3.4:
  fix typo
  [Validator] clarify stringable type annotations
  [Security/Core] fix some annotations
2020-03-13 11:34:17 +01:00
Nicolas Grekas
523f5c04ab fix typo 2020-03-13 11:30:33 +01:00
Nicolas Grekas
0ee97f23a6 [Validator] clarify stringable type annotations 2020-03-13 11:25:23 +01:00
Nicolas Grekas
8e873d0b5b [Security/Core] fix some annotations 2020-03-13 11:19:21 +01:00
Nicolas Grekas
5a170b80ed [Uid] make Uuid::getTime() return subseconds info 2020-03-13 09:25:19 +01:00
Nicolas Grekas
14c95a9d8c Merge branch '5.0'
* 5.0:
  [Config] fix test
  [HttpClient] disable debug log with curl 7.64.0
  [Intl][3.4] Bump ICU 66.1
  fix import from config file using type: glob
  [DoctrineBridge][DoctrineExtractor] Fix wrong guessed type for "json" type
2020-03-13 09:05:42 +01:00
Nicolas Grekas
381c2e8f62 Merge branch '4.4' into 5.0
* 4.4:
  [Config] fix test
  [HttpClient] disable debug log with curl 7.64.0
  [Intl][3.4] Bump ICU 66.1
  fix import from config file using type: glob
  [DoctrineBridge][DoctrineExtractor] Fix wrong guessed type for "json" type
2020-03-13 09:04:52 +01:00
Nicolas Grekas
1893ef9a0f bug #36038 [HttpClient] disable debug log with curl 7.64.0 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] disable debug log with curl 7.64.0

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

Works around https://curl.haxx.se/mail/archive-2019-02/0013.html

Commits
-------

d4cde31940 [HttpClient] disable debug log with curl 7.64.0
2020-03-13 09:02:30 +01:00
Nicolas Grekas
f9b2714efb Merge branch '3.4' into 4.4
* 3.4:
  [Config] fix test
  [Intl][3.4] Bump ICU 66.1
  fix import from config file using type: glob
  [DoctrineBridge][DoctrineExtractor] Fix wrong guessed type for "json" type
2020-03-13 09:01:26 +01:00
Nicolas Grekas
148b13cdf0 bug #36041 fix import from config file using type: glob (Tobion)
This PR was merged into the 3.4 branch.

Discussion
----------

fix import from config file using type: glob

| 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       |
| License       | MIT
| Doc PR        |

If you try to import configs with glob using
```
imports:
    - { resource: '../dev/*.{php,xml,yaml,yml}', type: 'glob' }
```
it didn't work because the FileLoader resolves the glob pattern but forwards the glob type. This meant the resolver then choses the GlobFilerLoader again for each already resolved file which does not find the files. So in the end the glob was resolved but the files never imported.
The workaround is to remove the `type: glob` from the import above. But the real fix should be to not forward the glob type when it's already resolved.

Commits
-------

6b70511bc6 fix import from config file using type: glob
2020-03-13 08:58:23 +01:00
Nicolas Grekas
f0208767cf bug #35987 [DoctrineBridge][DoctrineExtractor] Fix wrong guessed type for "json" type (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[DoctrineBridge][DoctrineExtractor] Fix wrong guessed type for "json" type

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/35968
| License       | MIT
| Doc PR        | -

After checking the code, it appears that `json` have a different behavior than `json_array`.

> In json_array doctrine was converting null or empty value to array, but json type doesn't do that

@norkunas is right about this. Consequently, we cannot safely guess a built in type for the `json` Doctrine type.

Commits
-------

f9f5f8df3e [DoctrineBridge][DoctrineExtractor] Fix wrong guessed type for "json" type
2020-03-13 08:56:31 +01:00
Nicolas Grekas
c561eb06b7 minor #36045 [Intl][3.4] Bump ICU 66.1 (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl][3.4] Bump ICU 66.1

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| 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 -->
<!--
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/releases):
 - 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 master.
-->
See https://github.com/unicode-org/icu/releases/tag/release-66-1 (no data changes for us)

Commits
-------

2275689cf8 [Intl][3.4] Bump ICU 66.1
2020-03-13 08:55:06 +01:00
Nicolas Grekas
2d509623b0 [Config] fix test 2020-03-13 08:54:41 +01:00
Nicolas Grekas
d4cde31940 [HttpClient] disable debug log with curl 7.64.0 2020-03-13 08:28:20 +01:00
Gabriel Ostrolucký
8ddaa20b29
[Console] Fallback to default answers when unable to read input 2020-03-12 21:13:20 +01:00
Roland Franssen
2275689cf8 [Intl][3.4] Bump ICU 66.1 2020-03-12 20:58:31 +01:00
Amrouche Hamza
161f659146 [FrameworkBundle] add --deprecations on debug:container command 2020-03-12 18:25:48 +01:00
Nicolas Grekas
7991685e04 [HttpClient] made HttpClient::create() return an AmpHttpClient when amphp/http-client is found but curl is not or too old 2020-03-12 18:24:09 +01:00
Fabien Potencier
d108f7b7ef feature #35940 [UID] Added the component + Added support for UUID (lyrixx)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[UID] Added the component + Added support for UUID

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

---

```php
<?php

require __DIR__.'/vendor/autoload.php';

use Symfony\Component\Uid\Uuid;

$u = Uuid::v1();
dump($u);
dump($u->isNull());
dump($u->getType());
dump($u->getVariant());
dump($u->getTime());
dump($u->getMac());
dump($u->isEqualsTo($u));
dump($u->compare($u));
dump(Uuid::fromBinary($u->toBinary()));
```

Commits
-------

c3f14dd0f4 [UID] Added the component + Added support for UUID
2020-03-12 18:23:22 +01:00
Grégoire Pineau
c3f14dd0f4 [UID] Added the component + Added support for UUID 2020-03-12 18:21:37 +01:00
Nicolas Grekas
49e5d5749c feature #31375 [Form] Add label_html attribute (przemyslaw-bogusz)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Form] Add label_html attribute

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT
| Doc PR        | symfony/symfony-docs#13316

I propose to add a new attribute to `BaseType` class so it is easy to include html tags in labels for, both, buttons and other elements that inherit from `FormType` class. This gives you an ability to add, e.g. a glyphicon to a button, or a link to a checkbox, simply inside the `FormBuilder`, which means you can just do
```twig
{{ form(form) }}
```
inside a template.

**Sidenotes**
1. I have started working on this two days ago and it the meantime @alexander-schranz made a similar proposition in #31358. If necessary, I can close my PR and @alexander-schranz can include my suggestions inside his PR.
1. I have just read in #29861 that @mpiot wanted to include this idea in his PR. With respect to @xabbuh's comments from that PR, I hope that my PR will be at least a good place to discuss, if the proposed feature is a good solution.

Commits
-------

239fe04ff9 [Form] Add label_html attribute
2020-03-12 18:18:29 +01:00
Przemysław Bogusz
239fe04ff9 [Form] Add label_html attribute 2020-03-12 18:18:22 +01:00
Nicolas Grekas
1b5430bc9f Merge branch '5.0'
* 5.0: (36 commits)
  Add test for tagged iterator with numeric index
  Fix container lint command when a synthetic service is used in combination with the expression language
  Fix Travis script
  [Validator][Range] Fix typos
  [SecurityBundle] Minor fix in LDAP config tree builder
  [HttpClient] fix requests to hosts that idn_to_ascii() cannot handle
  Revert "minor #35559 [FrameworkBundle] remove mention of the old Controller class (nicolas-grekas)"
  [FrameworkBundle] remove redundant PHPDoc in console Descriptor and subclass
  [Mime] remove phpdoc mentioning Utf8AddressEncoder
  Add missing phpdoc
  Remove int return type from FlattenException::getCode
  [Yaml] fix dumping strings containing CRs
  [DI] Fix XmlFileLoader bad error message
  [Form] Handle false as empty value on expanded choices
  [Messenger] Add ext-redis min version req to tests
  Tweak message
  improve PlaintextPasswordEncoder docBlock summary
  [Validator] Add two missing translations for the Arabic (ar) locale
  Use some PHP 5.4 constants unconditionally
  Add new packages on the link script
  ...
2020-03-12 18:11:13 +01:00
Nicolas Grekas
ac2c8f2352 Merge branch '4.4' into 5.0
* 4.4: (34 commits)
  Add test for tagged iterator with numeric index
  Fix container lint command when a synthetic service is used in combination with the expression language
  [Validator][Range] Fix typos
  [SecurityBundle] Minor fix in LDAP config tree builder
  [HttpClient] fix requests to hosts that idn_to_ascii() cannot handle
  [FrameworkBundle] remove redundant PHPDoc in console Descriptor and subclass
  [Mime] remove phpdoc mentioning Utf8AddressEncoder
  Add missing phpdoc
  Remove int return type from FlattenException::getCode
  [Yaml] fix dumping strings containing CRs
  [DI] Fix XmlFileLoader bad error message
  [Form] Handle false as empty value on expanded choices
  [Messenger] Add ext-redis min version req to tests
  Tweak message
  improve PlaintextPasswordEncoder docBlock summary
  [Validator] Add two missing translations for the Arabic (ar) locale
  Use some PHP 5.4 constants unconditionally
  Add new packages on the link script
  [DI] fix dumping errored definitions
  [DI] ignore extra tags added by autoconfiguration in PriorityTaggedServiceTrait
  ...
2020-03-12 18:08:07 +01:00
Denis Yuzhanin
7aa4e10473 Add test for tagged iterator with numeric index 2020-03-12 18:03:36 +01:00
Nicolas Grekas
2bf9991dcb bug #35949 [DI] Fix container lint command when a synthetic service is used in an expression (HypeMC)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Fix container lint command when a synthetic service is used in an expression

Fix container lint command when a synthetic service is used in combination with the expression language.

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

Commits
-------

e7fa73a32b Fix container lint command when a synthetic service is used in combination with the expression language
2020-03-12 17:59:33 +01:00
HypeMC
e7fa73a32b Fix container lint command when a synthetic service is used in combination with the expression language 2020-03-12 17:59:21 +01:00
Nicolas Grekas
26b123de41 bug #36023 [HttpClient] fix requests to hosts that idn_to_ascii() cannot handle (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix requests to hosts that idn_to_ascii() cannot handle

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

Commits
-------

4b45685306 [HttpClient] fix requests to hosts that idn_to_ascii() cannot handle
2020-03-12 17:52:45 +01:00
Nicolas Grekas
c3eb70d621 Merge branch '3.4' into 4.4
* 3.4:
  [FrameworkBundle] remove redundant PHPDoc in console Descriptor and subclass
  [Form] Handle false as empty value on expanded choices
2020-03-12 17:49:27 +01:00
Nicolas Grekas
aaddef3c57 bug #35938 [Form] Handle false as empty value on expanded choices (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Handle false as empty value on expanded choices

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/31572
| License       | MIT
| Doc PR        | -

This is the 3.4 version of https://github.com/symfony/symfony/pull/32747. The tests are the same. The added code has to be removed from master (if accepted).

Commits
-------

1a366bc378 [Form] Handle false as empty value on expanded choices
2020-03-12 17:44:30 +01:00
Tobias Schultze
6b70511bc6 fix import from config file using type: glob 2020-03-12 17:27:02 +01:00
Nicolas Grekas
cd08bf477e minor #36008 [FrameworkBundle] remove redundant PHPDoc in console Descriptor (noemi-salaun)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] remove redundant PHPDoc in console Descriptor

| Q             | A
| ------------- | ---
| Branch?       | 3.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       | None <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | N/A

The PHPDoc for some `describeXXX` methods in the abstract `Symfony\Bundle\FrameworkBundle\Console\Descriptor\Descriptor` was inaccurate or redundant.

I remove the PHPDoc in the superclass and the `{@inheritdoc}` in the child class as suggested by @chalasr in this PR comment https://github.com/symfony/symfony/pull/35995#discussion_r389846487

I keep the PHPDoc when it adds some explanation about the method or its params.

For exemple :
### inaccurate:
```php
    /**
     * Describes an InputArgument instance.
     */
    abstract protected function describeRouteCollection(RouteCollection $routes, array $options = []);

    /**
     * Describes an InputOption instance.
     */
    abstract protected function describeRoute(Route $route, array $options = []);
```

### redundant
```php
    /**
     * Describes container parameters.
     */
    abstract protected function describeContainerParameters(ParameterBag $parameters, array $options = []);

    /**
     * Describes container tags.
     */
    abstract protected function describeContainerTags(ContainerBuilder $builder, array $options = []);
```

### kept

```php
    /**
     * Describes event dispatcher listeners.
     *
     * Common options are:
     * * name: name of listened event
     */
    abstract protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = []);

    /**
     * Describes a callable.
     *
     * @param mixed $callable
     */
    abstract protected function describeCallable($callable, array $options = []);
```
<!--
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/releases):
 - 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 master.
-->

Commits
-------

e535e7d2ff [FrameworkBundle] remove redundant PHPDoc in console Descriptor and subclass
2020-03-12 17:06:02 +01:00
Nicolas Grekas
741b24926b bug #36030 [SecurityBundle] Minor fix in LDAP config tree builder (HeahDude)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Minor fix in LDAP config tree builder

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

Continuation of #35910 for 4.4.

Commits
-------

468a201d34 [SecurityBundle] Minor fix in LDAP config tree builder
2020-03-12 16:55:28 +01:00
Thomas Calvet
cdb03d3418 [String] Update wcswidth data 2020-03-12 09:06:22 +01:00
Przemysław Bogusz
a08d5191d2 [Validator][Range] Fix typos 2020-03-11 21:51:14 +01:00
Jules Pietri
468a201d34
[SecurityBundle] Minor fix in LDAP config tree builder 2020-03-11 18:56:21 +01:00
Nicolas Grekas
d0b74453de Merge branch '3.4' into 4.4
* 3.4:
  [Yaml] fix dumping strings containing CRs
  [DI] Fix XmlFileLoader bad error message
  Tweak message
  improve PlaintextPasswordEncoder docBlock summary
  [Validator] Add two missing translations for the Arabic (ar) locale
  Use some PHP 5.4 constants unconditionally
  Revert "bug symfony#28179 [DomCrawler] Skip disabled fields processing in Form"
  Add Spanish translation
  Fix typo
  [Validator] add Japanese translation
  Fix typo
  Add Polish translation
  [SecurityBundle] Minor fixes in configuration tree builder
  bumped Symfony version to 3.4.39
  updated VERSION for 3.4.38
  update CONTRIBUTORS for 3.4.38
  updated CHANGELOG for 3.4.38
2020-03-11 18:49:34 +01:00