This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
Remove some magic from TypeValidator logic and OptionsResolver type verify logic
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| License | MIT
Following discussion on https://twitter.com/Ocramius/status/1260236117129015297
The changes in this PR could ensure that types that can be verified by the TypeValidator is limited and there is no way to magically use it.
For example you can break it by defining you own function like:
```php
function is_usercollection {
return true;
}
```
that will validate any value that have the validator type as 'UserCollection'.
Another example would be defining `is_lower` or `ctype_int` that would also break the implementation.
Commits
-------
e8c9049a5a Remove some magic from TypeValidator logic and OptionsResolver type verify logic
* 5.1:
[Cache] Use the default expiry when saving (not when creating) items
Fix typo
Fix DBAL deprecation
[Form] Fix ChoiceType translation domain
Add Tagalog translations for new form messages
[Form] Add missing vietnamese translations
sync translations from master
[OptionsResolver] Fix force prepend normalizer
add vietnamese translation for html5 color validation
* 5.0:
[Cache] Use the default expiry when saving (not when creating) items
Fix typo
Fix DBAL deprecation
[Form] Fix ChoiceType translation domain
Add Tagalog translations for new form messages
[Form] Add missing vietnamese translations
sync translations from master
[OptionsResolver] Fix force prepend normalizer
add vietnamese translation for html5 color validation
* 4.4:
[Cache] Use the default expiry when saving (not when creating) items
Fix typo
Fix DBAL deprecation
[Form] Fix ChoiceType translation domain
Add Tagalog translations for new form messages
[Form] Add missing vietnamese translations
sync translations from master
[OptionsResolver] Fix force prepend normalizer
add vietnamese translation for html5 color validation
This PR was merged into the 3.4 branch.
Discussion
----------
[Cache] Use the default expiry when saving (not when creating) items
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37263
| License | MIT
| Doc PR |
This PR is for align expiration handling in ChainAdapter with ChainCache as proposed in #37263.
Commits
-------
49e9f3229c [Cache] Use the default expiry when saving (not when creating) items
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[Form] Fix ChoiceType translation domain
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? |no
| Tickets | Fix #...
| License | MIT
| Doc PR | symfony/symfony-docs#...
When using
```
->add('foo', ChoiceType::class, [
'label' => 'label',
'translation_domain' => false,
'choices' => [
'choice.no' => false,
'choice.yes' => true,
],
'choice_translation_domain' => 'messages',
'expanded' => true,
'required' => false,
'placeholder' => false,
]);
```
I discovered that the choices was not translated.
Seems like it's because the subForm is using the `translation_domain` instead of the `choice_translation_domain`.
Commits
-------
2effda79ea [Form] Fix ChoiceType translation domain
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] sync translations from master
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
acea9be6d3 sync translations from master
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
Add Tagalog translations for new form messages
| 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 |
| License | MIT
| Doc PR |
This PR adds Tagalog translations for the new form messages @xabbuh added in https://github.com/symfony/symfony/pull/37552.
~~As I'm not aware of any Filipinos that regularly review Symfony pull requests, I'm going to ask my mother to proof-read this first before I remove the "WIP" label from the title. :)~~
Commits
-------
1809b7c5eb Add Tagalog translations for new form messages
This PR was merged into the 5.2-dev branch.
Discussion
----------
[Mime] allow non-ASCII characters in local part of email
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/34932
| License | MIT
| Doc PR | -
This fixes https://github.com/symfony/symfony/issues/34932 by allowing non-ASCII characters in the local part of emails.
I tried this using 3 different smtp servers (gmail, mailgun and local postfix) and for me this just works in case there are non-ASCII characters in the local part of emails. Emails are correctly delivered.
PHPMailer does this in the same way: https://github.com/PHPMailer/PHPMailer/blob/master/src/PHPMailer.php#L1411
This is also in line with the behavior of Swiftmailer (< 6.1) **before** this commit that introduced the `IdnAddressEncoder`: 6a87efd39b (diff-e5f85d26733017e183b2633ae3c433f0R31)
I'm not an expert when it comes to SMTP and all the different RFCs out there 😕 But for me this exception seems not needed.
Maybe @c960657 can help here?
Commits
-------
d057dffcd6 [Mime] allow non-ASCII characters in local part of email
* 5.1:
cs fix
add german translation of the html5 color validation
Fix PHP 8 deprecations
ensure compatibility with PHP 8 stack traces
clean up HHVM instructions
sync translations from master branch
silently ignore uninitialized properties when mapping data to forms
* 5.0:
cs fix
add german translation of the html5 color validation
Fix PHP 8 deprecations
ensure compatibility with PHP 8 stack traces
clean up HHVM instructions
sync translations from master branch
silently ignore uninitialized properties when mapping data to forms
* 4.4:
cs fix
add german translation of the html5 color validation
Fix PHP 8 deprecations
ensure compatibility with PHP 8 stack traces
clean up HHVM instructions
sync translations from master branch
silently ignore uninitialized properties when mapping data to forms
* 3.4:
cs fix
add german translation of the html5 color validation
sync translations from master branch
silently ignore uninitialized properties when mapping data to forms
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] silently ignore uninitialized properties when mapping data to forms
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #36492
| License | MIT
| Doc PR |
Commits
-------
b4616c810c silently ignore uninitialized properties when mapping data to forms
A public method declared in a trait can be used by a class without
importing the trait itself when the trait is already imported by one
of the parent classes from the inheritance chain.
This PR was squashed before being merged into the 5.1 branch.
Discussion
----------
[PhpUnitBridge] Fix expectDeprecation() in isolation
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Tests like
```
/**
* Do not remove this test in the next major version.
*
* @group legacy
* @runInSeparateProcess
*/
public function testOneInIsolation()
{
$this->expectDeprecation('foo');
@trigger_error('foo', E_USER_DEPRECATED);
}
```
will fail due to:
```
Testing Symfony\Bridge\PhpUnit\Tests\ExpectDeprecationTraitTest
R 1 / 1 (100%)R
Time: 111 ms, Memory: 6.00 MB
There were 2 risky tests:
1) Symfony\Bridge\PhpUnit\Tests\ExpectDeprecationTraitTest::testOneInIsolation
This test did not perform any assertions
/Users/alex/dev/symfony/src/Symfony/Bridge/PhpUnit/Tests/ExpectDeprecationTraitTest.php:38
2) Symfony\Bridge\PhpUnit\Tests\ExpectDeprecationTraitTest::testOneInIsolation
This test did not perform any assertions
OK, but incomplete, skipped, or risky tests!
Tests: 1, Assertions: 0, Risky: 2.
```
Commits
-------
e7e2ee75d3 Expect deprecations in isolation
* 5.1:
[String] Added a help message when translation-contracts is not installed
Add: ExcludeList usage for PHPUnit 9.4
[Cache] Fix compat wth DBAL v3
[String] throw when Alpine is used and translit fails
* 5.0:
[String] Added a help message when translation-contracts is not installed
Add: ExcludeList usage for PHPUnit 9.4
[Cache] Fix compat wth DBAL v3
[String] throw when Alpine is used and translit fails
This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
[ErrorHandler] Allow override of the default non-debug template
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes - a very tiny one
| Deprecations? | no
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Add new feature to allow the default hardcoded non-debug template to be overridden when `symfony/error-handler`used as a component in other projects.
Currently, when used as a component, its not possible (that I could see) to override the standard default template of `views/error.html.php` therefore the look and feel, and text is hard coded. There is much written on how to customise the error pages when using the full symfony stack, but not when using individual `symfony/error-handler` component on its own.
This PR is related to the use of `symfony/error-handler` as a component in other projects - specifically the Joomla Content Management System, where, in non debug mode, a generic template **needs to be translatable, and customisable** even though most of the time when the error occurs will bt at boot time and not much available to it. https://github.com/joomla/joomla-cms/issues/29968
This PR allows the use of code such as
```php
<?php
require 'vendor/autoload.php';
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
ErrorHandler::register();
HtmlErrorRenderer::setTemplate('/path/to/custom/mine.php');
throw new Exception('myException is this', 500);
```
and then for further customisation of the "look and feel" to be done in `mine.php`
Due to the unique way the error handler component is init'ed, the use of static calls has been employed rather than any DI approach, I hope this is ok.
Commits
-------
6e1d16b44d [ErrorHandler] Allow override of the default non-debug template
* 5.1:
minor #37121 [Contracts] Add missing "extra.thanks" entries in composer.json (nicolas-grekas)
[Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows
fix handling null as empty data
[Security\Http] Skip remember-me logout on empty token
Missing return in loadValuesForChoices method
No need to create an issue when creating a PR
Use ">=" for the "php" requirement
[HttpClient] Fix promise behavior in HttplugClient
[Console] Fixes question input encoding on Windows
* 5.0:
minor #37121 [Contracts] Add missing "extra.thanks" entries in composer.json (nicolas-grekas)
[Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows
fix handling null as empty data
No need to create an issue when creating a PR
Use ">=" for the "php" requirement
[HttpClient] Fix promise behavior in HttplugClient
[Console] Fixes question input encoding on Windows
* 4.4:
minor #37121 [Contracts] Add missing "extra.thanks" entries in composer.json (nicolas-grekas)
[Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows
fix handling null as empty data
No need to create an issue when creating a PR
[Console] Fixes question input encoding on Windows
This PR was merged into the 5.2-dev branch.
Discussion
----------
[Contracts] Add missing "extra.thanks" entries in composer.json
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Something we forgot and that might help give some more visibility to symfony/contracts.
Commits
-------
bd04f0cce6 [Contracts] Add missing "extra.thanks" entries in composer.json
* 3.4:
[Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows
fix handling null as empty data
No need to create an issue when creating a PR
[Console] Fixes question input encoding on Windows
This PR was merged into the 3.4 branch.
Discussion
----------
[Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? |no
| Deprecations? | no
| Tickets | Fix#37294
| License | MIT
| Doc PR |
Passes current Process unit tests.
On Windows systems, a new set of sf_proc_## files are generated in the system temp directory for each WindowsPipes object. These files are removed when the WindowsPipes object is destroyed.
This avoids receiving a permission denied error when attempting to write to sf_proc_## files between multiple sites running as different users, when the users do not have permissions to modify each others files.
Changes
- [Process] WindowsPipes always creates new sf_proc_## files in constructor
- [Process] WindowsPipes removes its sf_proc_## files in destructor
Commits
-------
220be89f5c [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] fix handling null as empty data
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37493
| License | MIT
| Doc PR |
Commits
-------
b5aa55dab9 fix handling null as empty data
This PR was merged into the 3.4 branch.
Discussion
----------
[Console] Fixes question input encoding on Windows
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#35842, Fix#36324, Fix#37495 and Fix#37278 <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | no <!-- 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.
-->
To ask a question to a user, the [QuestionHelper](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Helper/QuestionHelper.php) use [`fgets`](https://www.php.net/manual/en/function.fgets.php). However, special characters are not supported on Windows with this function (like accents: `é`, `à`, `ö`). The solution is to set a special encoding with [`sapi_windows_cp_get`](https://www.php.net/manual/en/function.sapi-windows-cp-get).
> Before
```php
$stream = fopen('php://stdin', 'r');
$input = fgets($stream);
echo $input;
// input: "Bonjour à tous"
// output: 'Bonjour \ tous" or "Bonjour tous"
```
> After
```php
// Check if the function exists because it only exists on Windows
if(function_exists('sapi_windows_cp_set')) {
sapi_windows_cp_get(437);
}
$stream = fopen('php://stdin', 'r');
$input = fgets($stream);
echo $input;
// input: "Bonjour à tous"
// output: 'Bonjour à tous"
```
*Thanks to @bnjmnfnk for the solution 😉*
Commits
-------
4288df4f74 [Console] Fixes question input encoding on Windows
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[HttpClient] Fix promise behavior in HttplugClient
| Q | A
| ------------- | ---
| Branch? | 4.4 & up <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#37488 <!-- 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.
-->
## The Problem
Promises have 2 important methods: `then` and `wait`.
To implement Httplug's promise interface, we built `HttplugPromise` on top of Guzzle promise.
However, when an error occurred (Httplug `NetworkException` thrown) while init the request/before actually sending the request,
`HttplugClient::sendAsyncRequest` will return a `Http\Promise\RejectedPromise`, which is a dummy implementation.
If the `then` callable returns a promise-like object, `Http\Promise\RejectedPromise` will treat it as plain value.
Guzzle promise will try to resolve the promise-like value, which is an object that has `then` method on it.
bbf3b200bc/src/Promise.php (L116)
To fix this, I edited `src/Symfony/Component/HttpClient/HttplugClient.php`.
Next, let me explain why to edit `src/Symfony/Component/HttpClient/Response/HttplugPromise.php`.
After the previous fix, when a Guzzle promise returned by the `then` callable, things will work.
However, If I return a `HttplugPromiseInterface`, it doesn't work, because Guzzle promise `wait` the return value (result)
only if it's a Guzzle promise.
bbf3b200bc/src/Promise.php (L63)
To fix this, I referenced the `wait` code of Guzzle promise and edited our `HttplugPromise`.
## How this fix make sense
So, why to return a promise from the `then` callable?
This let us change the promise chain according to current promise's result (fulfilled/rejected).
For example, we can retry an HTTP request if it failed.
Please take a look at my test code.
Commits
-------
147b6adc39 [HttpClient] Fix promise behavior in HttplugClient
* 5.1:
[HttpClient][CurlHttpClient] Fix http_version option usage
[HttpClient] fix parsing response headers in CurlResponse
[PropertyAccess] Remove inflector component
[Console] Do not check for "stty" using "exec" if that function is disabled
[Console] always use stty when possible to ask hidden questions
* 5.0:
[HttpClient][CurlHttpClient] Fix http_version option usage
[HttpClient] fix parsing response headers in CurlResponse
[Console] Do not check for "stty" using "exec" if that function is disabled
[Console] always use stty when possible to ask hidden questions
* 4.4:
[HttpClient][CurlHttpClient] Fix http_version option usage
[HttpClient] fix parsing response headers in CurlResponse
[Console] Do not check for "stty" using "exec" if that function is disabled
[Console] always use stty when possible to ask hidden questions
This PR was merged into the 4.4 branch.
Discussion
----------
[Console] always use stty when possible to ask hidden questions
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#36565, replaces #36590
| License | MIT
| Doc PR | -
The current code doesn't make much sense: we check `hasSttyAvailable()`, and if the answer is `false`, we still use `stty` directly.
This PR relies on `stream_isatty` and equivalent fallback checks to decide if the password can be hidden or not.
Best reviewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/37469/files?w=1).
Commits
-------
055b605e30 [Console] always use stty when possible to ask hidden questions
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] fix parsing response headers in CurlResponse
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This fixes rare notices that look like:
`Argument 2 passed to Symfony\Component\HttpClient\Chunk\DataChunk::__construct() must be of the type string, null given`
I'm unable to provide a test case since I'm unable to provide a simple reproducer.
It happens that curl can call the header-function with multiple lines at once apparently, while most of the time it does so with one at a time.
Commits
-------
eb70fb2f26 [HttpClient] fix parsing response headers in CurlResponse
This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
[Workflow] Added Function (and Twig extension) to retrieve a specific transition
You can now easily retrieve a specific transition. Useful when you want the metadata of a specific transition.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | hmmmm, should I create a ticket first ?
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/13907
I needed to get the metadata of a transition, but in order to do that, you need the transition object. So here is a PR to easily get the transition object
Commits
-------
0eebe74259 [Workflow] Added Function (and Twig extension) to retrieve a specific transition
This PR was merged into the 5.2-dev branch.
Discussion
----------
[HttpClient] Add MockResponse::getRequestMethod() and getRequestUrl() to allow inspecting which request has been sent
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes <!-- 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.
-->
---
As same as the `MockResponse` class has `getRequestOptions()` when doing a request; I've added:
* `getRequestUrl()` - returns the URL used when doing the request
* `getRequestMethod()` - returns the HTTP method used when doing the request
With these two getters, we would be able to assert that the method and URL passed to the `HttpClient` were well generated. I've tried to assert the URL generated in a unit test of a class with a `SymfonyHttpClient` injected and it wasn't possible. Calling `$mock->getInfo('url')` returns `null`.
Example, if we have a class with `HttpClientInterface` injected like this:
```php
final class SymfonyHttpUserClient
{
private HttpClientInterface $httpClient;
private string $baseUri;
public function __construct(
HttpClientInterface $httpClient,
string $baseUri
) {
$this->httpClient = $httpClient;
$this->baseUri = $baseUri;
}
public function getById(string $userId): void
{
$this->httpClient->request(
'GET',
$this->baseUri . $customerId
);
}
}
```
And if we want to do a unit test of `SymfonyHttpUserClient` right now we are not able to check if the URL of the request was well-formed passing a `MockResponse`. Also, we weren't able to assert the HTTP method (maybe this piece is not so critical to assert in the unit test).
```php
class SymfonyHttpUserClientTests extends TestCase
{
public function testGetById(): void
{
$baseUri = 'https://user-api.test/api/v1/users/';
$mockResponse = new MockResponse();
$symfonyHttpUserClient = new SymfonyHttpUserClient(
new MockHttpClient(
[$mockResponse],
$baseUri
),
$baseUri
);
// test get by id:
$symfonyHttpUserClient->getById('some-user-id');
// cannot be asserted right now:
$this->assertSame($mockResponse->getInfo('url'), $baseUri . 'some-user-id'); // fail
$this->assertSame($mockResponse->getInfo('http_method'), 'GET'); // fail
// it could be with the new getters:
$this->assertSame($mockResponse->getRequestUrl(), $baseUri . 'some-user-id');
$this->assertSame($mockResponse->getRequestMethod(), 'GET');
}
}
```
This only happens if the class has injected the HttpClient and if it is used inside void methods with no being able to return the response. If the class returns the response, `url` and `http_method` are available with `$response->getInfo()` call. But this response object is a new one, is not the mock passed by argument when you instance the MockHttpClient.
Var dumps of `getInfo` array:
```
$response->getInfo() from MockClient:
..array(10) {
["start_time"]=>
float(1587109014.7985)
["user_data"]=>
NULL
["http_code"]=>
int(200)
["response_headers"]=>
array(0) {
}
["error"]=>
NULL
["canceled"]=>
bool(false)
["redirect_count"]=>
int(0)
["redirect_url"]=>
NULL
["http_method"]=>
string(3) "GET"
["url"]=>
string(47) "https://user-api.test/api/v1/users/some-user-id"
}
$mock->getInfo()
array(4) {
["http_code"]=>
int(200)
["response_headers"]=>
array(0) {
}
["error"]=>
NULL
["canceled"]=>
bool(false)
}
```
This is a minor change, I opened the PR with `4.4` as base branch; but not sure if it should be opened with `5.0` as base branch or even `master` taking account is a feature (add two new getters in MockResponse class). Let me know if I didn't follow right the instructions (first PR on Symfony project 😃)
Thanks!
Commits
-------
7a250d80c1 [HttpClient] Add MockResponse::getRequestMethod() and getRequestUrl() to allow inspecting which request has been sent
This PR was merged into the 5.2-dev branch.
Discussion
----------
Move event alias mappings to their components
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
For a small console tool, I wanted to use the Console, EventDispatcher and DI components standalone. In order to make use of aliased events, I had to copy over the mapping information from FrameworkBundle, which was a bit unfortunate.
With this PR, I'd like to suggest to store all alias mappings on the `*Events` classes of each component instead. This change will make the mapping reusable outside of the full-stack framework.
Note: I've bumped the dependencies of FrameworkBundle/SercurityBundle in order to gain access to the moved mapping information. If any of the bumps is too heavy, please tell me and I'll implement a fallback instead.
Commits
-------
28e6f6f72c Move event alias mappings to their components.
* 5.1:
[ErrorHandler] fix throwing from __toString()
Removed comments and requirements relative to php <5.5 (not supported anymore)
Fix caching of parent locales file in translator
fix validating lazy properties that evaluate to null
* 5.0:
[ErrorHandler] fix throwing from __toString()
Removed comments and requirements relative to php <5.5 (not supported anymore)
Fix caching of parent locales file in translator
fix validating lazy properties that evaluate to null
* 4.4:
[ErrorHandler] fix throwing from __toString()
Removed comments and requirements relative to php <5.5 (not supported anymore)
Fix caching of parent locales file in translator
fix validating lazy properties that evaluate to null
This PR was merged into the 4.4 branch.
Discussion
----------
[Translation] Fix caching of parent locales file in translator
| Q | A
| ------------- | ---
| Branch? | 4.4 (this is the lowest maintained branch with this code)
| 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 |
The `parentLocales` property was probably meant as a cache for the content of the `parents.json` file but instead the content is stored in a local variable and the property stays `null`. This means the file is read on each call to `computeFallbackLocales`.
This PR update the code to what was probably meant to be.
(Ref https://github.com/symfony/symfony/pull/28070)
Commits
-------
02c9ac68a4 Fix caching of parent locales file in translator
This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
Console ProgressBar: Change redraw default value to 25fps
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
`ProgressBar` has a default value of `0.1` for `$minSecondsBetweenRedraws` which works out to 10 fps, so below the threshhold at which the human eye perceives it as a moving image instead of a series of individual images. Of course, the console's progress bar is not really an animation tool, but it seems like a low-hanging fruit to change the redraw frequency to something that can be perceived as a fluid motion. So I'm proposing to change `$minSecondsBetweenRedraws` to `0.016666666666667`, i.e. 60 fps, which is a fairly typical refresh rate for computer screens, so redrawing more often than that would be pointless. It means of course to redraw six times more often than currently, but i guess performance is not such a big concern here, right?
Commits
-------
b1c38bada7 Console ProgressBar: Change redraw default value to 25fps
This PR was merged into the 4.4 branch.
Discussion
----------
[Mime] skip test if guesser is not supported
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
fixes tests on AppVeyor
Commits
-------
3b77abea65 skip test if guesser is not supported
This PR was merged into the 5.1 branch.
Discussion
----------
[Security] Added missing license headers
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
See 3be6ce121b
Seems like the fabbot reviews (and I) missed quite a lot of these in my big security PR.
Commits
-------
ea81b61e5f Added missing license headers
* 5.1:
Fix test that fails on old distros
Fix: compatibility with phpunit 9.3
[DoctrineBridge] work around Connection::ping() deprecation
[MimeType] Duplicated MimeType due to PHP Bug
[HttpClient] fix casting TraceableResponse to php streams
[DI] fix parsing of argument type=binary in xml
fix guessing form types for DateTime types
fix handling typed properties as constraint options
Fix the 'supports' method argument type of the security voter
Use the driverConnection executeUpdate method
This PR was merged into the 5.1 branch.
Discussion
----------
[HttpClient] fix casting TraceableResponse to php streams
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37393
| License | MIT
| Doc PR | -
We'd better replace these checks by an `instanceof` one, but that'd be for master.
Commits
-------
5733289278 [HttpClient] fix casting TraceableResponse to php streams
* 5.0:
Fix test that fails on old distros
Fix: compatibility with phpunit 9.3
[DoctrineBridge] work around Connection::ping() deprecation
[MimeType] Duplicated MimeType due to PHP Bug
[DI] fix parsing of argument type=binary in xml
fix guessing form types for DateTime types
fix handling typed properties as constraint options
Fix the 'supports' method argument type of the security voter
Use the driverConnection executeUpdate method
* 4.4:
Fix test that fails on old distros
Fix: compatibility with phpunit 9.3
[DoctrineBridge] work around Connection::ping() deprecation
[MimeType] Duplicated MimeType due to PHP Bug
[DI] fix parsing of argument type=binary in xml
fix guessing form types for DateTime types
fix handling typed properties as constraint options
Use the driverConnection executeUpdate method
This PR was merged into the 4.4 branch.
Discussion
----------
[PhpUnitBridge] Fix compatibility with phpunit 9.3
| Q | A
| ------------- | ---
| Branch? | master for features / 4.4 <!-- see below -->
| Bug fix? | yes
| 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 -->
In PHPUnit 9.3 some Classes were moved or renamed, to make the PhpunitBridge compatible with PhpUnit 9.3 it necessary to call the new Loader instead of the Registry.
<!--
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
-------
de71a12f3b Fix: compatibility with phpunit 9.3
This PR was merged into the 4.4 branch.
Discussion
----------
[DoctrineBridge] work around Connection::ping() deprecation
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Follows e603a2e233
Commits
-------
9ccf043c7c [DoctrineBridge] work around Connection::ping() deprecation
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[MimeType] Duplicated MimeType due to PHP Bug
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
## Issue:
Currently there is a PHP bug https://bugs.php.net/bug.php?id=77784 that is causing several MimeTypes to be given as duplicated:
```
application/vnd.openxmlformats-officedocument.spreadsheetml.sheetapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
```
Instead of:
```
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
```
This Patch will fix the Issues by checking if a returned MimeType is duplicated and return appropriate MimeType.
This patch should be reverted if the PHP Bug is ever fixed.
Commits
-------
7cb29c8b4b [MimeType] Duplicated MimeType due to PHP Bug
This PR was merged into the 5.1 branch.
Discussion
----------
[Notifier] Notifier 5.2 is incompatible with 5.1 bridges
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
#36611 introduced a breaking change that made the Notifier 5.2 incompatible with all Notifier bridges 5.0-5.1. Because of this, the tests are currently failing on Travis. This PR attempts to fix this.
Commits
-------
1b6bbc2e71 [Notifier] Notifier 5.2 is incompatible with 5.1 bridges.
This PR was merged into the 4.4 branch.
Discussion
----------
Directly use the driverConnection executeUpdate method
executeUpdate & executeQuery methods do not throw a TableNotFoundException. No need for the try/catch as it is done for executeQuery
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix https://github.com/symfony/symfony/issues/37355
| License | MIT
As explained in https://github.com/symfony/symfony/issues/37355, when doing a write operation, one should avoid using the `executeQuery` method of a Connection, as Doctrine's MasterSlaveConnection can pick a slave instance (usually read-only) for these operations.
Commits
-------
eec12ecd23 Use the driverConnection executeUpdate method
This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
[Notifier][Slack] Error trown when having more than 10 fields specified #36346
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#36346 <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
As written in [docs](https://api.slack.com/reference/block-kit/blocks#section) of Section block, for fields we have to had maximum 10 items specified.
Commits
-------
68b2490ee2 [Notifier][Slack] Error trown when having more than 10 fields specified #36346
This PR was merged into the 5.2-dev branch.
Discussion
----------
[TwigBundle] Deprecate the public "twig" service to private
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Tickets | -
| License | MIT
| Doc PR | -
I think the `twig` service don't need to be public anymore - we never need to access it directly in Symfony's code.
Commits
-------
f64cbada89 [TwigBundle] Deprecate the public "twig" service to private
This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
[Form] Move configuration to PHP
| Q | A
| ------------- | ---
| Branch? | master for features / 3.4, 4.4, 5.0 or 5.1 for bug fixes <!-- see below -->
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Part of #37186
| License | MIT
| Doc PR | -
Commits
-------
9e2e8eeb29 [Form] Move configuration to PHP
This PR was merged into the 5.2-dev branch.
Discussion
----------
[HttpFoundation] add `HeaderUtils::parseQuery()`: it does the same as `parse_str()` but preserves dots in variable names
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Inspired by https://github.com/symfony/psr-http-message-bridge/pull/80
/cc @drupol
Related to #9009, #29664, #26220 but also https://github.com/api-platform/core/issues/509 and https://www.drupal.org/project/drupal/issues/2984272
/cc @dunglas @alexpott
Commits
-------
dd81e32ec1 [HttpFoundation] add `HeaderUtils::parseQuery()`: it does the same as `parse_str()` but preserves dots in variable names
* 5.1:
[HttpClient] Support for cURL handler objects.
[HttpClient] unset activity list when creating CurlResponse
Fixed typo in test name
[DI] Fix call to sprintf in ServicesConfigurator::stack()
add .body wrapper element
[HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3"
[VarDumper] Support for cURL handler objects.
Check whether path is file in DataPart::fromPath()
[DI][FrameworkBundle] Remove whitelist occurrences
Avoid accessibility errors on debug toolbar
Resolve event bubbling logic in a compiler pass
update cookie test
* 5.0:
[HttpClient] Support for cURL handler objects.
[HttpClient] unset activity list when creating CurlResponse
Fixed typo in test name
add .body wrapper element
[HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3"
[VarDumper] Support for cURL handler objects.
Check whether path is file in DataPart::fromPath()
[DI][FrameworkBundle] Remove whitelist occurrences
Avoid accessibility errors on debug toolbar
update cookie test
* 4.4:
[HttpClient] Support for cURL handler objects.
[HttpClient] unset activity list when creating CurlResponse
Fixed typo in test name
add .body wrapper element
[HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3"
[VarDumper] Support for cURL handler objects.
Check whether path is file in DataPart::fromPath()
[DI][FrameworkBundle] Remove whitelist occurrences
Avoid accessibility errors on debug toolbar
* 3.4:
Fixed typo in test name
[HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3"
[VarDumper] Support for cURL handler objects.
[DI][FrameworkBundle] Remove whitelist occurrences
Avoid accessibility errors on debug toolbar
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3"
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#36068 <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | no
<!--
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.
-->
`.mp3` files are more common than `.mpga` files.
Commits
-------
76a744ad91 [HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3"
This PR was merged into the 5.0 branch.
Discussion
----------
[BrowserKit] update cookie test for cookie values with double quotes
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | no
| New feature? | noâ
| Deprecations? | no
| Tickets | Fix#37161
| License | MIT
| Doc PR | symfony/symfony-docs#
Provide a test for cookie values with double quotes
Commits
-------
a50c660823 update cookie test
This PR was merged into the 5.2-dev branch.
Discussion
----------
[Notifier] Return SentMessage from the Notifier message handler
| 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 | see https://github.com/symfony/symfony/pull/36611#issuecomment-648448026 <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR |
Commits
-------
5855d112b7 [Notifier] Return SentMessage from the Notifier message handler
This PR was merged into the 3.4 branch.
Discussion
----------
[VarDumper] Support for cURL handler objects
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #37378
| License | MIT
| Doc PR | N/A
Commits
-------
39c1a6373b [VarDumper] Support for cURL handler objects.
This PR was merged into the 4.4 branch.
Discussion
----------
add .body wrapper element
This change makes the notification email responsive.
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | none
| License | MIT
There was a wrapper missing from the foundation template.
This wrapper applies all `table.body table.container` styles from the foundation stylesheet
including font's and the responsive rules that were missing.
Commits
-------
5b74bbd288 add .body wrapper element
This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
Add Notifier SentMessage
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/13624
Like Mailer, Notifier returns now a SentMessage that contains the messageId (returned by the provider in the response). It contains also the body of the response as array to have more info about price, number of sms sent, status and so on.
- [x] apply to bridges
Commits
-------
5a6f0537ec Add Notifier SentMessage
This PR was merged into the 5.2-dev branch.
Discussion
----------
[FrameworkBundle] allow configuring trusted proxies using semantic configuration
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | -
| Tickets | -
| License | MIT
| Doc PR | -
On top of the improved DX this should provide, this PR (and #37351) will allow [removing the corresponding lines](https://github.com/symfony/recipes/pull/790) from `index.php` & recipes.
Using values:
```yaml
framework:
trusted_proxies: '127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16'
#or
trusted_proxies: '%env(TRUSTED_PROXIES)%'
```
`trusted_headers` is similar but is an array of headers to trust.
```yaml
framework:
# that's the defaults already
trusted_headers: ['x-forwarded-all', '!x-forwarded-host', '!x-forwarded-prefix']
```
Commits
-------
af9dd52752 [FrameworkBundle] allow configuring trusted proxies using semantic configuration
This PR was merged into the 5.1 branch.
Discussion
----------
[Security] Resolve event bubbling of logout + new events in a compiler pass
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37292
| License | MIT
| Doc PR | -
This PR proposes to create a compiler pass that registers listeners on the main `event_dispatcher` on the firewall-specific event dispatcher during compile time. This allows to still specify listener priorities while listening on a bubbled-up event (instead of a fix moment where the event bubbling occurs). It probably also improves performance, as it doesn't use duplicated event dispatching logic to provide event bubbling.
Nothing changes on the user side. I proposed this as a bugfix, as it fixes the bug mentioned in #37292 (not being able to use listener priorities). I did remove a class, which was introduced in 5.1 and is very internal. I think it's safe, but we can also keep it and remove in master.
Commits
-------
f962c26061 Resolve event bubbling logic in a compiler pass
This PR was merged into the 5.2-dev branch.
Discussion
----------
[DI] deprecate Definition/Alias::setPrivate()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Tickets | -
| License | MIT
| Doc PR | -
Right now, there is a very subtle difference between `setPublic()` and `setPrivate()` that dates back to the FC/BC layer we created to turn services private by default.
We kept this difference to help third party bundles provide support for a wide range of versions of Symfony, but since 5.2 will be released at the same time as 3.4 will enter EOM, we should remove this behavior and deprecate `setPrivate()` to signal the change.
This is what this PR does.
Commits
-------
1bea690f4d [DI] deprecate Definition/Alias::setPrivate()
This PR was merged into the 5.2-dev branch.
Discussion
----------
[FrameworkBundle] allow enabling the HTTP cache using semantic configuration
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Right now, using the HTTP cache requires tweaking the `public/index.php` file [as explained in the doc](https://symfony.com/doc/current/http_cache.html).
This PR removes this requirement by allowing one to do this instead:
```yaml
framework:
http_cache: true
```
Commits
-------
56b993ac2e [FrameworkBundle] allow enabling the HTTP cache using semantic configuration
This PR was merged into the 3.4 branch.
Discussion
----------
Avoid accessibility errors on symfony web debug toolbar
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | symfony/symfony-docs#...
When for example using the [axe](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd) to test the website for accessibility. Axe will fail because a div element without a role or a parent [landmark](https://www.w3.org/TR/wai-aria-practices/examples/landmarks/HTML5.html) is rendered. To avoid this errors I think we should define it as a specific region.
Commits
-------
223b405168 Avoid accessibility errors on debug toolbar
This PR was merged into the 5.2-dev branch.
Discussion
----------
[FrameworkBundle] changed configuration file for messenger from xml to php
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/37186
| License | MIT
Use `messenger.php` instead of `messenger.xml` and `messenger_debug.php` instead of `messenger_debug.php`
Commits
-------
571a49873e [FrameworkBundle] changed configuration file for messenger from xml to php
This PR was merged into the 5.2-dev branch.
Discussion
----------
[FrameworkBundle] convert config/serializer.xml to php
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Part of #37186
| License | MIT
Hello!
This PR contains a new configuration file `serializer.php` instead of `serializer.xml`.
Commits
-------
62e9788599 make priority integers & fix test checking definition to be private
25df2de0a6 [FrameworkBundle] convert config/serializer.xml to php
* This removes duplicate event dispatching logic on event bubbling, which
probably improves performance.
* It allows to still specify listener priorities while listening on a
bubbled-up event (instead of a fix moment where the event bubbling occurs)
This PR was merged into the 5.2-dev branch.
Discussion
----------
[Security] Let security factories add firewall listeners
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| License | MIT
| Doc PR | n/a
Hello there, I'm the author of `scheb/two-factor-bundle`, which extends Symfony's security layer with two-factor authentication. I've been closely following the recent changes by @wouterj to rework the security layer with "authenticators" (great work!). While I managed to make my bundle work with authenticators, I see some limitations in the security layer that I'd like to address to make such extensions easier to implement.
With the new authenticator-based security system, it is no longer possible to add a authentication listener to the firewall. The only way to do it is a dirty compiler pass, which extends the argument on the `security.firewall.map.context.[firewallName]` service (like I do in: ed2ce9804b/src/bundle/DependencyInjection/Compiler/AccessListenerCompilerPass.php). This is quite ugly and hacky, so I believe there should be an easier and clean way to add firewall-level listeners. This PR adds an interface, which may be implemented by security factories and lets them add additional listeners to the firewall.
Why would you want to do that? There are certain use-cases that require extra logic to handle a request within the firewall. For example in my bundle, I need to handle the intermediate state between login and the completion of two-factor authentication. So ideally, I'm able to execute some code from the firewall right before `Symfony\Component\Security\Http\Firewall\AccessListener`. In the old security system, I could handle this in my authentication listener, which I had to implement anyways. With the new authenticator-based system this option is gone. In the ideal world, I could add a firewall listener and tell it to execute between `LogoutListener` and `AccessListener`.
This is a draft, so I'd like to hear your opinion on this :)
There's another issue, regarding the order of execution, which I'm addressing with #37337.
Commits
-------
0a4fcea8db Add interface to let security factories add their own firewall listeners
This PR was merged into the 5.2-dev branch.
Discussion
----------
[Security] Add attributes on Passport
| 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 | n/a <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | not yet
see https://github.com/symfonycorp/connect/pull/95
/cc @wouterj
Commits
-------
440ada3c5f [Security] Add attributes on Passport
This PR was merged into the 5.1 branch.
Discussion
----------
[SecurityBundle] Fix UserCheckerListener registration with custom user checker
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37365
| License | MIT
| Doc PR | -
The user checker listener was wrongly registered on the global event dispatcher, as it can be customized per firewall. This PR fixes that + correctly uses the configured user checker instead of always trying to use `UserCheckerInterface`.
Commits
-------
d63f59036c Fix UserCheckerListener registration with custom user checkers
* 5.1:
[SecurityBundle] Drop cache.security_expression_language definition if invalid
[DI] disable preload.php on the CLI
collect all transformation failures
* 5.0:
[SecurityBundle] Drop cache.security_expression_language definition if invalid
[DI] disable preload.php on the CLI
collect all transformation failures
* 4.4:
[SecurityBundle] Drop cache.security_expression_language definition if invalid
[DI] disable preload.php on the CLI
collect all transformation failures