Commit Graph

51947 Commits

Author SHA1 Message Date
Nicolas Grekas
d152131452 minor #38704 Remove branch-version (keep them for contracts only) (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Remove branch-version (keep them for contracts only)

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

As advised by @Seldaek

Commits
-------

f8fe4bf9f5 Remove branch-version (keep them for contracts only)
2020-10-24 13:20:12 +02:00
Nicolas Grekas
f8fe4bf9f5 Remove branch-version (keep them for contracts only) 2020-10-24 12:57:07 +02:00
Nicolas Grekas
4abbb1d6a9 bug #38647 [HttpClient] relax auth bearer format requirements (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] relax auth bearer format requirements

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

Commits
-------

ac20594267 [HttpClient] relax auth bearer format requirements
2020-10-24 11:44:37 +02:00
Christian Flothmann
ac20594267 [HttpClient] relax auth bearer format requirements 2020-10-24 11:44:22 +02:00
Nicolas Grekas
3ebcd3b0ec minor #38702 [PHPUnitBridge] Silence warnings from mkdir() (Nyholm)
This PR was merged into the 4.4 branch.

Discussion
----------

[PHPUnitBridge] Silence warnings from mkdir()

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

When I run `./phpunit` the second time I get a warning thrown at me. I think we could silence this warning. If the directory cannot be created then we will get a similar warning from the `touch()` function.

```
 ./phpunit --exclude-group tty,benchmark,intl-data
#!/usr/bin/env php
PHP Warning:  mkdir(): File exists in /path/to/symfony/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php on line 44
PHP Stack trace:
PHP   1. {main}() /path/to/symfony/phpunit:0
PHP   2. require() /path/to/symfony/phpunit:31
PHP   3. require() /path/to/symfony/vendor/symfony/phpunit-bridge/bin/simple-phpunit:13
PHP   4. include() /path/to/symfony/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php:411
PHP   5. PHPUnit\TextUI\Command::main($exit = *uninitialized*) /path/to/symfony/.phpunit/phpunit-9.4-0/phpunit:22
PHP   6. Symfony\Bridge\PhpUnit\Legacy\CommandForV9->run($argv = *uninitialized*, $exit = *uninitialized*) /path/to/symfony/.phpunit/phpunit-9.4-0/src/TextUI/Command.php:101
PHP   7. Symfony\Bridge\PhpUnit\Legacy\CommandForV9->handleArguments($argv = *uninitialized*) /path/to/symfony/.phpunit/phpunit-9.4-0/src/TextUI/Command.php:116
PHP   8. PHPUnit\TextUI\XmlConfiguration\TestSuiteMapper->map($configuration = *uninitialized*, $filter = *uninitialized*) /U
```

Commits
-------

f3976ee5d8 [PHPUnitBridge] Silence errors from mkdir()
2020-10-24 11:35:09 +02:00
Nicolas Grekas
f517cf1174 minor #38703 [HttpClient] Adding missing dependency for dev (Nyholm)
This PR was merged into the 5.x branch.

Discussion
----------

[HttpClient] Adding missing dependency for dev

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

This will make sure Travis is happy again.

Commits
-------

552e704d6c [HttpClient] Adding missing dependency for dev
2020-10-24 11:30:32 +02:00
Nyholm
f3976ee5d8
[PHPUnitBridge] Silence errors from mkdir() 2020-10-24 10:20:26 +02:00
Nyholm
552e704d6c
[HttpClient] Adding missing dependency for dev 2020-10-24 10:12:34 +02:00
Robin Chalas
1c81aa72a6 bug #38675 [RateLimiter] Rename RateLimiter to RateLimiterFactory (Nyholm)
This PR was squashed before being merged into the 5.x branch.

Discussion
----------

[RateLimiter] Rename RateLimiter to RateLimiterFactory

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | No, not released yet
| Tickets       |
| License       | MIT
| Doc PR        | should be added

Sorry for making a few BC breaks.

@wouterj [said](https://github.com/symfony/symfony/pull/38562#issue-503193238) that this class was suggested to be named `LimiterFactory` before. But that was rejected.

Just my looking at the names of the classes we currently have:
- Rate
- RateLimit
- RateLimiter

I find it hard to know what these are doing and the difference between them. Note that none of them are used as a rate limiter (ie implements `LimiterInterface`)

I would like to be clear that a `RateLimiterFactory` is used to create an object implementing `LimiterInterface`.

Commits
-------

8be261b300 [RateLimiter] Rename RateLimiter to RateLimiterFactory
2020-10-24 10:11:08 +02:00
Nyholm
8be261b300 [RateLimiter] Rename RateLimiter to RateLimiterFactory 2020-10-24 10:10:52 +02:00
Fabien Potencier
d1c57399f8 minor #38691 [Notifier] Add missing upgrade entries and fixed changelog (jschaedl)
This PR was merged into the 5.x branch.

Discussion
----------

[Notifier] Add missing upgrade entries and fixed changelog

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| 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        | <!-- 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 5.x.
-->

Follow-up of https://github.com/symfony/symfony/pull/35773

Commits
-------

c6b32cdbd2 add missing upgrade entries and fixed changelog
2020-10-24 04:56:21 +02:00
Fabien Potencier
bfa396d6bf bug #38699 [DependencyInjection] Preload classes with union types correctly (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Preload classes with union types correctly

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

Commits
-------

a7b0f16a56 [DependencyInjection] Preload classes with union types correctly.
2020-10-24 04:48:21 +02:00
Alexander M. Turek
a7b0f16a56 [DependencyInjection] Preload classes with union types correctly. 2020-10-23 19:57:28 +02:00
Jan Schädlich
c6b32cdbd2 add missing upgrade entries and fixed changelog 2020-10-23 15:33:06 +02:00
Fabien Potencier
1280e5306a feature #38688 [HttpClient] Add a Stopwatch on TraceableHttpClient (jderusse)
This PR was merged into the 5.x branch.

Discussion
----------

[HttpClient] Add a Stopwatch on TraceableHttpClient

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

I used this code to generate the screenshot below.
```php
$response = $client->request('GET', 'https://httpstat.us/200');
$response->getContent();

$responses[] = $client->request('GET', 'https://httpstat.us/200?sleep=300');
$responses[] = $client->request('GET', 'https://httpstat.us/200?sleep=100');
foreach ($client->stream($responses) as $chunk) {
}
```
![Screenshot from 2020-10-23 02-04-43](https://user-images.githubusercontent.com/578547/96942031-41883580-14d4-11eb-848e-fd21d2f4fec9.png)

Commits
-------

e6f6b4cb4c Add Stopwatch on TraceableClient
2020-10-23 13:07:30 +02:00
Jérémy Derussé
e6f6b4cb4c
Add Stopwatch on TraceableClient 2020-10-23 12:06:36 +02:00
Fabien Potencier
85e8de6137 bug #38669 [Serializer] fix decoding float XML attributes starting with 0 (Marcin Kruk)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Serializer] fix decoding float XML attributes starting with 0

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

This is a naive approach to fix #38666, assuming it is something worth fixing.

I checked different cases and it seems to be fixing all of them, but I bet there will be some other edge cases which still won't be covered properly.

Commits
-------

97b4306c30 [Serializer] fix decoding float XML attributes starting with 0
2020-10-23 06:26:46 +02:00
Marcin Kruk
97b4306c30 [Serializer] fix decoding float XML attributes starting with 0 2020-10-23 06:26:38 +02:00
Fabien Potencier
9bfd3ee66e bug #38680 [PhpUnitBridge] Support new expect methods in test case polyfill (alcaeus)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Support new expect methods in test case polyfill

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT

This PR adds the `expectError`, `expectWarning`, `expectNotice`, ~and `expectDeprecation`~ methods to the test case polyfill.

~Note that I saw a `expectDeprecation` message in `ExpectDeprecationTrait`, but I couldn't quite figure out what it's supposed to do. Please let me know if the `expectDeprecation` method needs to be removed from the test polyfill.~

Commits
-------

8a49a263a2 Add expectDeprecation, expectNotice, expectWarning, and expectError to TestCase polyfill
2020-10-23 06:24:01 +02:00
Fabien Potencier
49182e1eeb bug #38681 [PHPUnitBridge] Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait (alcaeus)
This PR was merged into the 4.4 branch.

Discussion
----------

[PHPUnitBridge] Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | not really
| New feature?  | yes
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT

This expands the compatibility layer for PHPUnit constraints by supporting PHPUnit 8 and PHPUnit 9. Support for the latter requires also adding the `evaluate` method to the trait, as this method gets a signature change in PHPUnit 9.

Commits
-------

f79ad80009 Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait
2020-10-23 06:19:51 +02:00
Fabien Potencier
a623492aab bug #38686 [TwigBridge] Remove "transchoice" from the code base (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[TwigBridge] Remove "transchoice" from the code base

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

Commits
-------

713c2623e5 [TwigBridge] Remove "transchoice" from the code base
2020-10-23 06:15:15 +02:00
Fabien Potencier
81d29f3fd0 minor #38687 [Validator] adds missing dutch translations to validator component (zghosts)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] adds missing dutch translations to validator component

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT
[Validator] This PR adds some missing dutch translations to the validator component

Commits
-------

02a8ca39f4 add missing dutch translations
2020-10-23 06:12:28 +02:00
Jos Elstgeest
02a8ca39f4 add missing dutch translations 2020-10-22 22:50:11 +02:00
Nicolas Grekas
713c2623e5 [TwigBridge] Remove "transchoice" from the code base 2020-10-22 20:37:20 +02:00
Nyholm
76c22fab02
bug #38661 [RateLimiter] Fix delete method of the cache storage (GregOriol, Nyholm)
This PR was merged into the 5.x branch.

Discussion
----------

[RateLimiter] Fix delete method of the cache storage

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | None
| License       | MIT

This PR fixes a small issue with RateLimiter's cache storage and the delete method: all getItems are called with a sha1 of the id, but not the one for delete, which makes it miss the deletion.

Commits
-------

b61d9d1ea3 minor
88c1e2439e Added a test
fb540bba73 Fix delete method on RateLimiter's cache storage
2020-10-22 19:09:06 +02:00
Nyholm
310926fa88
bug #38678 [String] fix before/after[Last]() returning the empty string instead of the original one on non-match (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[String] fix before/after[Last]() returning the empty string instead of the original one on non-match

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

The current behavior is the least useful one. Returning the original string when no match is found is the most sensible behavior. It saves code instead of requiring more.

Typical example is when removing a potential suffix:
`$bar = $foo->beforeLast(['.svg', '.png']);` should remove any of these extensions if found, and return the original string otherwise.

Commits
-------

22a2740888 [String] fix before/after[Last]() returning the empty string instead of the original one on non-match
2020-10-22 19:01:40 +02:00
Nyholm
6f0a8971fd
bug #38682 [HttpClient] never trace content of event-stream responses (nicolas-grekas)
This PR was merged into the 5.x branch.

Discussion
----------

[HttpClient] never trace content of event-stream responses

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

Let's leverage #38587 in `EventSourceHttpClient`

Commits
-------

e4c0262dc1 [HttpClient] never trace content of event-stream responses
2020-10-22 18:54:44 +02:00
Fabien Potencier
5c98c75170 minor #38673 [Validator] Add missing romanian translations (marmichalski)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Add missing romanian translations

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

This PR adds missing romanian validator translations.

Commits
-------

ced43e1ec2 [Validator] Add missing romanian translations
2020-10-22 15:52:29 +02:00
Alexander M. Turek
e5faa29c5e bug #38679 [PhpUnitBridge] Add missing exporter function for PHPUnit 7 (alcaeus)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Add missing exporter function for PHPUnit 7

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

This adds a missing `exporter` function to the compatibility trait for PHPUnit constraints. This method is still required for PhpUnit 7.

Commits
-------

52e7d78dca Add missing exporter function for PHPUnit 7
2020-10-22 15:51:15 +02:00
Nicolas Grekas
e4c0262dc1 [HttpClient] never trace content of event-stream responses 2020-10-22 15:42:02 +02:00
Andreas Braun
f79ad80009
Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait 2020-10-22 14:29:45 +02:00
Andreas Braun
8a49a263a2
Add expectDeprecation, expectNotice, expectWarning, and expectError to TestCase polyfill 2020-10-22 14:28:16 +02:00
Nicolas Grekas
e2f0454f13 [PhpUnitBridge] remove wrong changelog entry 2020-10-22 14:27:47 +02:00
Nicolas Grekas
22a2740888 [String] fix before/after[Last]() returning the empty string instead of the original one on non-match 2020-10-22 14:08:44 +02:00
Andreas Braun
52e7d78dca
Add missing exporter function for PHPUnit 7 2020-10-22 14:02:19 +02:00
Nyholm
b61d9d1ea3
minor 2020-10-22 12:14:59 +02:00
Nyholm
88c1e2439e
Added a test 2020-10-22 12:12:23 +02:00
Wouter de Jong
e1825e0bcc bug #38674 [RateLimiter] Make sure we actually can use sliding_window and no_limit (Nyholm)
This PR was merged into the 5.x branch.

Discussion
----------

[RateLimiter] Make sure we actually can use sliding_window and no_limit

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

I found that we never tested the config on the actually RateLimiter class. This PR adds a tests and bugfix

Commits
-------

067153f452 Make sure we actually can use sliding_window and no_limit
2020-10-22 12:10:29 +02:00
Nyholm
067153f452
Make sure we actually can use sliding_window and no_limit 2020-10-22 11:54:30 +02:00
Greg ORIOL
fb540bba73
Fix delete method on RateLimiter's cache storage 2020-10-22 11:48:25 +02:00
Robin Chalas
753932527e bug #38670 [RateLimiter] Be more type safe when fetching from cache (Nyholm)
This PR was merged into the 5.x branch.

Discussion
----------

[RateLimiter] Be more type safe when fetching from cache

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

This is a super minor thing. A `$cacheItem` can be a hit, but it does not contain a `LimiterStateInterface`.

Also, PSR-6 specifies that if the `$cacheItem` is not a hit, it must return null.

Commits
-------

4795756cc7 [RateLimiter] Be more type safe when fetching form cache
2020-10-22 10:40:20 +02:00
Robin Chalas
58f4e9dfc8 bug #38665 [RateLimiter] Allow configuration value "no_limit" (Nyholm)
This PR was squashed before being merged into the 5.x branch.

Discussion
----------

[RateLimiter] Allow configuration value "no_limit"

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | maybe?
| New feature?  | not sure
| Deprecations? |
| Tickets       |
| License       | MIT
| Doc PR        |

I dont see any reason why we should allow people to configure "no_limit". I assume this was just forgotten.

Commits
-------

2b9058d6b6 [RateLimiter] Allow configuration value "no_limit"
2020-10-22 10:35:38 +02:00
Nyholm
2b9058d6b6 [RateLimiter] Allow configuration value "no_limit" 2020-10-22 10:35:15 +02:00
Robin Chalas
6bb46dedca minor #38668 [RateLimiter] Remove Window::sleep() (Nyholm)
This PR was merged into the 5.x branch.

Discussion
----------

[RateLimiter] Remove Window::sleep()

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

This function is not needed since #38562

Commits
-------

ccbf7d5a06 [RateLimiter] Remove Window::sleep()
2020-10-22 10:31:04 +02:00
Robin Chalas
898ca2b0af minor #38667 [RateLimiter] Adding annotations (Nyholm)
This PR was squashed before being merged into the 5.x branch.

Discussion
----------

[RateLimiter] Adding annotations

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

Following the example of the `SlidingWindow`'s PR reviews, I would like to add annotations for all properties. This makes it simpler to read the code and understand what is what.

Commits
-------

5dfafd334e [RateLimiter] Adding annotations
2020-10-22 10:28:03 +02:00
Nyholm
5dfafd334e [RateLimiter] Adding annotations 2020-10-22 10:25:47 +02:00
Marcin Michalski
ced43e1ec2 [Validator] Add missing romanian translations 2020-10-22 08:30:04 +02:00
Nyholm
4795756cc7
[RateLimiter] Be more type safe when fetching form cache 2020-10-21 23:51:48 +02:00
Nyholm
ccbf7d5a06
[RateLimiter] Remove Window::sleep() 2020-10-21 23:43:19 +02:00
Alexander M. Turek
29684ac38c bug #38659 [String] fix slicing in UnicodeString (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[String] fix slicing in UnicodeString

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

Spotted while reviewing https://github.com/symfony/polyfill/pull/297

Commits
-------

d31ac74c03 [String] fix slicing in UnicodeString
2020-10-21 16:55:37 +02:00