This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Remove unnecessary check for existing request
| Q | A
| ------------- | ---
| Branch? | 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 | Fix#38035 <!-- 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 master.
-->
Commits
-------
3feff72186 remove unnecessary check for existing request
This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
[MonologBridge] Added SwitchUserTokenProcessor to log the impersonator
| 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 | 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 -->
This pull request adds the ability to log the impersonator user in case of user impersonation feature usage. The current TokenProcessor logs only the current token and there are no ability to simply log the original token, so we need to copy-paste the TokenProcessor and change a few lines to log the original token
Commits
-------
2f8651d4ec [MonologBridge] Added SwitchUserTokenProcessor to log the impersonator
This PR was merged into the 5.2-dev branch.
Discussion
----------
[DependencyInjection] Add the Required attribute
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | TODO
This PR proposes a new attribute `#[Required]` that can be used instead of the `@required` annotation.
Commits
-------
ea262441e7 [DependencyInjection] Add the Required attribute.
This PR was merged into the 5.2-dev branch.
Discussion
----------
[RFC][Routing] Added the Route attribute
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | not yet
I was wondering if we can make use of [attributes](https://wiki.php.net/rfc/attributes_v2) as a replacement for Doctrine Annotations for configuring routes.
I have modified the existing `AnnotationClassLoader` so that it merges attributes and annotations. This way, an application could transparently switch from annotations to attributes. Moreover, the `AnnotationClassLoader` does not require an annotation reader anymore.
Since the chosen syntax `#[…]` is treated as a comment by php 7, I was able to use the existing annotation class, which makes the migration even easier.
#### Example with Doctrine Annotations
```php
use Symfony\Component\Routing\Attribute\Route;
class ActionPathController
{
/**
* @Route("/path", name: "action")
*/
public function action()
{
}
}
```
#### Same example with the proposed Attribute
```php
use Symfony\Component\Routing\Attribute\Route;
class ActionPathController
{
#[Route('/path', name: 'action')]
public function action()
{
}
}
```
Commits
-------
f0978de493 [Routing] Added the Route attribute.
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] with "bindto" with NativeHttpClient
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#38081
| License | MIT
| Doc PR | -
/cc @derrabus
Commits
-------
cea05311fc [HttpClient] with "bindto" with NativeHttpClient
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
As seen in https://github.com/symfonycorp/cloud-templates/pull/15, having the path of the preload file vary by env+debug makes configuring PHP.ini settings impossible.
This PR dump a new `preload.php` file in `src/` when `cache:clear` is called.
This makes the path predictable.
This is submitted as a bugfix because the current behavior is barely usable without this change.
Commits
-------
54c965c7d0 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable
* 4.4:
[HttpKernel] Adjust tests to new "class not found" error message format.
Don't call createMock with an array of interfaces.
[FrameworkBundle] Fix Tests on PHPUnit 9.3.
[WebProfilerBundle] Fix Tests on PHPUnit 9.3.
esmtp error not being thrown properly
[Yaml Parser] fixed Parser to skip comments when inlining sequences
[DI] fix generating preload file when cache_dir is outside project_dir
Fix CacheCollectorPass with decorated cache pools
[PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
Remove invalid instantiation declaration
[PropertyInfo] Fix typed collections in PHP 7.4
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Fix Tests on PHPUnit 9.3
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #37564
| License | MIT
| Doc PR | N/A
When joining two constraints with a `LogicalAnd`, PHPUnit will generate a failure message where the message omitted by the first constraint will be wrapped in parenthesis. I'm using a regular expression now, so we can support both variants.
Commits
-------
8bc36d7420 [FrameworkBundle] Fix Tests on PHPUnit 9.3.
This PR was merged into the 4.4 branch.
Discussion
----------
[WebProfilerBundle] Fix Tests for PHPUnit 9.3
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #37564
| License | MIT
| Doc PR | N/A
PHPUnit's `logicalXor()` creates an XOR operation for one or multiple constraints. It expects the operands for that operation to be passed as variadic arguments, but this particullar test passes them in a single array.
This somewhat works on PHPUnit 8, but fails on PHPUnit 9. This PR fixes the failing test.
Commits
-------
f290b97d4f [WebProfilerBundle] Fix Tests on PHPUnit 9.3.
This PR was merged into the 4.4 branch.
Discussion
----------
Don't call createMock with an array of interfaces
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #37564
| License | MIT
| Doc PR | N/A
PHPUnit 8 allows us to pass an array of interfaces to `createMock()`. The result was a mock object that implemented all of the given interfaces. This feature has sadly been removed (see sebastianbergmann/phpunit#3955), which forces us to create dummy classes that can be mocked instead. I've done this already on the 3.4 branch with #37566.
This PR fixes all affected tests (that I could find) on the 4.4 branch.
Commits
-------
a8e762d8c3 Don't call createMock with an array of interfaces.
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead.
Discussion
----------
[Console] Make sure $maxAttempts is an int or null
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #36872
| License | MIT
| Doc PR | N/A
The behavior of the "less than" operator for mixed types has changed in php 8. It is now possible to call `setMaxAttempts()` with a random string without raising the expected `InvalidArgumentException`. I've added an explicit type cast in order to restore the previous behavior.
Commits
-------
4fcd4916ed [Console] Make sure $maxAttempts is an int or null.
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpKernel] Adjust tests to new "class not found" error message format
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #36872
| License | MIT
| Doc PR | N/A
Commits
-------
5b95bcd009 [HttpKernel] Adjust tests to new "class not found" error message format.
This PR was merged into the 5.1 branch.
Discussion
----------
Fix a typo in UPGRADE-5.1.md
I guess there was a mistake on the Config upgrade.
The method's name which signature has changed is `NodeDefinition::setDeprecated(...)` (instead of `NodeDefinition::setDeprecation(...)`). Same thing goes for `BaseNode::setDeprecated(...).
Thanks :)
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | kinda
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | none
| License | MIT
| Doc PR | none
<!--
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
-------
144599f0d9 Update UPGRADE-5.1.md
I guess there was a mistake on the Config upgrade. The method's name which signature has changed is `NodeDefinition::setDeprecated(...)` (instead of `NodeDefinition::setDeprecation(...)`).
Same thing goes for `BaseNode::setDeprecated(...).
Thanks :)
This PR was merged into the 5.2-dev branch.
Discussion
----------
[Notifier] Register NotificationDataCollector and NotificationLoggerListener service
| 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#38009 <!-- 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 master.
-->
Commits
-------
1beffd1363 Register NotificationDataCollector and NotificationLoggerListener
This PR was submitted for the master branch but it was merged into the 4.4 branch instead.
Discussion
----------
esmtp error not being thrown properly
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | n/a
| License | MIT
| Doc PR | n/a
This is the same fix as https://github.com/symfony/symfony/pull/32895 but for esmtp transport
Commits
-------
976eea3be0 esmtp error not being thrown properly
This PR was merged into the 5.2-dev branch.
Discussion
----------
Create impersonation_exit_path() and *_url() functions
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes (not added atm) <!-- please add some, will be required by reviewers -->
| Fixed tickets | #24676 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | To come later <!-- symfony/symfony-docs#... --><!-- required for new features -->
This is a relaunch of the PR #24737
It adds more flexibility to the previous try.
You have two twig functions `impersonation_exit_url()` and `impersonation_exit_path()`
You can either leave on the same path, redirect to the path where was the user at the user switch, or to the path you want.
Example:
The following code
```twig
<p>{{ impersonation_exit_url() }}</p>
<p>{{ impersonation_exit_path() }}</p>
<p> </p>
<p>{{ impersonation_exit_url(path('app_default_other')) }}</p>
<p>{{ impersonation_exit_path(path('app_default_other')) }}</p>
<p> </p>
<p>{{ impersonation_exit_url('_use_impersonated_from_url') }}</p>
<p>{{ impersonation_exit_path('_use_impersonated_from_url') }}</p>
```
will output
![Capture d’écran de 2019-07-31 20-58-42](https://user-images.githubusercontent.com/7721219/62239914-1482cb00-b3d6-11e9-9b58-ea8d30a2e28a.png)
**Note:** If this proposal appears to be better, I'll add tests, update changelog, and prepare the doc.
**Bonus:**
As the "impersonated from url" is stored in the `SwitchUserToken` it might be possible to display it in the profiler:
![Capture d’écran de 2019-07-31 21-04-50](https://user-images.githubusercontent.com/7721219/62240294-efdb2300-b3d6-11e9-911a-bec48fd75327.png)
WDYT?
<!--
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/roadmap):
- 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 4.4.
- Legacy code removals go to the master branch.
-->
Commits
-------
c1e3703efd Create impersonation_exit_path() and *_url() functions
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[Yaml Parser] fixed Parser to skip comments when inlining sequences
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37972
| License | MIT
The parser didn't skip comments when parsing values in a sequence. This resulted in the YamlFileLoader trying to
parse a comment as a IteratorArgument which resulted in a InvalidArgumentException.
Consider the following valid yaml:
```yaml
- !foo [
bar,
#baz
]
```
The parser would generate the following array:
```php
['bar', '#baz']
```
After this fix the parser will generate the following array:
```php
['bar']
```
This bug only appeared for me in 4.4
Commits
-------
b5316ebebb [Yaml Parser] fixed Parser to skip comments when inlining sequences
This PR was merged into the 3.4 branch.
Discussion
----------
[VarDumper] Fix caster for invalid SplFileInfo objects on php 8
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #36872
| License | MIT
| Doc PR | N/A
The behavior of uninitialized `SplFileInfo` classes has changed in php 8: https://3v4l.org/s4c4O
* `getPathname()` won't return `false` anymore.
* The error raised by most accessors is now recoverable. On php 7, it's fatal.
This PR adjusts the caster for those objects to the new behavior.
Commits
-------
ab45e2aaae [VarDumper] Fix caster for invalid SplFileInfo objects on php 8.