Commit Graph

48240 Commits

Author SHA1 Message Date
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
Fabien Potencier
00aab67e6b minor #36078 [Uid] work around slow generation of v4 UUIDs (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Uid] work around slow generation of v4 UUIDs

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

This is more than 4 times faster than `uuid_create()` for v4.
As described in https://jolicode.com/blog/uuid-generation-in-php

Commits
-------

a0e8d24144 [Uid] work around slow generation of v4 UUIDs
2020-03-15 09:03:52 +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
Nicolas Grekas
9fa7ee1379 minor #36076 [HttpClient] Fix typo (matthieumota)
This PR was submitted for the master branch but it was merged into the 4.4 branch instead.

Discussion
----------

[HttpClient] Fix typo

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

A little typo in docblock.

Commits
-------

186ee831d7 [HttpClient] Fix typo
2020-03-14 19:55:30 +01:00
Matthieu Mota
186ee831d7 [HttpClient] Fix typo 2020-03-14 19:54:59 +01:00
Nicolas Grekas
7dc6da6c26 feature #36066 [Uid] use one class per type of UUID (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Uid] use one class per type of UUID

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

(embeds #36064 for now)

Would it make sense to have one class per type of UUID?
This aligns the type system and UUID types, so that one could type hint e.g. `UuidV4 $uuid`.

This PR does so. `UuidV1`/2/3/4 and `NullUuid` all extend the base `Uuid` class, which provides common methods and the factories needed to create each king of UUID.

This means we don't need the `getType()` nor the `isNull()` methods since they can be replaced by instanceof checks.

As expected,  `getTime()` and `getMac()` then now exist only on the `UuidV1` class - no need for any version check nor any `LogicException` anymore.

Each type is guaranteed to contain a UUID that matches its class' type. The base `Uuid` class is used for the "no type" type.

Commits
-------

62f6ac4d36 [Uid] use one class per type of UUID
2020-03-14 14:55:35 +01:00
Nicolas Grekas
62f6ac4d36 [Uid] use one class per type of UUID 2020-03-14 14:51:56 +01:00
Nicolas Grekas
fa5d63685d minor #36070 [Uid] improve base convertion logic (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Uid] improve base convertion logic

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

The new logic is at least twice as fast as the current algo.
It's also way more common and generic.

Commits
-------

0e05c6de80 [Uid] improve base convertion logic
2020-03-14 13:54: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
Fabien Potencier
aed93cdada minor #36064 [Uid] remove Uuid::getVariant() (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Uid] remove Uuid::getVariant()

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

Let's simplify the API. One less concept to grasp.
I think there are no use cases for variants in modern tech, check:
https://en.wikipedia.org/wiki/Universally_unique_identifier#Variants

Commits
-------

49efe9a5a9 [Uid] remove Uuid::getVariant()
2020-03-14 08:58:18 +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
a562ba23df bug #36020 [Form] ignore microseconds submitted by Edge (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] ignore microseconds submitted by Edge

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

Commits
-------

20971dff82 ignore microseconds submitted by Edge
2020-03-13 15:28:57 +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
6f206c55e7 feature #36059 [String] leverage Stringable from PHP 8 (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[String] leverage Stringable from PHP 8

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

Commits
-------

53b0f63bc3 [String] leverage Stringable from PHP 8
2020-03-13 11:59:45 +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
cbb9d01b6c minor #36057 [Validator] clarify stringable type annotations (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] clarify stringable type annotations

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

Commits
-------

0ee97f23a6 [Validator] clarify stringable type annotations
2020-03-13 11:26:47 +01:00
Nicolas Grekas
0ee97f23a6 [Validator] clarify stringable type annotations 2020-03-13 11:25:23 +01:00
Nicolas Grekas
f6f19e6c00 minor #36056 [Security/Core] fix some annotations (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security/Core] fix some annotations

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

`RoleInterface` is deprecated, and we don't document deprecated ways in docblocks/exceptions.

Commits
-------

8e873d0b5b [Security/Core] fix some annotations
2020-03-13 11:22:53 +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