Commit Graph

50768 Commits

Author SHA1 Message Date
Fabien Potencier
7a0cc2c0e4 Fix CS 2020-09-11 07:25:20 +02:00
Fabien Potencier
8cb2d296f9 Fix previous merge 2020-09-11 07:20:58 +02:00
Fabien Potencier
7192d29efc feature #38151 [Serializer] add UidNormalizer (guillbdx, norkunas)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Serializer] add UidNormalizer

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | #36102
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

UUID and ULID normalizer.

Continuation of #36406

Commits
-------

d6a899395b Update based on feedback
1c21c78d25 UidNormalizer.
2020-09-11 07:18:48 +02:00
Tomas
d6a899395b Update based on feedback 2020-09-11 07:18:37 +02:00
Guillaume Pédelagrabe
1c21c78d25 UidNormalizer. 2020-09-11 07:18:37 +02:00
Nicolas Grekas
be6146c566 [HttpClient] fix compat with older PHP/curl versions 2020-09-10 20:24:52 +02:00
Nicolas Grekas
5aadd607ce [HttpClient] forbid CURLOPT_HTTP09_ALLOWED 2020-09-10 20:22:28 +02:00
Fabien Potencier
0aae1b491c feature #37976 [Messenger] Don't prevent dispatch out of another bus (ogizanagi)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Messenger] Don't prevent dispatch out of another bus

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | https://github.com/symfony/symfony/issues/35814#issuecomment-682433541 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

1e8ae43372 [Messenger] Don't prevent dispatch out of another bus
2020-09-10 19:13:48 +02:00
Maxime Steinhausser
1e8ae43372 [Messenger] Don't prevent dispatch out of another bus 2020-09-10 19:13:35 +02:00
Fabien Potencier
9cd3e674e6 bug #38141 [Messenger] Added factory methods to DelayStamp for better DX (Toflar)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Messenger] Added factory methods to DelayStamp for better DX

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

I often find myself delaying messages for a few minutes or so and I always have to remember the `DelayStamp` uses milliseconds. I guess these simple factories could improve DX quite a bit :)

Commits
-------

fdc8da0aaa [Messenger] Added factory methods to DelayStamp for better DX
2020-09-10 18:59:02 +02:00
Yanick Witschi
fdc8da0aaa [Messenger] Added factory methods to DelayStamp for better DX 2020-09-10 18:54:55 +02:00
Nicolas Grekas
474e877035 feature #38134 [Lock] Fix wrong interface for MongoDbStore (jderusse)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Lock] Fix wrong interface for MongoDbStore

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

The MongoDbStore is not a `BlockingStore` because does not "really" implements  the method `waitAndSave`.

This PR changes the interface of `MongoDbStore` and remove the dummy implementation of `waitAndSave`.

Commits
-------

4c2d32ce11 Fix wrong interface for MongoDbStore
2020-09-10 18:54:54 +02:00
Jérémy Derussé
4c2d32ce11 Fix wrong interface for MongoDbStore 2020-09-10 18:54:38 +02:00
Fabien Potencier
4c873fe501 feature #38135 [AmazonSqsMessenger] Added the count message awareness on the transport (raphahardt)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[AmazonSqsMessenger] Added the count message awareness on the transport

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

Added the possibility of have message count awareness of the receiver on the transport.

Commits
-------

96b63b83bf [AmazonSqsMessenger] Added the count message awareness on the transport
2020-09-10 14:42:05 +02:00
Fabien Potencier
ad0c9f5d62 Merge branch '5.1'
* 5.1:
  [FrameworkBundle] adopt src/.preload.php
  [Cache] Fix key encoding issue in Memcached adapter
  [HttpClient] Fix Array to string conversion notice when parsing JSON error body with non-scalar detail property
2020-09-10 14:33:14 +02:00
Fabien Potencier
4409a30dee Merge branch '4.4' into 5.1
* 4.4:
  [FrameworkBundle] adopt src/.preload.php
  [Cache] Fix key encoding issue in Memcached adapter
  [HttpClient] Fix Array to string conversion notice when parsing JSON error body with non-scalar detail property
2020-09-10 14:33:01 +02:00
Fabien Potencier
cfec631620 bug #38142 [FrameworkBundle] adopt src/.preload.php (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] adopt src/.preload.php

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

The leading dot prevents PSR-4 discovery from considering the file.

Commits
-------

f4c47ebefa [FrameworkBundle] adopt src/.preload.php
2020-09-10 14:32:12 +02:00
Nicolas Grekas
f4c47ebefa [FrameworkBundle] adopt src/.preload.php 2020-09-10 14:29:02 +02:00
Tobias Schultze
38e414003c minor #38138 [Translation] fix parsing tokens on PHP 8 (xabbuh)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Translation] fix parsing tokens on PHP 8

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

Commits
-------

1d1194e973 fix parsing tokens on PHP 8
2020-09-10 11:38:32 +02:00
Christian Flothmann
6bf856cd15 Merge branch '5.1' into master
* 5.1:
  ensure that the offset is part of the string
2020-09-10 10:46:37 +02:00
Nicolas Grekas
0ceafbcbea feature #38026 [HttpClient] Allow to provide additional curl options to CurlHttpClient (pizzaminded)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] Allow to provide additional curl options  to CurlHttpClient

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

~~**Tagging as a draft because:**~~
- ~~there is no Doc PR Ready yet~~
- probably there are better test cases required here.

This PR introduces an option to override default curl options defined in `CurlHttpClient`.  To override them, there is a special place in `$options` provided:

````php
$response = $httpClient->request('GET', 'http://your.url.here', [
            'extra' => [
                'curl' => [
                    CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
                ]
            ]
        ]);
````

This feature is available only in `CurlHttpClient` and would be ignored in another clients.

Commits
-------

89329bd979 [HttpClient] Allow to provide additional curl options  to CurlHttpClient
2020-09-10 10:40:05 +02:00
pizzaminded
89329bd979 [HttpClient] Allow to provide additional curl options to CurlHttpClient 2020-09-10 10:39:47 +02:00
Christian Flothmann
1d1194e973 fix parsing tokens on PHP 8 2020-09-10 10:35:47 +02:00
Raphael Hardt
96b63b83bf [AmazonSqsMessenger] Added the count message awareness on the transport 2020-09-10 02:04:08 -03:00
Fabien Potencier
3c5a4ed06e minor #38128 [String] ensure that the offset is part of the string (xabbuh)
This PR was merged into the 5.1 branch.

Discussion
----------

[String] ensure that the offset is part of the string

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

Commits
-------

a6c046f3ab ensure that the offset is part of the string
2020-09-10 06:59:07 +02:00
Christian Flothmann
a6c046f3ab ensure that the offset is part of the string 2020-09-09 14:58:41 +02:00
Christian Flothmann
1bdae34365 Merge branch '5.1' into master
* 5.1:
  [Intl] promote warnings to value errors on PHP 8
  Fix CS
  DateTime validator support for trailing data
  Remove some leftover for HHVM support
  Simplify code
  Fix tests on 5.6
  [Debug] Skip a test that was meant for HHVM.
  [Console] Silence warnings on sapi_windows_cp_set() call
  guard $argv + $token against null, preventing unnecessary exceptions
2020-09-09 14:41:49 +02:00
Nicolas Grekas
afd4027c11 bug #38108 [Cache] Fix key encoding issue in Memcached adapter (lstrojny)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Cache] Fix key encoding issue in Memcached adapter

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n.A.
| License       | MIT
| Doc PR        | Fix double encoding in memcached which lead to overlong keys being generated

Because the memcached adapter uses `rawurlencode()` to encode each and every key, keys will sometimes be too long and therefore hit the memcached limit of 250 bytes. This happens when the key is small enough to be below 250 when passed to `AbstractAdapterTrait::getId()` and is then blown up over the 250 bytes limit in memcached adapter without validating the length again.

Looking through the code, it seems that the double encoding is wholly unnecessary assuming if one makes sure the namespace is properly encoded. This PR therefore removes the double encoding and instead uses rawurlencode on the namespace (which is in turn properly accounted for when calculating whether or not we are over the ID limit).

Commits
-------

23bf9be8ce [Cache] Fix key encoding issue in Memcached adapter
2020-09-09 11:22:51 +02:00
Lars Strojny
23bf9be8ce [Cache] Fix key encoding issue in Memcached adapter 2020-09-09 11:22:35 +02:00
Nicolas Grekas
9bb80841ed bug #38122 [HttpClient] Fix Array to string conversion notice when parsing JSON error body with non-scalar detail property (emarref)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpClient] Fix Array to string conversion notice when parsing JSON error body with non-scalar detail property

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

An earlier commit added the ability to detect common API formats and extract a useful error message from the error response payload. To achieve this, if a `title` and `detail` property are found in the error response, the response is considered to be in a known format (RFC 7807) and these values are concatenated to form a helpful error message.

However, when either `title` or `detail` property are present, but the document is not intended to follow the RFC semantics, if the properties are not scalar (e.g. if the detail property is an array of field validation violations) then the concatenation of the strings causes a notice to be raised.

This pull request checks that the `title` and `detail` properties are scalar before attempting to concatenate them. If they are not, no enhanced error message is provided.

Commits
-------

76fa884319 [HttpClient] Fix Array to string conversion notice when parsing JSON error body with non-scalar detail property
2020-09-09 11:17:46 +02:00
Malcolm Fell
76fa884319 [HttpClient] Fix Array to string conversion notice when parsing JSON error body with non-scalar detail property 2020-09-09 11:17:34 +02:00
Christian Flothmann
41cb27beb0 Merge branch '4.4' into 5.1
* 4.4:
  [Intl] promote warnings to value errors on PHP 8
  Fix CS
  DateTime validator support for trailing data
  Remove some leftover for HHVM support
  Simplify code
  Fix tests on 5.6
  [Debug] Skip a test that was meant for HHVM.
  [Console] Silence warnings on sapi_windows_cp_set() call
  guard $argv + $token against null, preventing unnecessary exceptions
2020-09-09 10:28:14 +02:00
Christian Flothmann
0ed20be407 Merge branch '3.4' into 4.4
* 3.4:
  [Intl] promote warnings to value errors on PHP 8
  Fix CS
  DateTime validator support for trailing data
2020-09-09 10:00:22 +02:00
Christian Flothmann
81b954b753 minor #38120 [Intl] promote warnings to value errors on PHP 8 (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] promote warnings to value errors on PHP 8

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

Commits
-------

82d9d41d57 [Intl] promote warnings to value errors on PHP 8
2020-09-09 09:59:57 +02:00
Christian Flothmann
82d9d41d57 [Intl] promote warnings to value errors on PHP 8 2020-09-09 09:45:25 +02:00
Fabien Potencier
799624b6f1 Fix CS 2020-09-09 07:35:36 +02:00
Fabien Potencier
1e52146339 bug #37097 DateTime validator support for trailing data (stefankleff)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

DateTime validator support for trailing data

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

Commits
-------

27f6e28f5b DateTime validator support for trailing data
2020-09-09 07:34:53 +02:00
Stefan Kleff
27f6e28f5b DateTime validator support for trailing data 2020-09-09 07:34:45 +02:00
Fabien Potencier
bb3bc7fc48 minor #38119 Remove some leftover for HHVM support (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Remove some leftover for HHVM support

| 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 #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

cf9e75614b Remove some leftover for HHVM support
2020-09-09 07:23:40 +02:00
Fabien Potencier
cf9e75614b Remove some leftover for HHVM support 2020-09-09 07:20:36 +02:00
Fabien Potencier
80e5a7fbd8 feature #37559 [PropertyInfo] fix array types with keys (array<string, string>) (digilist)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[PropertyInfo] fix array types with keys (array<string, string>)

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

Array types with keys are currently not detected correctly from the PropertyInfo component:

```
@var array<string, string>
@var array<string, array<integer, string>>
```

Those are currently identified as object with class `rray<string, string>`.

This PR tries to fix it.

What I noticed while fixing this, is that union types in arrays are not supported in general at the moment, because the `Type` class supports only one collectionValueType and I do not see how to pass a Union Type there. But I guess that's a different issue and for those types I decided to return null as collection value type for now. (Or better throw on exception?)

Commits
-------

64f7bd7832 [PropertyInfo] fix array types with keys (array<string, string>)
2020-09-09 07:17:12 +02:00
Fabien Potencier
656fc3b82a Simplify code 2020-09-09 07:14:52 +02:00
Fabien Potencier
5ad8c2a630 Merge branch '3.4' into 4.4
* 3.4:
  Fix tests on 5.6
  [Debug] Skip a test that was meant for HHVM.
  [Console] Silence warnings on sapi_windows_cp_set() call
  guard $argv + $token against null, preventing unnecessary exceptions
2020-09-09 07:14:20 +02:00
Fabien Potencier
1df26c20a0 minor #38117 [Debug] Skip a test that was meant for HHVM (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] Skip a test that was meant for HHVM

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

This PR skips a test that fails on php 8. If I read the test correctly, it is meant to run on HHVM, so I assumed it's save to skip it if we're on PHP.

Commits
-------

bf62a4d622 [Debug] Skip a test that was meant for HHVM.
2020-09-09 07:12:18 +02:00
Fabien Potencier
336946a499 Fix tests on 5.6 2020-09-09 07:09:37 +02:00
Fabien Potencier
8a186697dc bug #38116 [Console] Silence warnings on sapi_windows_cp_set() call (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Silence warnings on sapi_windows_cp_set() call

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

Commits
-------

2a57ba5267 [Console] Silence warnings on sapi_windows_cp_set() call
2020-09-09 07:06:23 +02:00
Alexander M. Turek
bf62a4d622 [Debug] Skip a test that was meant for HHVM. 2020-09-09 00:19:14 +02:00
Robin Chalas
2a57ba5267 [Console] Silence warnings on sapi_windows_cp_set() call 2020-09-08 23:46:32 +02:00
Nicolas Grekas
68866fbc9e bug #38114 [Console] guard $argv + $token against null, preventing unnecessary exceptions (bilogic)
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead.

Discussion
----------

[Console] guard $argv + $token against null, preventing unnecessary exceptions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| Tickets       | Fix https://github.com/symfony/symfony/issues/38105
| License       | MIT

This issue was causing an unnecessary exception, leading to difficulty in locating the actual offending code as reported by many cases as detailed in #38105

Commits
-------

dbe335d9be guard $argv + $token against null, preventing unnecessary exceptions
2020-09-08 22:57:49 +02:00
bilogic
dbe335d9be guard $argv + $token against null, preventing unnecessary exceptions 2020-09-08 22:57:41 +02:00