This PR was merged into the 4.4 branch.
Discussion
----------
[Security] suggest a non-deprecated function replacement
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#35437
| License | MIT
| Doc PR |
Commits
-------
731730fe2f suggest a non-deprecated function replacement
* 4.3:
[DoctrineBridge] [DX] Improve condition for exception text in ManagerRegistry to avoid confusion
Fix testing with mongodb
Minor Travis cosmetic patch
[Cache] fix checking for igbinary availability
bumped Symfony version to 4.3.11
updated VERSION for 4.3.10
updated CHANGELOG for 4.3.10
bumped Symfony version to 3.4.38
updated VERSION for 3.4.37
update CONTRIBUTORS for 3.4.37
updated CHANGELOG for 3.4.37
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Add --show-arguments example to debug:container command help text
| 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 #", if any -->
| License | MIT
| Doc PR | - <!-- required for new features -->
I like this option a lot and I think it deserves to be mentioned in the command help text :-)
Commits
-------
f703a58215 [FrameworkBundle] Add --show-arguments example to debug:container command help text
This PR was merged into the 3.4 branch.
Discussion
----------
[Security] Use supportsClass in addition to UnsupportedUserException
| Q | A
| ------------- | ---
| Branch? | 3.4+
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#35045
| License | MIT
| Doc PR | ~
This PR fixes the issue where user providers rely on just the UnsupportedUserException from `refreshUser()`, causing a flow where users are wrongfully re-authenticated.
There's one issue where `refreshUser()` can do far more sophisticated checks on the user class, which it will never reach if the class is not supported. As far as I know it was never intended to support instances that are rejected by `supportsClass()`, though people could've implemented this (by accident). So the question is more if we should add a BC layer for this; for example:
```php
try {
$refreshedUser = $provider->refreshUser($user);
$newToken = clone $token;
$newToken->setUser($refreshedUser);
if (!$provider->supportsClass($userClass)) {
if ($this->shouldCheckSupportsClass) {
continue;
}
// have to think of a proper deprecation here for 6.0
@trigger_error('Provider %s does not support user class %s via supportsClass() while it does support it via refreshUser .. please set option X and fix %s::supportsUser() ', E_USER_DEPRECATED);
}
```
This would prevent behavior from breaking but also means we can't fix this on anything less than 5.1.
Commits
-------
d3942cbe17 Use supportsClass where possible
* 5.0:
[Filesystem] chown and chgrp should also accept int as owner and group
[DI] Fix EnvVar not loaded when Loader requires an env var
Fixed#34713 Move new messages to intl domain when possible
[FrameworkBundle] Fix small typo in output comment
chown and chgrp should also accept int as owner and group
Revert "Fixed translations file dumper behavior"
Fix RememberMe with null password
[Validator] Fix plurals for sr_Latn (Serbian language written in latin script) validation messages
Set booted flag to false when test kernel is unset
[FrameworkBundle] remove messenger cache if not enabled
[PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code
[HttpClient] Fix strict parsing of response status codes
fix PHP const mapping keys using the inline notation
[SecurityBundle] Drop duplicated code
[FrameworkBundle] Make sure one can use fragments.hinclude_default_template
Fix that no-cache requires positive validation with the origin, even for fresh responses
Improve upgrading instructions for deprecated router options
[DI] Suggest typed argument when binding fails with untyped argument
* 4.4:
[DI] Fix EnvVar not loaded when Loader requires an env var
Fixed#34713 Move new messages to intl domain when possible
[FrameworkBundle] Fix small typo in output comment
chown and chgrp should also accept int as owner and group
Revert "Fixed translations file dumper behavior"
Fix RememberMe with null password
[Validator] Fix plurals for sr_Latn (Serbian language written in latin script) validation messages
Set booted flag to false when test kernel is unset
[FrameworkBundle] remove messenger cache if not enabled
[PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code
[HttpClient] Fix strict parsing of response status codes
fix PHP const mapping keys using the inline notation
[SecurityBundle] Drop duplicated code
[FrameworkBundle] Make sure one can use fragments.hinclude_default_template
Fix that no-cache requires positive validation with the origin, even for fresh responses
Improve upgrading instructions for deprecated router options
[DI] Suggest typed argument when binding fails with untyped argument
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
Revert #34797 "Fixed translations file dumper behavior" and fix#34713
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#35264
| License | MIT
| Doc PR | -
Revert https://github.com/symfony/symfony/pull/34797
See also https://github.com/symfony/symfony/issues/35328
It's very likely that the new way will be completely different from this one that is being reverted. That's why I'm reverting rather than fixing it.
Commits
-------
9ca872054bFixed#34713 Move new messages to intl domain when possible
56e79fefa1 Revert "Fixed translations file dumper behavior"
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Fix small typo in output comment
| Q | A
| ------------- | ---
| Branch? | 4.4 <!-- see below -->
| 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 #", 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/roadmap):
- 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
-------
d18f5ed851 [FrameworkBundle] Fix small typo in output comment
* 4.3:
chown and chgrp should also accept int as owner and group
Fix RememberMe with null password
[Validator] Fix plurals for sr_Latn (Serbian language written in latin script) validation messages
[PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code
fix PHP const mapping keys using the inline notation
Fix that no-cache requires positive validation with the origin, even for fresh responses
* 3.4:
chown and chgrp should also accept int as owner and group
Fix RememberMe with null password
[Validator] Fix plurals for sr_Latn (Serbian language written in latin script) validation messages
[PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code
fix PHP const mapping keys using the inline notation
Fix that no-cache requires positive validation with the origin, even for fresh responses
* 4.3:
[FrameworkBundle] remove messenger cache if not enabled
[HttpClient] Fix strict parsing of response status codes
[DI] Suggest typed argument when binding fails with untyped argument
This PR was merged into the 3.4 branch.
Discussion
----------
[PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Risky errors when there are no assertions are added before the test end listeners are called (ie, before the code in endTest is executed) so forcing beStrictAboutTestsThatDoNotTestAnything to false when there is a expectedDeprecation annotation is enough.
If the goal is to reset the value to the original value, then I think we should not do it since we basically "lie" to the next listeners. Let's assume that when a test expect a deprecation, it can have 0 assertions. Also this flag is not used anymore by PHPUnit after we reset it.
Ref https://github.com/symfony/symfony/pull/21786 btw
Commits
-------
fb48bbc05b [PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code
This PR was merged into the 5.0 branch.
Discussion
----------
[Security] Fix RememberMe with null password
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | yes
| New feature? | no
| Deprecations? | yes
| Tickets | NA
| License | MIT
| Doc PR | NA
From `UserInterface` the method getPassword may return null, while generateCookieHash requires a string.
This PR changes the signature of the methods to allows null password
Commits
-------
a7d0d82768 Fix RememberMe with null password
This PR was merged into the 4.4 branch.
Discussion
----------
[DI] Fix EnvVar not loaded when Loader requires an env var
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #35348
| License | MIT
| Doc PR | NA
When an EnvVarLoader has a dependency on an Env Var tried to be loaded (which is the case for SodiumVault that is configured with `default::SYMFONY_DECRYPTION_SECRET`) the Loader is not usable.
What happens:
- when trying to resolve `SYMFONY_DECRYPTION_SECRET`, the EnvVarProcessor iterates over loaders
- given SodiumVaultLoaders requires the same env variable `SYMFONY_DECRYPTION_SECRET`, it throws a `ParameterCircularReferenceException`
- letting the $loaders generator invalid
This PR, refactor the way loaders are iterated in order to rewind on failure.
Commits
-------
e119aa6c48 [DI] Fix EnvVar not loaded when Loader requires an env var
This PR was merged into the 3.4 branch.
Discussion
----------
[Filesystem] chown and chgrp should also accept int as owner and group (3.4)
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Reference: https://github.com/symfony/symfony/pull/35356#issuecomment-575526299
Commits
-------
6b811e6b4c chown and chgrp should also accept int as owner and group
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Fix plurals for sr_Latn validation messages
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#35276
| License | MIT
validators.sr_Latn.xlf (Serbian, written with latin script) has wrong plurals for all validation message translations that require them (only two where there should be three). This commit fixes that by adding the missing third plural-translation.
Commits
-------
207cdafd54 [Validator] Fix plurals for sr_Latn (Serbian language written in latin script) validation messages
This PR was merged into the 4.3 branch.
Discussion
----------
[DI] Suggest typed argument when binding fails with untyped argument
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #33470
| License | MIT
I've added a condition that looks for arguments and if the typehint doesn’t match, throws an `InvalidArgumentException`
Commits
-------
0e92399daa [DI] Suggest typed argument when binding fails with untyped argument
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Workflow] Added a way to not fire the announce event
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#35286
| License | MIT
| Doc PR |
Commits
-------
d31939d01d [Workflow] Added a way to not fire the annonce event
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Serializer] Added scalar denormalization
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#33784
| License | MIT
Was added an ability to deserialize scalar data (single or array).
Commits
-------
dad04d0adf Added scalar denormalization in Serializer + added scalar normalization tests
This PR was merged into the 5.1-dev branch.
Discussion
----------
[FrameworkBundle] Deprecate *not* setting the "framework.router.utf8" option
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Tickets | -
| License | MIT
| Doc PR | -
The goal here is to get rid of the `config/packages/routing.yaml` file in Symfony 6.
This should have no practical impact as all new apps already define this setting for 2 years.
Commits
-------
84849bc96a [FrameworkBundle] Deprecate *not* setting the "framework.router.utf8" option
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Yaml] Added yaml-lint binary
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | no
| New feature? | yes
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#18987 <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | tbd.
<!--
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):
- 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 4.4.
- Legacy code removals go to the master branch.
-->
Commits
-------
2640dfedfa [Yaml] Introduce yaml-lint binary
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpKernel] Fix that no-cache MUST revalidate with the origin
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
From [RFC 7234 Section 5.2.2](https://tools.ietf.org/html/rfc7234#section-5.2.2)
> The "no-cache" response directive indicates that the response MUST NOT be used to satisfy a subsequent request without successful validation on the origin server. This allows an origin server to prevent a cache from using it to satisfy a request without contacting it, even by caches that have been configured to send stale responses.
This is unconditional – the response must be revalidated right away.
(`must-revalidate`, to the contrary, requires revalidation only once the response has become stale.)
Commits
-------
c8bdcb3408 Fix that no-cache requires positive validation with the origin, even for fresh responses
This PR was merged into the 5.1-dev branch.
Discussion
----------
[FrameworkBundle] Add missing entry about framework.router.context
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Relates to #35281 <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | N/A
Some minor tweaks about #35281
Commits
-------
5a83b07bf4 [FrameworkBundle] Add missing entry about framework.router.context
* 5.0:
Avoid stale-if-error if kernel.debug = true, because it hides errors
[Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor
[SecurityBundle] Fix collecting traceable listeners info using anonymous: lazy
[Filesystem][FilesystemCommonTrait] Use a dedicated directory when there are no namespace
[Workflow] Fix configuration node reference for "initial_marking"
expand listener in place
[DI] deferred exceptions in ResolveParameterPlaceHoldersPass
Do not throw exception on valut generate key
* 4.4:
Avoid stale-if-error if kernel.debug = true, because it hides errors
[Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor
[SecurityBundle] Fix collecting traceable listeners info using anonymous: lazy
[Filesystem][FilesystemCommonTrait] Use a dedicated directory when there are no namespace
[Workflow] Fix configuration node reference for "initial_marking"
expand listener in place
[DI] deferred exceptions in ResolveParameterPlaceHoldersPass
Do not throw exception on valut generate key
* 4.3:
Avoid stale-if-error if kernel.debug = true, because it hides errors
[Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor
[Workflow] Fix configuration node reference for "initial_marking"
expand listener in place
[DI] deferred exceptions in ResolveParameterPlaceHoldersPass
* 3.4:
Avoid stale-if-error if kernel.debug = true, because it hides errors
[Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor
[DI] deferred exceptions in ResolveParameterPlaceHoldersPass
This PR was squashed before being merged into the 5.1-dev branch (closes#35257).
Discussion
----------
[FrameworkBundle] TemplateController should accept extra arguments to be sent to the template
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.
Additionally (see https://symfony.com/roadmap):
- 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.
-->
In the official documentation (symfony.com/doc/master/templates.html#rendering-a-template-directly-from-a-route) it says that TemplateController should accept extra arguments. In fact it's not available for instance.
So i added the context argument as an array. Because of deprecation of templating, only the twig instance will apply the context argument.
It will need to be implemented in branch 5.
The following issue has been created in documentation project : https://github.com/symfony/symfony-docs/issues/12897
Commits
-------
e27b417817 [FrameworkBundle] TemplateController should accept extra arguments to be sent to the template
This PR was squashed before being merged into the 5.1-dev branch (closes#34980).
Discussion
----------
[Messenger] remove several messages with command messenger:failed:remove
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#34940
| License | MIT
command `messenger:failed:remove` now accepts an array of ids. If several provided, they are not displayed unless option `--show-messages` is passed
Commits
-------
903455e463 [Messenger] remove several messages with command messenger:failed:remove
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Validator] Added HostnameValidator
| Q | A
| ------------- | ---
| Branch? | master
| 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | #10088 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
This PR adds HostnameValidator support. I encountered this need in my project and was surprised that this issue has been open for years.
Here is short example:
```
App\Entity\Acme:
properties:
domain:
- Hostname: ~
non_tld_domain:
- Hostname: { requireTld: false }
```
The option `requireTld` is `true` by default and disallows domains like localhost and etc.
Commits
-------
8a08c2090a Added HostnameValidator
This PR was squashed before being merged into the 5.1-dev branch (closes#35284).
Discussion
----------
Simplify UriSigner when working with HttpFoundation's Request
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
I'm using the `UriSigner` in my own projects from time to time and I've always wondered why I have to manually generate the URI from the `Request` instance in such a way that it is correctly validated.
Let's add a new `checkRequest(Request $request)` method to provide better DX.
Commits
-------
4887b4bee1 Simplify UriSigner when working with HttpFoundation's Request
This PR was merged into the 5.1-dev branch.
Discussion
----------
[FrameworkBundle] Adding better output to secrets:decrypt-to-local command
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | none
| License | MIT
| Doc PR | not needed
Hi!
The `secrets:decrypt-to-local` doesn't give any output. This adds some basic details:
<img width="1280" alt="Screen Shot 2020-01-09 at 11 53 54 AM" src="https://user-images.githubusercontent.com/121003/72087704-ebe0f480-32d6-11ea-950c-c698abde783d.png">
(note the `-vvv` wasn't necessary in the command to show the output). And the `<info>`part is fixed.
Cheers!
Commits
-------
a6aa9781eb Adding better output to secrets:decrypt-to-local command
This PR was merged into the 5.1-dev branch.
Discussion
----------
[HttpClient] Add LoggerAwareInterface to ScopingHttpClient and TraceableHttpClient
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
This allows changing the logger when using `ScopingHttpClient` (and `TraceableHttpClient` during dev)
Commits
-------
1137bdc3f7 Add LoggerAwareInterface to ScopingHttpClient and TraceableHttpClient
This PR was merged into the 5.1-dev branch.
Discussion
----------
Add support for safe HTTP preference - RFC 8674
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
[RFC 8674](https://tools.ietf.org/html/rfc8674) (not a IETF standard at the moment) defines a way for user agents to ask for "safe" content to a server. This PR add helper methods to :
- know if the user agent prefers a safe content
- mark the response as safe
Commits
-------
7f2cef759c Add support for safe preference - RFC8674
This PR was squashed before being merged into the 5.1-dev branch (closes#34880).
Discussion
----------
[Twig][Form] Twig theme for Foundation 6
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR | -
Hi,
I propose a form theme for Foundation 6. This layout stylizes buttons, percent / money widgets and permits switch inputs adding a 'switch-input' attribute (as for https://symfony.com/blog/new-in-symfony-4-4-bootstrap-custom-switches).
![Foundation_6](https://user-images.githubusercontent.com/10855303/70390292-184cdc80-19ca-11ea-8ad8-090358dd9e35.png)
```php
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
// ...
->add('checkbox-switch', Type\CheckboxType::class, [
'attr' => [
'class' => 'switch-input',
],
])
;
}
```
Commits
-------
e47a134db0 [Twig][Form] Twig theme for Foundation 6
This PR was merged into the 3.4 branch.
Discussion
----------
[DI] deferred exceptions in ResolveParameterPlaceHoldersPass
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#30428
| License | MIT
| Doc PR | n/a
fixes case #30428
implemented as in AutowiringPass
Commits
-------
b3a2173c8e [DI] deferred exceptions in ResolveParameterPlaceHoldersPass
This PR was merged into the 5.1-dev branch.
Discussion
----------
[FrameworkBundle] Configure RequestContext through router config
| Q | A
| ------------- | ---
| Branch? | master
| 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#35229 <!-- 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/roadmap):
- 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.
-->
- [ ] PR on symfony/symfony-docs
Commits
-------
6658900703 [FrameworkBundle] Configure RequestContext through router config
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Do not throw exception on value generate key
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
When using env variable instead of key files and creating a new Secret, the check in `generateKeys` (called by the command `SecretsSetCommand`) prevents generating a secret.
reproducer:
```
$ rm config/secrets/prod/prod.decrypt.private.php
$ export SYMFONY_DECRYPTION_SECRET=XXX
$ ./bin/console secret:set FOO
In SodiumVault.php line 50:
Cannot generate keys when a decryption key has been provided while instantiating the vault.
```
This PR converts the exception in a warning message.
Commits
-------
2f608b4dfa Do not throw exception on valut generate key
This PR was merged into the 4.3 branch.
Discussion
----------
[EventDispatcher] expand listener in place
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#35259
| License | MIT
| Doc PR |
Commits
-------
f5d407318d expand listener in place
* 5.0:
[String] add test case for wordwrap method
[Process] - update @throws phpdoc
[PHPUnitBridge] file_get_contents() expects parameter 3 to be resource
[PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails
[HttpKernel][FileLocator] Fix deprecation message
* 4.4:
[Process] - update @throws phpdoc
[PHPUnitBridge] file_get_contents() expects parameter 3 to be resource
[PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails
[HttpKernel][FileLocator] Fix deprecation message
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpKernel][FileLocator] Fix deprecation message
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Ref https://github.com/symfony/symfony/pull/34886
`$deprecatedPath` is the foreach value so it only works if the last element triggers the deprecation, otherwise the value is wrong.
Commits
-------
18ce8399d2 [HttpKernel][FileLocator] Fix deprecation message
* 4.3:
[Process] - update @throws phpdoc
[PHPUnitBridge] file_get_contents() expects parameter 3 to be resource
[PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails
* 3.4:
[PHPUnitBridge] file_get_contents() expects parameter 3 to be resource
[PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[PHPUnitBridge] file_get_contents() expects parameter 3 to be resource
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
file_get_contents 3rd parameter (context) expects resource or NULL to ignore them
Commits
-------
a28a42187c [PHPUnitBridge] file_get_contents() expects parameter 3 to be resource
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Some commands executed by the `simple-phpunit` script are not checked for success. For example [here](https://travis-ci.org/twigphp/Twig/jobs/634110681), Composer fails with the message
```
[InvalidArgumentException]
Could not find package phpunit/phpunit with version 7.5.* in a version inst
allable using your PHP version 7.0.25.
```
Yet, the `simple-phpunit` script happily continues, going over failing `chdir()`, `file_get_contents()` and `include()` calls and eventually returns a successful `0` exit code. So CI tests look OK when in fact PHPUnit was not even downloaded.
Commits
-------
576e18561f [PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Console] Add SingleCommandApplication to ease creation of Single Command Application
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#34293
| License | MIT
| Doc PR |
---
```php
<?php
require __DIR__.'/vendor/autoload.php';
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\SingleCommandApplication;
(new SingleCommandApplication())
->setName('My Super Command') // Optional
->setVersion('1.0.0') // Optional
->setProcessTitle('my_proc_title') // Optional
->addArgument('who', InputArgument::OPTIONAL, 'Who', 'World') // Optional
->setCode(function(InputInterface $input, OutputInterface $output) {
$output->writeln(sprintf('Hello %s!', $input->getArgument('who')));
})
->run()
;
```
---
Note: I tried this too, and it works as expected:
```php
class MyCommand extends SingleCommandApplication
{
public function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('hello');
return 0;
}
}
new MyCommand();
```
Commits
-------
4af513d449 [Console] Add SingleCommandApplication to ease creation of Single Command Application
* 5.0:
[Debug] fix ClassNotFoundFatalErrorHandler
[FrameworkBundle] Document the router.cache_class_prefix parameter removal
[Routing] Fix using a custom matcher & generator dumper class
[Notifier] Add more specific types at documentation level when php engine can't
[Serializer] Fix cache in MetadataAwareNameConverter
[Dotenv] Fixed infinite loop with missing quote followed by quoted value
[HttpClient] Added missing sprintf
[TwigBridge] button_widget now has its title attr translated even if its label = null or false
[PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
[Messenger] Added check if json_encode succeeded
[Messenger] Added check if json_encode succeeded
[FrameworkBundle][ContainerLintCommand] Only skip .errored. services
[HttpClient] fix exception in case of PSR17 discovery failure
[DependencyInjection] Handle ServiceClosureArgument for callable in container linting
fix processing chain adapter based cache pool
[HttpKernel] release lock explicitly
[Security] Prevent canceled remember-me cookie from being accepted
[FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr
[Security\Guard] Fix missing typehints
do not render preferred choices as selected
* 4.4:
[Debug] fix ClassNotFoundFatalErrorHandler
[Routing] Fix using a custom matcher & generator dumper class
[Serializer] Fix cache in MetadataAwareNameConverter
[Dotenv] Fixed infinite loop with missing quote followed by quoted value
[HttpClient] Added missing sprintf
[TwigBridge] button_widget now has its title attr translated even if its label = null or false
[PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
[Messenger] Added check if json_encode succeeded
[Messenger] Added check if json_encode succeeded
[FrameworkBundle][ContainerLintCommand] Only skip .errored. services
[HttpClient] fix exception in case of PSR17 discovery failure
[DependencyInjection] Handle ServiceClosureArgument for callable in container linting
fix processing chain adapter based cache pool
[HttpKernel] release lock explicitly
[Security] Prevent canceled remember-me cookie from being accepted
[FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr
[Security\Guard] Fix missing typehints
do not render preferred choices as selected
* 4.3:
[Debug] fix ClassNotFoundFatalErrorHandler
[Routing] Fix using a custom matcher & generator dumper class
[Dotenv] Fixed infinite loop with missing quote followed by quoted value
[HttpClient] Added missing sprintf
[TwigBridge] button_widget now has its title attr translated even if its label = null or false
[PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
[Messenger] Added check if json_encode succeeded
[Security] Prevent canceled remember-me cookie from being accepted
[FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr
[Security\Guard] Fix missing typehints
This PR was merged into the 4.3 branch.
Discussion
----------
[Routing] Fix using a custom matcher & generator dumper class
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This PR fixes a BC break I encountered while upgrading an existing project from 4.2 to 4.4. In this project I use a custom `generator_dumper_class` that is not a `CompiledUrlGeneratorDumper` (it didn't exist yet). I faced 2 problems:
- The generator is considered "compiled" while it is not. This is because we don't check if the `generator_dumper_class` is effectively a `CompiledUrlGeneratorDumper` to compute the `$compiled` variable. That result in a `\TypeError: Return value of Symfony\Component\Routing\Router::getCompiledRoutes() must be of the type array, int returned`
- My custom dumper is not used at all. This is because of https://github.com/symfony/symfony/pull/31964. I altered the condition to fall back only in one way and not the other. The original issue is still fixed (if one uses a classic `UrlGenerator` + a `CompiledUrlGeneratorDumper`, it fall backs on `PhpGeneratorDumper`). However, if one uses a `CompiledUrlGenerator` + a classic `PhpGeneratorDumper` (my case), the classic dumper is still returned. Since `$compiled` is now correctly computed, this case works fine. The Router won't try to get the compiled routes and will use the "old" way.
Commits
-------
3a840a9796 [Routing] Fix using a custom matcher & generator dumper class
* 3.4:
[Debug] fix ClassNotFoundFatalErrorHandler
[Dotenv] Fixed infinite loop with missing quote followed by quoted value
[TwigBridge] button_widget now has its title attr translated even if its label = null or false
[PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
[Security] Prevent canceled remember-me cookie from being accepted
[FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr
This PR was merged into the 3.4 branch.
Discussion
----------
[Dotenv] Fixed infinite loop with missing quote followed by quoted value
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34642
| License | MIT
| Doc PR |
If there's a quote missing to end a value and in the next line there's again a quoted value Dotenv will run into an infinite loop. An .env file with the following content will result in this error:
```
FOO="foo
BAR="bar"
```
See #34642 for more details.
Commits
-------
eb69e135b2 [Dotenv] Fixed infinite loop with missing quote followed by quoted value
This PR was merged into the 3.4 branch.
Discussion
----------
[Security\Http] Prevent canceled remember-me cookie from being accepted
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#35198
| License | MIT
| Doc PR | -
`RememberMeServices::autoLogin()` only checks that the cookie exists in `$request->cookies` while `loginFail()` only alter `$request->attributes` (which allows child implementations to read the canceled cookie for e.g. removing a persistent one).
This makes `autoLogin()` checks for `request->attributes` first, which fixes the linked issue.
Failure expected on deps=high build.
Commits
-------
9b711b87fe [Security] Prevent canceled remember-me cookie from being accepted
This PR was merged into the 3.4 branch.
Discussion
----------
[Debug] fix ClassNotFoundFatalErrorHandler
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Spotted by the CI on 4.4, see https://github.com/symfony/symfony/pull/35266 for details.
Replaces https://github.com/symfony/symfony/pull/35255 /cc @mpdude
Commits
-------
0c320febe1 [Debug] fix ClassNotFoundFatalErrorHandler
`isset` is used to test existence of values that is
`null` by default, which result to always bypass the cache
and force to do the calculate all the time.
This is a critical perf improvement in prod mode for an api.
Ref #35085
If there's a quote missing to end a value and in the next line there's again a quoted value Dotenv will run into an infinite loop. An .env file with the following content will result in this error:
```
FOO="foo
BAR="bar"
```
See #34642 for more details.
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Messenger] Log sender alias in SendMessageMiddleware
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| License | MIT
This makes it easier to read which sender alias was used.
```diff
- Sending message Domain\Event\PaymentFlow\PaymentFlowFailedEvent with Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport
+ Sending message Domain\Event\PaymentFlow\PaymentFlowFailedEvent with async sender using Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport
```
Commits
-------
4e6626ca63 Log sender alias in SendMessageMiddleware
This PR was merged into the 4.4 branch.
Discussion
----------
[TwigBridge] do not render preferred choices as selected
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/35135#issuecomment-570607719
| License | MIT
| Doc PR |
Commits
-------
c5b8190424 do not render preferred choices as selected
This PR was squashed before being merged into the 3.4 branch (closes#35193).
Discussion
----------
[TwigBridge] button_widget now has its title attr translated even if its label = null or false
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34330
| License | MIT
| Doc PR | TODO
Duplicate of #34436 but changed to bugfix and applied to 3.4. Buttons with null or false 'label' options will now have their 'title' attribute translated against the current translation domain.
Commits
-------
2a5d9cb75a [TwigBridge] button_widget now has its title attr translated even if its label = null or false
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #34796
| License | MIT
| Doc PR | -
Locally using [phpenv](https://github.com/phpenv/phpenv) together [phpenv-composer](https://github.com/ngyuki/phpenv-composer) with for managing php versions and composer installations.
`which composer` is detecting wrapper instead of binary.
Before appending PHP executable to composer path need to validate that detected composer is not a wrapper otherwise PHP will simply return the content of a wrapper
Commits
-------
25c805ed56 [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
This PR was squashed before being merged into the 4.3 branch (closes#35150).
Discussion
----------
[Messenger] Added check if json_encode succeeded
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Similar PR as https://github.com/symfony/symfony/pull/35137 but for branch 4.3.
When trying to add a message to redis transport which can not be encoded with `json_encode` there is now a `TransportException` containing the `json_last_error_msg` as the message.
I had an issue where I tried to send an email through messenger by symfony mailer which contains a pdf attachment. Instead of an error while sending i got an error `Encoded envelope should have at least a "body"` which happened because the encoded message was `false`.
This is not exactly a bugfix, but IMO also not a feature worth being mentioned in the changelog so I am not sure I've filled out the Q/A correctly.
Commits
-------
c2bdc4c4d3 [Messenger] Added check if json_encode succeeded
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] fix exception in case of PSR17 discovery failure
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
On symfony.com, we need to use HTTPlug for 3rd party libs. When `nyholm/psr7` is not installed, we currently see an exception saying `No HTTPlug clients found.` from `HttpClientDiscovery`.
This fixes the message by correctly suggesting `nyholm/psr7` instead, since there *is* an HTTPlug client: `HttplugClient` from our HttpClient component.
It's quite unfortunate that `guzzle/psr7` provides no PSR17 factory yet, because that would have solved some part of this deps mess. /cc @Nyholm @sagikazarmark FYI
Note that https://packagist.org/providers/psr/http-factory-implementation lists `guzzle/psr7` but this is a wrong solution: no tagged release of it is PSR17-compatible, which means installing it doesn't solve the issue.
Commits
-------
96e70a4080 [HttpClient] fix exception in case of PSR17 discovery failure
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Form] derive the view timezone from the model timezone
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#32805
| License | MIT
| Doc PR |
Commits
-------
ef5835d833 derive the view timezone from the model timezone
This PR was merged into the 4.4 branch.
Discussion
----------
[DependencyInjection] Handle ServiceClosureArgument for callable in container linting
| Q | A
| ------------- | ---
| Branch? | 4.4 (+)
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | (none)
| License | MIT
Making use of `ServiceClosureArgument` instances in service definitions was not accounted for in container linting when a service type-hints for `callable` in an argument - adding this check ensures that `ServiceClosureArgument` instances are recognised correctly as callables (once they are resolved).
Commits
-------
e48829e9b6 [DependencyInjection] Handle ServiceClosureArgument for callable in container linting
* 5.0:
Fix closing tag in mailer collector template
[Notifier] Fix two minor issues
[HttpClient] Don't read from the network faster than the CPU can deal with
[DI] DecoratorServicePass should keep container.service_locator on the decorated definition
* 4.4:
Fix closing tag in mailer collector template
[HttpClient] Don't read from the network faster than the CPU can deal with
[DI] DecoratorServicePass should keep container.service_locator on the decorated definition
This PR was merged into the 4.4 branch.
Discussion
----------
[WebProfilerBundle] Fix closing tag in mailer collector template
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
<!--
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):
- 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
-------
c2d2e5a61d Fix closing tag in mailer collector template
* 4.3:
[HttpClient] Don't read from the network faster than the CPU can deal with
[DI] DecoratorServicePass should keep container.service_locator on the decorated definition
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] Don't read from the network faster than the CPU can deal with
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Something I spotted while working on #35115: both the curl and native clients don't play well with heavily compressed HTTP streams: they decompress faster than userland can process chunks.
The attached patch moves the decompression logic to the chunk generator. This means internally we only deal with raw compressed chunks, and they are decompressed only when passing the value to userland.
Commits
-------
ac3d77a76a [HttpClient] Don't read from the network faster than the CPU can deal with
* 5.0: (31 commits)
[HttpClient] NativeHttpClient should not send >1.1 protocol version
[HttpClient] fix support for non-blocking resource streams
[Mailer] Make sure you can pass custom headers to Mailgun
[Mailer] Remove line breaks in email attachment content
Update links to documentation
[Validator] Add the missing translations for the Arabic (ar) locale
ensure to expect no validation for the right reasons
[Security-Guard] fixed 35203 missing name tag in param docblock
[HttpClient] fix casting responses to PHP streams
[PhpUnitBridge] Add test case for @expectedDeprecation annotation
[PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack
[FrameworkBundle] Fix getUser() phpdoc in AbstractController
[Mailer] Fix addresses management in Sendgrid API payload
[Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API
[Mailer][MailchimpBridge] Fix incorrect sender address when sender has name
[HttpClient] fix capturing SSL certificates with NativeHttpClient
Update year in license files
Update year in license files
[TwigBridge][Form] Added missing help messages in form themes
Update year in license files
...
This PR was merged into the 5.0 branch.
Discussion
----------
[FrameworkBundle] Fix getUser() phpdoc in AbstractController
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#35185
| License | MIT
| Doc PR | N/A
This imports the `Symfony\Component\Security\Core\User\UserInterface` as the docs state that it returns `UserInterface` but doesn't use a FQN or import the class. This makes `getUser()` appear to return `Symfony\Bundle\FrameworkBundle\Controller\UserInterface`
Commits
-------
bba9fd6ccf [FrameworkBundle] Fix getUser() phpdoc in AbstractController
This PR was merged into the 5.0 branch.
Discussion
----------
Update year in license files
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Happy new year Notifier and String
Commits
-------
ef4426ae87 Update year in license files
* 4.4: (26 commits)
[HttpClient] NativeHttpClient should not send >1.1 protocol version
[HttpClient] fix support for non-blocking resource streams
[Mailer] Make sure you can pass custom headers to Mailgun
[Mailer] Remove line breaks in email attachment content
Update links to documentation
[Validator] Add the missing translations for the Arabic (ar) locale
ensure to expect no validation for the right reasons
[Security-Guard] fixed 35203 missing name tag in param docblock
[HttpClient] fix casting responses to PHP streams
[PhpUnitBridge] Add test case for @expectedDeprecation annotation
[PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack
[Mailer] Fix addresses management in Sendgrid API payload
[Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API
[Mailer][MailchimpBridge] Fix incorrect sender address when sender has name
[HttpClient] fix capturing SSL certificates with NativeHttpClient
Update year in license files
[TwigBridge][Form] Added missing help messages in form themes
Update year in license files
Update year in license files
fix version when "anonymous: lazy" was introduced
...
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] NativeHttpClient should not send >1.1 protocol version
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
8b61c95685 [HttpClient] NativeHttpClient should not send >1.1 protocol version
This PR was merged into the 4.4 branch.
Discussion
----------
[SecurityBundle] fix version when "anonymous: lazy" was introduced
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
c280a01724 fix version when "anonymous: lazy" was introduced
This PR was merged into the 4.4 branch.
Discussion
----------
Update year in license files
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Happy new year ErrorHandler
Commits
-------
500a075673 Update year in license files
* 4.3:
[Mailer] Remove line breaks in email attachment content
Update links to documentation
[Validator] Add the missing translations for the Arabic (ar) locale
ensure to expect no validation for the right reasons
[PhpUnitBridge] Add test case for @expectedDeprecation annotation
[PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack
[Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API
[Mailer][MailchimpBridge] Fix incorrect sender address when sender has name
[HttpClient] fix capturing SSL certificates with NativeHttpClient
[TwigBridge][Form] Added missing help messages in form themes
Update year in license files
Update year in license files
[HttpClient] fix typo
[Console][FormatterHelper] Use helper strlen statically and remove duplicated code
[Routing] Fix i18n routing when the url contains the locale
Fix BC issue in phpDoc Reflection library
[Translator] Performance improvement in MessageCatalogue and catalogue operations.
This PR was squashed before being merged into the 4.3 branch.
Discussion
----------
[Mailer] Remove line breaks in email attachment content
Line breaks are not allowed in attachment content when sending over the
API.
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33671, Closes#32645
| License | MIT
| Doc PR |
This is a fix for #33671. Send grid's API throws a 400 error when sending email attachments with default base64 encoding.
Removing the line breaks resolves this issue.
Commits
-------
a28a7f9dee [Mailer] Remove line breaks in email attachment content
This PR was merged into the 4.3 branch.
Discussion
----------
[Routing] Fix i18n routing when the url contains the locale
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/34469
| License | MIT
| Doc PR | -
This PR fixes different scenarios with i18n routing.
Commits
-------
cd40bb8604 [Routing] Fix i18n routing when the url contains the locale
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] fix casting responses to PHP streams
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This patch is required to properly deal with casting responses to PHP streams.
This changes a public method, but we can't expect anyone to override it as it's totally internal.
Found when working on (and required by) #35115
Commits
-------
35c08ef395 [HttpClient] fix casting responses to PHP streams
This PR was merged into the 4.3 branch.
Discussion
----------
Update year in license files
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Happy new year new components ;-)
Commits
-------
0d7a8bdd0a Update year in license files
* 3.4:
Update links to documentation
[Validator] Add the missing translations for the Arabic (ar) locale
ensure to expect no validation for the right reasons
[PhpUnitBridge] Add test case for @expectedDeprecation annotation
Update year in license files
[Console][FormatterHelper] Use helper strlen statically and remove duplicated code
Fix BC issue in phpDoc Reflection library
[Translator] Performance improvement in MessageCatalogue and catalogue operations.
This PR was merged into the 3.4 branch.
Discussion
----------
[PropertyInfo] Fix BC issue in phpDoc Reflection library
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#35077
| License | MIT
The used phpDocumentor library DocBlockReflection contained a BC break
that broke this component. The patch was applied in the recently released v4.3.4
version. But since it is unclear how long this issue existed it is not possible
to exclude a certain version. Therefor also `\RuntimeExpception` needs to be caught.
The BC break is possibly caused by a change in the TypeResolver library used by the
DocBlockReflection which is now supporting the more popular generics notation for arrays.
This PR might need some tests but the current test cases are not very clear to me. Instead of patching the code we could also try to ban the broken versions of the used phpdoc libraries, but that would require much more testing, and doesn't really add any value. Especially because the DocBlockReflection and TypeResolver are used by over half a million projects. It would raise more questions than just patching the behavior of the PropertyInfo component.
We are sorry that this issue slipt through our QA pipeline. The linked issue already showed that the issue is now fixed by just doing a `composer update` but it is not very convenient to leave this known issue in symfony.
Commits
-------
bad07ec557 Fix BC issue in phpDoc Reflection library
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] ensure to expect no validation for the right reasons
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
8d46f95f4c ensure to expect no validation for the right reasons
This PR was merged into the 3.4 branch.
Discussion
----------
Update year in license files
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Happy new year to everyone
Commits
-------
889a110e74 Update year in license files
This PR was merged into the 4.3 branch.
Discussion
----------
[Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Previous code tries to pass attachments to API, but uses incorrect structure and as a result all attachments are missing when the email is sent.
This also adds previously missing attachment names.
Commits
-------
7b1bbb6190 [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API
This PR was merged into the 3.4 branch.
Discussion
----------
[Translator] fix performance issue in MessageCatalogue and catalogue operations
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
In our project we use lots of catalogue operations during importing of translations to our system and we ran into performance issue. Code profiler showed lots or `array_replace` calls in [MessageCatalogue::add](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Translation/MessageCatalogue.php#L128) method. This method is actually called by [MessageCatalogue::set](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Translation/MessageCatalogue.php#L70), which is quite an overkill, because `MessageCatalogue::set` is meant to set only one translation at a time. Method was reworked. `MergeOperation` and `TargetOperation` was reworked as well to use this improved `MessageCatalogue::set` method instead of constructing array with only one translation and passing it to `MessageCatalogue::add` method.
Table shows execution time before and after
| | Time in seconds (avg. of 10 executions)
----------- | ------
Before | 50
After | 8
Looks like 4.* and 5.* versions can also be improved by the same changes.
<!--
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):
- 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
-------
5179af4796 [Translator] Performance improvement in MessageCatalogue and catalogue operations.
This PR was merged into the 5.0 branch.
Discussion
----------
[DebugBundle] Drop RemoveWebServerBundleLoggerPass
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
<!--
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):
- 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
-------
167411c194 [DebugBundle] Drop RemoveWebServerBundleLoggerPass
This PR was merged into the 5.0 branch.
Discussion
----------
doctrine/doctrine-bundle ^1.5 is not compatible with Symfony 5
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
4c790b0589 doctrine/doctrine-bundle ^1.5 is not compatible with Symfony 5
The used phpDocumentor library DocBlockReflection contained an BC break
that broke this component. The patch was applied in the recent released v4.3.4
version. But since it is unclear how long this issue existed it is not possible
to exclude a certain version. Therefor also `\RuntimeExpception` needs to be catched.
The BC break is possibly caused by a change in the TypeResolver library used by the
DocBlockReflection which is now supporting the more populair generics notation for arrays.
* 5.0: (24 commits)
Removing unused variable
Fixed#35084
Add missing use statement
[HttpClient] fix scheduling pending NativeResponse
do not overwrite variable value
[Profiler] wording
Use spaces correctly to display options in DebugCommand
Add supported schemes doc blocks type
X-Accel Nginx URL updated
ticket-30197 [Validator] Add the missing translations for the Chinese (Taiwan) ("zh_TW") locale
Fixed test added in #35022
Use locale_parse for computing fallback locales
[Console] Fix filtering out identical alternatives when there is a command loader
[String][UnicodeString] Remove unneeded flag in chunk regex pattern
add note about HTTP status code change
Migrate server:log command away from WebServerBundle
[DependencyInjection][CheckTypeDeclarationsPass] Handle \Closure for callable
[Security] Fix missing defaults for auto-migrating encoders
bumped Symfony version to 5.0.3
updated VERSION for 5.0.2
...
* 4.4:
Fixed#35084
Add missing use statement
[HttpClient] fix scheduling pending NativeResponse
do not overwrite variable value
[Profiler] wording
Use spaces correctly to display options in DebugCommand
X-Accel Nginx URL updated
ticket-30197 [Validator] Add the missing translations for the Chinese (Taiwan) ("zh_TW") locale
Fixed test added in #35022
Use locale_parse for computing fallback locales
[Console] Fix filtering out identical alternatives when there is a command loader
add note about HTTP status code change
Migrate server:log command away from WebServerBundle
[DependencyInjection][CheckTypeDeclarationsPass] Handle \Closure for callable
[Security] Fix missing defaults for auto-migrating encoders
bumped Symfony version to 4.4.3
updated VERSION for 4.4.2
updated CHANGELOG for 4.4.2
* 4.3:
Fixed#35084
Add missing use statement
[HttpClient] fix scheduling pending NativeResponse
do not overwrite variable value
[Profiler] wording
Use spaces correctly to display options in DebugCommand
X-Accel Nginx URL updated
ticket-30197 [Validator] Add the missing translations for the Chinese (Taiwan) ("zh_TW") locale
Fixed test added in #35022
Use locale_parse for computing fallback locales
[Console] Fix filtering out identical alternatives when there is a command loader
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] fix scheduling pending NativeResponse
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
There must be one pending list per `ResponseStream` instance.
Currently, we start unrelated responses and this can lead to broken iterators when the unrelated response throws because it is a 3/4/5xx.
Commits
-------
a90a6c9c48 [HttpClient] fix scheduling pending NativeResponse
This PR was merged into the 4.3 branch.
Discussion
----------
[Cache] do not overwrite variable value
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#35030
| License | MIT
| Doc PR |
Commits
-------
e379dbbf21 do not overwrite variable value
* 3.4:
Add missing use statement
[Profiler] wording
X-Accel Nginx URL updated
ticket-30197 [Validator] Add the missing translations for the Chinese (Taiwan) ("zh_TW") locale
Fixed test added in #35022
Use locale_parse for computing fallback locales
[Console] Fix filtering out identical alternatives when there is a command loader
This PR was merged into the 4.4 branch.
Discussion
----------
Migrate server:log command away from WebServerBundle
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | #34657
| License | MIT
| Doc PR | NA
Duplicate ServerLogCommand in MonologBridge (currently in deprecated WebServerBundle) which does not have alternative in `symfony` bin.
Targeted 4.4 in order to provide a migration path to users.
Commits
-------
3bfa8dbb18 Migrate server:log command away from WebServerBundle
This PR was merged into the 3.4 branch.
Discussion
----------
[Translation] Use `locale_parse` for computing fallback locales
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
As done in this PR https://github.com/symfony/symfony/pull/24157 for the `Intl` component, the `Translation` component should use `locale_parse` as well when available.
It will allow to manage [BCP 47](https://tools.ietf.org/html/bcp47) locales, which is why it is considered a bugfix ([locale_set_default](https://www.php.net/manual/en/locale.setdefault.php) is using BCP 47 compliant locale).
As done with the forementioned PR, there is also a fallback to make it work with `-`.
Sadly, I think it will create some conflicts when merging it upstream since the modified code has changed little by little.
Commits
-------
3657c0e664 Use locale_parse for computing fallback locales
This PR was squashed before being merged into the 5.1-dev branch.
Discussion
----------
[Form] Added default `inputmode` attribute to Search, Email and Tel form types
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | no
| License | MIT
| Doc PR | no
There is an HTML5 attribute `inputmode`. See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode It is supported by most of mobile browsers.
There are such supported values for `inputmode`:
* `none`
* `text` (default value)
* `decimal`
* `numeric `
* `tel`
* `search`
* `email`
* `url`
The `url` inputmode is already implemented in UrlType https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/UrlType.php#L39
I propose to add `tel`, `search`, `email` as default form view attribute to the relevant form types. Why only these three? `url` is already implemented, `none` makes no sense as default value for any form type, `text` is a default input type for any browser.
`decimal` and `numeric` has different behaviour on iOS. iOS doesn't show `-` (minus) sign on keyboard for these input modes. Of course in cases, when only positive numbers are expected, it is normal. But it is not suitable as default value in Symfony form type. Developers can add this attribute manually in their forms, if they need only positive numbers.
But `search`, `tel` and `email` input modes don't have problems and can be added as default attributes to Symfony form types. This will improve user experience, while using web-sites developed on Symfony on mobile devices. I add it into the *Type classes inside `buildView` method, so it will be possible to override this parameter if needed.
If you are interested in how it looks like in mobile browsers, you can open this link https://inputmodes.com/ on you mobile device.
Here are screenshots, how mobile keyboard looks like on Android and iOS with using `inputmode` attribute.
## `tel` inputmode
![image](https://user-images.githubusercontent.com/815865/70866507-45256480-1f73-11ea-9e82-320ef0b978ab.png)
## `email` inputmode
![image](https://user-images.githubusercontent.com/815865/70866502-3a6acf80-1f73-11ea-8f4c-3e7faca47f54.png)
## `search` inputmode
![image](https://user-images.githubusercontent.com/815865/70866498-2cb54a00-1f73-11ea-9fdc-2bb8abed107d.png)
Commits
-------
dbc500feb7 [Form] Added default `inputmode` attribute to Search, Email and Tel form types
This PR was squashed before being merged into the 5.1-dev branch.
Discussion
----------
[FrameworkBundle] Remove env var table from AboutCommand
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | -
| Deprecations? | -
| Tickets | -
| License | MIT
| Doc PR | -
Fixed AboutCommand output by shortening environment variable value (replacing with `...`) to fit the screen width if the value is too long.
Right now all output is a mess if it does not fit in the terminal window.
Commits
-------
6962da93c1 [FrameworkBundle] Remove env var table from AboutCommand
This PR was merged into the 5.0 branch.
Discussion
----------
[String][UnicodeString] Remove unneeded flag in chunk regex pattern
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
The pattern cannot contain a `.`.
Commits
-------
dcb7c9a484 [String][UnicodeString] Remove unneeded flag in chunk regex pattern
This PR was merged into the 3.4 branch.
Discussion
----------
Fixed test added in #35022
| Q | A
| ------------- | ---
| Branch? | master for features / 3.4, 4.3, 4.4 or 5.0 for bug fixes <!-- see below -->
| Bug fix? | yes/no
| New feature? | yes/no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes/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 -->
<!--
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):
- 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
-------
6eeec7c270 Fixed test added in #35022
* 5.0:
[DependencyInjection] Fix binding tagged services to containers
[ProxyManager] fix generating proxies for root-namespaced classes
[DoctrineBridge] Cleanup 3.4 legacy
[DI] skip looking for config class when the extension class is anonymous
Fix typo
Docs - Update debug section of UPGRADE guides for 4.4 and 5.0 versions.
Fix invalid typehint for subject in is_granted Twig function
[Dotenv] FIX missing getenv
[HttpFoundation] fix pdo session handler for sqlsrv
[HttpClient][Psr18Client] Remove Psr18ExceptionTrait
[HttpKernel] ignore failuresgenerated by opcache.restrict_api
* 4.4:
[DependencyInjection] Fix binding tagged services to containers
[ProxyManager] fix generating proxies for root-namespaced classes
[DI] skip looking for config class when the extension class is anonymous
Fix typo
Docs - Update debug section of UPGRADE guides for 4.4 and 5.0 versions.
[Dotenv] FIX missing getenv
[HttpFoundation] fix pdo session handler for sqlsrv
[HttpClient][Psr18Client] Remove Psr18ExceptionTrait
[HttpKernel] ignore failuresgenerated by opcache.restrict_api
This PR was merged into the 4.4 branch.
Discussion
----------
[DependencyInjection] Fix binding tagged services to containers
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34913
| License | MIT
| Doc PR | -
We missed this part in #33623
Commits
-------
9d48ba4f11 [DependencyInjection] Fix binding tagged services to containers
* 4.3:
[ProxyManager] fix generating proxies for root-namespaced classes
[DI] skip looking for config class when the extension class is anonymous
Fix typo
[Dotenv] FIX missing getenv
[HttpClient][Psr18Client] Remove Psr18ExceptionTrait
* 3.4:
[ProxyManager] fix generating proxies for root-namespaced classes
[DI] skip looking for config class when the extension class is anonymous
Fix typo
[Dotenv] FIX missing getenv
This PR was merged into the 3.4 branch.
Discussion
----------
[DI] skip looking for config class when the extension class is anonymous
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34613
| License | MIT
| Doc PR | -
Commits
-------
1c7eda4649 [DI] skip looking for config class when the extension class is anonymous
This PR was merged into the 5.1-dev branch.
Discussion
----------
[DI] allow "." and "-" in env processor lines
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#34864
| License | MIT
| Doc PR | -
As explained in the linked issue, this is especially usefull with the `key` processor.
Commits
-------
231c505a47 [DI] allow "." and "-" in env processor lines
* 5.0:
[Config] improve perf of glob discovery when GLOB_BRACE is not available
use utf8mb4_bin to align code with documentation
[HttpClient] make pushed responses retry-able
[VarDumper] ignore failing __debugInfo()
* 4.4:
[Config] improve perf of glob discovery when GLOB_BRACE is not available
use utf8mb4_bin to align code with documentation
[HttpClient] make pushed responses retry-able
[VarDumper] ignore failing __debugInfo()
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] make pushed responses retry-able
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/orgs/symfony/projects/1#card-30499375
| License | MIT
| Doc PR | -
This moves the PUSH matching logic down so that the curl handle of pushed responses can be properly configured. This should make pushed requests retry-able when they fail just after the push-promise frame.
Commits
-------
c2864f65ab [HttpClient] make pushed responses retry-able
This PR was squashed before being merged into the 5.1-dev branch (closes#34548).
Discussion
----------
Added access decision strategy to respect voter priority
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | _will happily do if this is of interest/to be merged 🙃_
The priority-based access decision strategy will decide based on the first voter that does not abstain from the decision. Security voters can be registered with priority (`PriorityTaggedServiceTrait`), so a voter with higher priority can overrule other voters.
In [Contao CMS](https://github.com/contao/contao), the core system should provide security voters that provide the "default permissions", but extensions/bundles can override almost anything and therefore need to be able to override the core decision. None of the existing strategies allow for something like that.
/ping @chalasr @Toflar @leofeyer @ausi
#SymfonyHackday
Commits
-------
0b8028a0ec Added access decision strategy to respect voter priority
* 5.0:
[DI] Service locators can't be decorated
[HttpClient] force HTTP/1.1 when NTLM auth is used
[Validation][FrameworkBundle] Allow EnableAutoMapping to work without auto-mapping namespaces
[Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
[DI] fix auto-binding service providers to their service subscribers
[Mailer] fixed undefined index when sending mail
* 4.4:
[DI] Service locators can't be decorated
[HttpClient] force HTTP/1.1 when NTLM auth is used
[Validation][FrameworkBundle] Allow EnableAutoMapping to work without auto-mapping namespaces
[Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
[DI] fix auto-binding service providers to their service subscribers
[Mailer] fixed undefined index when sending mail
* 4.3:
[DI] Service locators can't be decorated
[Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
[DI] fix auto-binding service providers to their service subscribers
This PR was merged into the 4.3 branch.
Discussion
----------
[DI] fix auto-binding service providers to their service subscribers
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix https://github.com/orgs/symfony/projects/1#card-30503621
| License | MIT
| Doc PR | -
Spotted during a workshop at SymfonyLive Sao Paulo if I recall well :)
Commits
-------
6c2ceb0c44 [DI] fix auto-binding service providers to their service subscribers
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Fixed undefined index when sending via Mandrill API
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34892
| License | MIT
When a [Mandrill API send request](https://www.mandrillapp.com/api/docs/messages.JSON.html#method=send) is succesful, it returns an array of results, one for each recipient. To get rid of the undefined index error, we grab the message ID from the first recipient in the array.
Commits
-------
ef0aa4dc87 [Mailer] fixed undefined index when sending mail
This PR was squashed before being merged into the 4.3 branch.
Discussion
----------
[DI] Service locators can't be decorated
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | n/a
This popped up while I was trying to update my work project as we have decorated the `messenger.receiver_locator` service. Not sure if this is a regression in DI or a change in messenger that caused the issue thus I'm not marking this as a BC break.
Exception while trying to compile the container:
```
Invalid definition for service "Symfony\Component\DependencyInjection\Tests\Compiler\DecoratedServiceLocator": an array of references is expected as first argument when the "container.service_locator" tag is set.
```
Expected result: service locator can be decorated.
Commits
-------
343282b9d4 [DI] Service locators can't be decorated
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] force HTTP/1.1 when NTLM auth is used
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
NTLM requires HTTP/1.1.
Commits
-------
0e87e9b960 [HttpClient] force HTTP/1.1 when NTLM auth is used
This PR was merged into the 5.1-dev branch.
Discussion
----------
[FrameworkBundle] Allow using the kernel as a registry of controllers and service factories
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#28992, fix#29997
| License | MIT
| Doc PR | -
This PR builds on #34873 and #34872 and allows using the `Kernel` as a registry of autowired controllers and service factories. The `ContainerConfigurator` passed to `configureContainer()` defaults to declaring autowired and autoconfigured services.
TL;DR: Silex is back but in a much more powerful way \o/
Here is a Kernel that just works and displays `Hello App\Foo` on the `/` route:
```php
class Kernel extends BaseKernel
{
use MicroKernelTrait;
protected function configureContainer(ContainerConfigurator $container): void
{
$container->services()
->load('App\\', '../src')
->set(Foo::class)
->factory([$this, 'createFoo']);
}
public function createFoo(Bar $bar)
{
return new Foo($bar);
}
protected function configureRoutes(RoutingConfigurator $routes): void
{
$routes->add('home', '/')->controller([$this, 'helloAction']);
}
public function helloAction(Foo $foo)
{
return new Response('Hello '.get_class($foo));
}
}
```
Commits
-------
9c9b99cc65 [FrameworkBundle] Allow using the kernel as a registry of controllers and service factories
This PR was merged into the 5.1-dev branch.
Discussion
----------
[EventDispatcher] Deprecate LegacyEventDispatcherProxy
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Tickets | Cleanup of #28920
| License | MIT
| Doc PR | N/A
> This class should be deprecated in Symfony 5.1
Well, here you go. 😃
Commits
-------
c7e612d4ad [EventDispatcher] Deprecate LegacyEventDispatcherProxy.
This PR was merged into the 4.3 branch.
Discussion
----------
[Validator] skip not applicable tests
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
227c38180f skip not applicable tests
This PR was merged into the 3.4 branch.
Discussion
----------
Use `::class` constants instead of `__NAMESPACE__` when possible
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Related to #34987
| License | MIT
| Doc PR | no
Form component has a lot of built-in form types. Some of them were implemented from the very beginning. In most of them there is a such method
```php
/**
* {@inheritdoc}
*/
public function getParent()
{
return __NAMESPACE__.'\TextType';
}
```
This `getParent()` method was refactored in Symfony 2.8. The upgrade instructions are given here https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.8.md#form
I think the `__NAMESPACE__.'\TextType';` expression was used because Symfony 2.8 was using `"php": ">=5.3.9"`, and the constant `::class` was added only in PHP 5.5
Now this line can be refactored into
```php
/**
* {@inheritdoc}
*/
public function getParent()
{
return TextType::class;
}
```
For example new form types, that were added later, already using the `::class` constant.
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/ColorType.php#L23https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/TelType.php#L23
So, in this pull request I propose to refactor all old form types to use `::class` constant. It will give a benefit during the future refactoring, because IDE or static analysers will find all usages of parent class. Unlike the `__NAMESPACE__.'\TextType';` line, which doesn't show the real link to the class for IDE or static analysers, and it could complicate finding all usages of parent class.
Commits
-------
32bf50abca Use `::class` constants instead of `__NAMESPACE__` when possible
* 5.0: (21 commits)
fix merge
CS
[FrameworkBundle][ContainerLintCommand] Improve messages when the kernel or the container is not supported
[Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer
stop using deprecated Doctrine persistence classes
[Cache] Fix wrong classname in deprecation message
Fix regex lookahead syntax in ApplicationTest
Fixed syntax in comment
[SecurityBundle][FirewallMap] Remove unused property
[Messenger][AMQP] Use delivery_mode=2 by default
[FrameworkBundle][DependencyInjection] Skip removed ids in the lint container command and its associated pass
[SECURITY] Revert "AbstractAuthenticationListener.php error instead info. Rebase of #28462"
[FrameworkBundle][Secrets] Hook configured local dotenv file
[DI] Improve performance of processDefinition
fix redis multi host dsn not recognized
fix constructor argument type declaration
Fix invalid Windows path normalization
[Validator][ConstraintValidator] Safe fail on invalid timezones
[DoctrineBridge] Fixed submitting invalid ids when using queries with limit
[FrameworkBundle] Add info & example to auto_mapping config
...
* 4.4: (21 commits)
fix merge
CS
[FrameworkBundle][ContainerLintCommand] Improve messages when the kernel or the container is not supported
[Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer
stop using deprecated Doctrine persistence classes
[Cache] Fix wrong classname in deprecation message
Fix regex lookahead syntax in ApplicationTest
Fixed syntax in comment
[SecurityBundle][FirewallMap] Remove unused property
[Messenger][AMQP] Use delivery_mode=2 by default
[FrameworkBundle][DependencyInjection] Skip removed ids in the lint container command and its associated pass
[SECURITY] Revert "AbstractAuthenticationListener.php error instead info. Rebase of #28462"
[FrameworkBundle][Secrets] Hook configured local dotenv file
[DI] Improve performance of processDefinition
fix redis multi host dsn not recognized
fix constructor argument type declaration
Fix invalid Windows path normalization
[Validator][ConstraintValidator] Safe fail on invalid timezones
[DoctrineBridge] Fixed submitting invalid ids when using queries with limit
[FrameworkBundle] Add info & example to auto_mapping config
...
* 4.3:
fix merge
CS
[Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer
stop using deprecated Doctrine persistence classes
[Cache] Fix wrong classname in deprecation message
Fix regex lookahead syntax in ApplicationTest
Fixed syntax in comment
[SecurityBundle][FirewallMap] Remove unused property
[Messenger][AMQP] Use delivery_mode=2 by default
[DI] Improve performance of processDefinition
Fix invalid Windows path normalization
[Validator][ConstraintValidator] Safe fail on invalid timezones
[DoctrineBridge] Fixed submitting invalid ids when using queries with limit
[FrameworkBundle] Add info & example to auto_mapping config
fix comparisons with null values at property paths
This PR was merged into the 3.4 branch.
Discussion
----------
CS for AccessDecisionManager
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | #34548
| License | MIT
| Doc PR | -
As discussed in #34548 with @nicolas-grekas here's a CS change for the `AccessDecisionManager`
Commits
-------
b3742ec493 CS
This PR was merged into the 4.3 branch.
Discussion
----------
[FrameworkBundle] Add info & example to auto_mapping config
| Q | A
| ------------- | ---
| Branch? | 4.3 <!-- see below -->
| Bug fix? | no
| New feature? | no <!-- 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 | N/A
Backport part of #34707 and add example.
Commits
-------
8eb29a7b73 [FrameworkBundle] Add info & example to auto_mapping config
This PR was merged into the 3.4 branch.
Discussion
----------
[DoctrineBridge] Fixed submitting invalid ids when using queries with limit
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#31559 <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | ~
<!--
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):
- 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
-------
09bb1e49d8 [DoctrineBridge] Fixed submitting invalid ids when using queries with limit
This PR was squashed before being merged into the 3.4 branch (closes#34791).
Discussion
----------
[Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | n/a
When trying to read from an uninitialized property in PHP 7.4, a `TypeError` is generated, see https://wiki.php.net/rfc/typed_properties_v2#uninitialized_and_unset_properties. This PR fixes the issue.
Commits
-------
1ed8e42d15 [Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger][AMQP] Use delivery_mode=2 by default
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34685
| License | MIT
| Doc PR |
Commits
-------
be2eb6fcc7 [Messenger][AMQP] Use delivery_mode=2 by default
This PR was merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle] Fix invalid Windows path normalization in TemplateNameParser
| Q | A
| ------------- | ---
| Branch? | 3.4 - <5.0
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | no
| License | MIT
| Doc PR | Fix invalid Windows path normalization
All versions of Symfony until 5.0 (which does no longer do extra file path normalization) normalize Windows paths wrongly.
See https://github.com/PrestaShop/PrestaShop/issues/16736 and https://bugs.php.net/bug.php?id=78939
Currently this issue can be observed when Symfony is run by NTS PHP only, but once the PHP issue will be fixed, this issue will probably affects all Windows users when absolute template name is passed to Symfony templating.
Commits
-------
130df8ca8c Fix invalid Windows path normalization
This PR was merged into the 3.4 branch.
Discussion
----------
[DI] Improve performance of processDefinition
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | kind of
| New feature? | no
| Deprecations? | no
| Tickets | no
| License | MIT
| Doc PR |
Saves some time during container compilation by instantiating the reflection class only once. In my case this speeds up container compilation in dev mode by ~10% (saves almost 100k calls to `getReflectionClass`).
Tests still run locally and my compiled container was identical pre and post change, but I found this improvement by Blackfire profiling and am not familiar with the surrounding code, so it would be great if someone could doublecheck if the change causes problems.
Commits
-------
41b56eac29 [DI] Improve performance of processDefinition
This PR was merged into the 3.4 branch.
Discussion
----------
Fix regex lookahead syntax in ApplicationTest
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no (test fix)
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
`(?>!1)` is actually an atomic group for literal `!1`.
`(?!1)` is a negative lookahead assertion for literal `1`.
Commits
-------
cf1d7b2ed1 Fix regex lookahead syntax in ApplicationTest
This PR was merged into the 5.1-dev branch.
Discussion
----------
[FrameworkBundle] Added flex-compatible default implementations for `MicroKernelTrait::registerBundles()` and `getProjectDir()`
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
I think it's safe now to migrate some flex-based defaults from the recipe to the bundle.
No BC break here as all existing kernels already redefine this method.
Commits
-------
a689807387 [FrameworkBundle] Added flex-compatible default implementations for `MicroKernelTrait::registerBundles()` and `getProjectDir()`
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator][ConstraintValidator] Safe fail on invalid timezones
Co-authored-by: Scott Dawson <scott@loyaltycorp.com.au>
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/33901
| License | MIT
| Doc PR |
Alternative to https://github.com/symfony/symfony/pull/33902.
I will explain why I think it is better this way:
1. We set the timezone with the setter because it's 100% safe, it never fails. It fall backs to the default timezone if the provided timezone is not supported (as if we passed null, so the same behavior that always existed). We are therefore compatible with all edge cases.
2. We don't validate the timezone with `\DateTimeZone::listIdentifiers()`. It only returns full identifiers like "Europe/Paris" but it doesn't take into account "numeric" identifiers such as "+08:00" which are perfectly valid. I added a test case to ensure we stay valid with this case. + some invalid identifiers for the native `\IntlDateFormatter` are valid with the polyfill that uses `\DateTimeZone` (eg : `X`). I don't think we can validate anything safely that will work reliably on both implementations.
Commits
-------
3b1b994cb3 [Validator][ConstraintValidator] Safe fail on invalid timezones
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle][DependencyInjection] Skip removed ids in the lint container command and its associated pass
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/34858
| License | MIT
| Doc PR | -
We remove the "removing" passes again and to avoid what https://github.com/symfony/symfony/pull/34502 fixed, we skip validating the "live" container removed ids in the pass (the "live" container is supposed to have the same definitions than the "debug container" one).
Logically, an errored service cannot pass the "live" container compilation without being removed. Consequently, it also skips the errored services that ended up being removed in the "live" container.
Commits
-------
a0f581ba9d [FrameworkBundle][DependencyInjection] Skip removed ids in the lint container command and its associated pass
This PR was squashed before being merged into the 5.1-dev branch.
Discussion
----------
[DI] Add support for defining method calls in InlineServiceConfigurator
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR | N/A
Commits
-------
5af6e21529 [DI] Add support for defining method calls in InlineServiceConfigurator
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle][Secrets] Hook configured local dotenv file
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/34905
| License | MIT
| Doc PR | -
Configured local_dotenv_file does not currently substitute the secrets.vault service definition first argument value, rendering this configuration option useless + we don't need to set defaults in secrets.xml since everything is overriden in FrameworkExtension with the same default values (from the configuration).
Commits
-------
56f542c36b [FrameworkBundle][Secrets] Hook configured local dotenv file
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpFoundation] fix redis multi host dsn not recognized
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34477
| License | MIT
#34177 added support configurating session handlers with DSNs. It was no possible to pass a redis-DSN like
`redis:?host[localhost]&host[localhost:6379]&host[/var/run/redis.sock:]&auth=my-password&redis_cluster=1'`
since the check was
`case 0 === strpos($connection, 'redis://'):`
Commits
-------
81ba07aa26 fix redis multi host dsn not recognized
When a Mandrill API request is succesful, it returns an array of
results, one for each recipient. To get rid of the undefined index
error, we grab the message ID from the first recipient in the array.
* 5.0:
Fix merge
[DoctrineBridge] try to fix deprecations from doctrine/persistence
[DI] Add support for immutable setters in CallTrait
[Cache] Propagate expiry when syncing items in ChainAdapter
Removed request header "Content-Type" from the preferred format guessing mechanism
[Routing] fix memoryleak when loading compiled routes
[Translation] fix memoryleak in PhpFileLoader
fix triggering deprecation in file locator
bug #34877 [TwigBundle] fix findTemplate() to return `null`
* 4.4:
Fix merge
[DoctrineBridge] try to fix deprecations from doctrine/persistence
[DI] Add support for immutable setters in CallTrait
[Cache] Propagate expiry when syncing items in ChainAdapter
Removed request header "Content-Type" from the preferred format guessing mechanism
[Routing] fix memoryleak when loading compiled routes
[Translation] fix memoryleak in PhpFileLoader
fix triggering deprecation in file locator
bug #34877 [TwigBundle] fix findTemplate() to return `null`
* 4.3:
Fix merge
[DoctrineBridge] try to fix deprecations from doctrine/persistence
[DI] Add support for immutable setters in CallTrait
[Cache] Propagate expiry when syncing items in ChainAdapter
[Routing] fix memoryleak when loading compiled routes
[Translation] fix memoryleak in PhpFileLoader
This PR was merged into the 4.3 branch.
Discussion
----------
[DI] Fix support for immutable setters in CallTrait
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR | N/A
Commits
-------
90ace51328 [DI] Add support for immutable setters in CallTrait
This PR was merged into the 4.4 branch.
Discussion
----------
[TwigBundle] fix broken FilesystemLoader::exists() with Twig 3
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34877
| License | MIT
| Doc PR |
This fix adapts the declaration of Twig 3 `\Twig\Loader\FilesystemLoader::findTemplate()` which expects to return `string|null` and returns `null` instead of `false`.
Returning `false` breaks `\Twig\Loader\FilesystemLoader::exists()` which returns `true` if `findTemplate()` does not return `null`.
Twig 2 should not be affected by this patch. The `exists()` method expects `null` or `false` for not found templates: <fdb691a424/src/Loader/FilesystemLoader.php (L169)>
Commits
-------
ff1d77e155 bug #34877 [TwigBundle] fix findTemplate() to return `null`
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpFoundation] Removed "Content-Type" from the preferred format guessing mechanism
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34906, Fix#34857
| License | MIT
| Doc PR | -
Confirmed, inferring the `Content-Type` of the response using the `Content-Type` provided for the request body is NOT a good idea. The HTTP RFC explicitly states that `Accept` must be used to hint a preferred response format (`Content-Type` on the request indicates the type of associated its the body).
Use `Accept` if provided (a best practice anyway), and fallback to the default value (HTML by default) otherwise.
Commits
-------
776523e56a Removed request header "Content-Type" from the preferred format guessing mechanism
This PR was merged into the 3.4 branch.
Discussion
----------
[Translation] fix memoryleak in PhpFileLoader
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This happens when running the test suite with opcache disabled (as it is the case by default since `opcache.enable_cli=0`).
Doing this "require" in a loop (for each test case) compiles the file at each iteration and doesn't reclaim memory (there is no garbage collector for opcodes).
Commits
-------
5c9e3bac96 [Translation] fix memoryleak in PhpFileLoader
This PR was merged into the 4.3 branch.
Discussion
----------
[Routing] fix memoryleak when loading compiled routes
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Same as #34918 for Routing. That's the last significant memory hog I've identified.
Commits
-------
85371a174e [Routing] fix memoryleak when loading compiled routes
Twig3 FilesystemLoader::findTemplate() should return `string|null`
instead of Twig2 `string|null|false`: see
<https://github.com/twigphp/Twig/blob/3.x/src/Loader/FilesystemLoader.php#L167>
Returning `null` fixes `exists()` of Twig 3 FilesystemLoader without
breaking Twig 2 (which expected `null` or `false` for not found
templates).
Change the test to assert `null` instead of `false`.
* 5.0:
[Validator] Fix auto-mapping constraints should not be validated
[Debug] Updated the README to deprecate the component
[Cache] fix memory leak when using PhpFilesAdapter
[Yaml] Implement multiline string as scalar block for tagged values
[HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
[FrameworkBundle] Use UserInterface to @return in getUser method
[CI] Replace php7.4snapshot with php7.4 in Travis configuration
[ExpressionLanguage][Node][BinaryNode] Process division by zero
Fixing bad order of operations with null coalescing operator
forward caught exception
[Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
add tags before processing them
[FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared
[Process] change the syntax of portable prepared command lines
[MonologBridge] Fix debug processor datetime type
* 4.4:
[Validator] Fix auto-mapping constraints should not be validated
[Debug] Updated the README to deprecate the component
[Cache] fix memory leak when using PhpFilesAdapter
[Yaml] Implement multiline string as scalar block for tagged values
[HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
[FrameworkBundle] Use UserInterface to @return in getUser method
[CI] Replace php7.4snapshot with php7.4 in Travis configuration
[ExpressionLanguage][Node][BinaryNode] Process division by zero
Fixing bad order of operations with null coalescing operator
forward caught exception
[Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
add tags before processing them
[FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared
[Process] change the syntax of portable prepared command lines
[MonologBridge] Fix debug processor datetime type
This PR was merged into the 4.4 branch.
Discussion
----------
[Debug] Updated the README to deprecate the component
| 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 | https://github.com/symfony/symfony-docs/issues/12775
| License | MIT
| Doc PR | -
Commits
-------
ab9e0eb2f5 [Debug] Updated the README to deprecate the component
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[Validator] Fix auto-mapping constraints should not be validated
| 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 | #34672 <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | N/A
As for `Traverse`, I don't think we should add these "constraints" to the list.
I'm also wondering if it really makes sense to have these annotations as constraints. I think it should rather behave like the `GroupSequence` annotation to add the info the generic metadata at loading time, but we don't need to rely on the constraints behavior at all.
Commits
-------
bc53e4bca0 [Validator] Fix auto-mapping constraints should not be validated
This PR was merged into the 4.4 branch.
Discussion
----------
[Process] change the syntax of portable command lines
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34838
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/12772
An alternative to #34845
Right now, portable command lines use `"$FOO"` for placeholders.
But because we validate that a corresponding variable exists before running the command, this fails with `Command line is missing a value for key "$FOO"` when `FOO` is not defined.
This PR proposes to use `"${:FOO}"` instead. The difference with the previous syntax is that this cannot collide with existing shell scripts as it is invalid for them.
When this is merged, we'll have to update https://symfony.com/blog/new-in-symfony-4-1-prepared-commands too.
Commits
-------
3c7b775b3e [Process] change the syntax of portable prepared command lines
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Some bundles extensions are "instances dependents", eg they cache service registrations (eg: 70dec3c8a3/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php (L743)).
Launching the lint command loads all bundles a first time, just to be able to run the command.
Then, when we build the container again for the lint command, it loads all bundles a second time. But since it's the same bundles instances, some services are not registered, leading to missing services in `CheckExceptionOnInvalidReferenceBehaviorPass`.
Commits
-------
31975e4981 [FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared
* 4.3:
[Cache] fix memory leak when using PhpFilesAdapter
[Yaml] Implement multiline string as scalar block for tagged values
[HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
[FrameworkBundle] Use UserInterface to @return in getUser method
[CI] Replace php7.4snapshot with php7.4 in Travis configuration
[ExpressionLanguage][Node][BinaryNode] Process division by zero
forward caught exception
[Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
add tags before processing them
[MonologBridge] Fix debug processor datetime type
* 3.4:
[Yaml] Implement multiline string as scalar block for tagged values
[HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
[FrameworkBundle] Use UserInterface to @return in getUser method
[CI] Replace php7.4snapshot with php7.4 in Travis configuration
[ExpressionLanguage][Node][BinaryNode] Process division by zero
forward caught exception
[Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
add tags before processing them
[MonologBridge] Fix debug processor datetime type
This PR was merged into the 4.3 branch.
Discussion
----------
[Cache] fix memory leak when using PhpFilesAdapter
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34687
| License | MIT
| Doc PR | -
Similar to #34839 but for `PhpFilesAdapter`, as the "appendOnly" mode is a v4-only feature.
Commits
-------
0b46226648 [Cache] fix memory leak when using PhpFilesAdapter
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
This is really nit-picking: The conservative, safe default for `Cache-Control` is `private, no-cache` which means the response must not be served from cache unless it has been validated.
If `Last-Modified` or `Expires` are present, we can relax `no-cache` to be `must-revalidate`, which means that _once the response has become stale_, it must be revalidated.
An `ETag` alone does not give the response a lifetime, so IMO sticking with `no-cache` in this case would be more consistent.
Commits
-------
1b1002b426 [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[Yaml] Implement multiline string as scalar block for tagged values
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
At the moment you can parse a tagged value defined as a scalar block. But you can't actually dump a multiline string as scalar block when using a tagged value.
This PR implements the multiline string as scalar block for tagged values as well.
Commits
-------
84241d4e62 [Yaml] Implement multiline string as scalar block for tagged values
This PR was merged into the 3.4 branch.
Discussion
----------
[MonologBridge] Fix debug processor datetime type
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |n/a
| License | MIT
| Doc PR | n/a
This PR fixes an eventual `Call to a member function getTimestamp() on string` if any Processor transforms the `datetime` value, and uses the same record conditions as in the [ConsoleFormatter](https://github.com/symfony/monolog-bridge/blob/master/Formatter/ConsoleFormatter.php#L118 )
Commits
-------
ffe3f10780 [MonologBridge] Fix debug processor datetime type
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle] Use UserInterface to @return in getUser method
| 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 -->
| License | MIT
<!--
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):
- 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
-------
9f1ebd7fb9 [FrameworkBundle] Use UserInterface to @return in getUser method
This PR was merged into the 3.4 branch.
Discussion
----------
[ExpressionLanguage] Process division by zero
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
To be able to catch the error in expression like ` 1 / 0`
**Before PR:**
```
try {
1 / 0;
} catch (\Throwable $e) {
// It won't be caught anyway
// PHP Warning: Division by zero in...
}
try {
1 % 0;
} catch (\Throwable $e) {
// It will be caught since PHP7
// \DivisionByZeroError with message `Modulo by zero`
}
```
**After PR:**
```
try {
1 / 0;
} catch (\Throwable $e) {
// It will be caught
// \DivisionByZeroError with message `Division by zero`
}
try {
1 % 0;
} catch (\Throwable $e) {
// It will be caught
// \DivisionByZeroError with message `Modulo by zero`
}
```
Commits
-------
02ab72ab30 [ExpressionLanguage][Node][BinaryNode] Process division by zero
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Since we format the \DateTimeImmutable with the "e" character, it uses this timezone identifier and do not consider the passed one. See https://www.php.net/manual/en/datetime.construct.php:
> The $timezone parameter and the current timezone are ignored when the $time parameter either is a UNIX timestamp (e.g. @946684800) or specifies a timezone (e.g. 2010-01-28T15:00:00+02:00).
Commits
-------
03dbcf8794 [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
* 5.0: (38 commits)
[Security] Check UserInterface::getPassword is not null before calling needsRehash
gracefully handle missing event dispatchers
Fix TokenStorage::reset not called in stateless firewall
[DotEnv] Remove `usePutEnv` property default value
[HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists
Set up typo fix
[DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass
[Cache] fix memory leak when using PhpArrayAdapter
[Validator] Allow underscore character "_" in URL username and password
[TwigBridge] Update bootstrap_4_layout.html.twig
[DoctrineBridge] Removed QueryBuilder type hint in getLoader()
[FrameworkBundle][SodiumVault] Create secrets directory only when needed
fix parsing negative octal numbers
[String] implement __sleep()/__wakeup() on strings
Fixed translations file dumper behavior
[Routing][ObjectLoader] Remove forgotten deprecation after merge
[SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
[DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass
[SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass
do not validate passwords when the hash is null
...
* 4.4: (30 commits)
[Security] Check UserInterface::getPassword is not null before calling needsRehash
gracefully handle missing event dispatchers
Fix TokenStorage::reset not called in stateless firewall
[DotEnv] Remove `usePutEnv` property default value
[HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists
Set up typo fix
[DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass
[Cache] fix memory leak when using PhpArrayAdapter
[Validator] Allow underscore character "_" in URL username and password
[TwigBridge] Update bootstrap_4_layout.html.twig
[FrameworkBundle][SodiumVault] Create secrets directory only when needed
fix parsing negative octal numbers
[SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
[DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass
[SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass
do not validate passwords when the hash is null
[DI] fix resolving bindings for named TypedReference
[Config] never try loading failed classes twice with ClassExistenceResource
[Mailer] Fix SMTP Authentication when using STARTTLS
[DI] Fix making the container path-independent when the app is in /app
...
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Fix SMTP Authentication when using STARTTLS
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34522
| License | MIT
When the mail server uses STARTTLS, the SMTP Authentication is not performed because the AUTH capabilities are not send during the first EHLO call, but during the second one.
Example of problematic exchange solved by this PR:
```
< 220 mydomain.tld ESMTP Postcow
> EHLO [127.0.0.1]
< 250-mydomain.tld
< 250-PIPELINING
< 250-SIZE 104857600
< 250-ETRN
< 250-STARTTLS
< 250-ENHANCEDSTATUSCODES
< 250-8BITMIME
< 250-DSN
< 250 CHUNKING
> STARTTLS
< 220 2.0.0 Ready to start TLS
> EHLO [127.0.0.1]
< 250-mydomain.tld
< 250-PIPELINING
< 250-SIZE 104857600
< 250-ETRN
< 250-AUTH PLAIN LOGIN
< 250-AUTH=PLAIN LOGIN
< 250-ENHANCEDSTATUSCODES
< 250-8BITMIME
< 250-DSN
< 250 CHUNKING
> MAIL FROM:<noreply@XXX>
< 250 2.1.0 Ok
> RCPT TO:<XXX>
< 554 5.7.1 <XXX>: Client host rejected: Access denied
```
Commits
-------
75b54542ab [Mailer] Fix SMTP Authentication when using STARTTLS
This PR was merged into the 5.1-dev branch.
Discussion
----------
[DependencyInjection] Autowire public typed properties
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| License | MIT
### Description
This PR adds the Autowiring of **public typed properties** in PHP 7.4.
It is only on "public" properties.
It could let people think that services are better injected in "public".
I don't know what to think about it, you?
### How about "private" properties - further thinking
Even if I think that it would be awesome to be able to inject in "private" properties, we discussed it with @nicolas-grekas, and I agree Symfony should not break any standard logic. If the property is private then it is private the DI cannot touch it.
But that could/would remove a lot of boilerplate, and if it is declarative, that might still be something to do.
Maybe we could introduce a new annotation for injection in "private": `@requiredPrivated` ?
Commits
-------
cad7fbb9f7 [DI] Autowire public typed properties
This PR was merged into the 4.4 branch.
Discussion
----------
[DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
A case we forgot to handle.
Commits
-------
c3574858b5 [DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass
This PR was merged into the 3.4 branch.
Discussion
----------
[Cache] fix memory leak when using PhpArrayAdapter
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34687
| License | MIT
| Doc PR | -
Thanks to @adrienfr, I've been able to understand what causes this massive memory leak when using `PhpArrayAdapter`:
![image](https://user-images.githubusercontent.com/243674/70262187-303b1b00-1794-11ea-9fcb-21ae29c31ff0.png)
When tests run, a new kernel is booted for each test case. This means a new instance of `PhpArrayAdapter` is created, which means it loads its state again and again using `include` for e.g. `annotations.php` in this example.
The first obvious thing is that we see this doing `compile::*`: this means PHP is parsing the same file again and again. But shouldn't opcache prevent this? Well, it's disabled by default because `opcache.enable_cli=0`. To prove the point, here is a comparison with the same tests run with `php -dopcache.enable_cli=1`. The comparison is swapped, but you'll get it:
![image](https://user-images.githubusercontent.com/243674/70262616-fb7b9380-1794-11ea-81c3-6fea0145a63b.png)
But that's not over: because of https://bugs.php.net/76982 (see #32236 also), we still have a memory leak when the included file contains closures. And this one does.
This PR fixes the issue by storing the return value of the include statement into a static property. This fits the caching model of `PhpArrayAdapter`: it's a read-only storage for system caches - i.e. its content is immutable.
Commits
-------
4194c4c56d [Cache] fix memory leak when using PhpArrayAdapter
This PR was merged into the 5.0 branch.
Discussion
----------
[String] implement __sleep()/__wakeup() on strings
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This resets the transient ignoreCase state on unserialized instances.
Commits
-------
416e40d943 [String] implement __sleep()/__wakeup() on strings
This PR was merged into the 5.0 branch.
Discussion
----------
[String] inline Latin-ASCII rules
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34751
| License | MIT
| Doc PR | -
Makes the component a bit more portable.
Commits
-------
976a938736 [String] inline Latin-ASCII rules
This PR was merged into the 3.4 branch.
Discussion
----------
[SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/34774
| License | MIT
| Doc PR | -
`%s` should be escaped, so it is dumped as `%%s` (it ends up being properly unescaped at load time, so the passed value to the service is the same).
Commits
-------
de03cee846 [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass
* 4.3:
[DotEnv] Remove `usePutEnv` property default value
Set up typo fix
[Validator] Allow underscore character "_" in URL username and password
[SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
do not validate passwords when the hash is null
[DI] fix resolving bindings for named TypedReference
[DI] Fix making the container path-independent when the app is in /app
Allow copy instead of symlink for ./link script
[FrameworkBundle] resolve service locators in `debug:*` commands
bumped Symfony version to 4.3.10
updated VERSION for 4.3.9
updated CHANGELOG for 4.3.9
bumped Symfony version to 3.4.37
updated VERSION for 3.4.36
update CONTRIBUTORS for 3.4.36
updated CHANGELOG for 3.4.36
Add test on ServerLogHandler
* 3.4:
[Validator] Allow underscore character "_" in URL username and password
[SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
do not validate passwords when the hash is null
[DI] Fix making the container path-independent when the app is in /app
Allow copy instead of symlink for ./link script
[FrameworkBundle] resolve service locators in `debug:*` commands
bumped Symfony version to 3.4.37
updated VERSION for 3.4.36
update CONTRIBUTORS for 3.4.36
updated CHANGELOG for 3.4.36
This PR was merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle] resolve service locators in `debug:*` commands
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34470
| License | MIT
| Doc PR | -
Because of the way ServiceClosureArgument are dumped, we need to resolve locators after loading the xml dump of the container:
https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php#L273
Commits
-------
820da66346 [FrameworkBundle] resolve service locators in `debug:*` commands
This PR was merged into the 5.0 branch.
Discussion
----------
[DoctrineBridge] Removed QueryBuilder type hint in getLoader()
| Q | A
| ------------- | ---
| Branch? | 5.0 <!-- 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 | ~
| License | MIT
| Doc PR | ~
<!--
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):
- 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.
-->
Follows #34600.
Commits
-------
8621852396 [DoctrineBridge] Removed QueryBuilder type hint in getLoader()
This PR was merged into the 4.3 branch.
Discussion
----------
[DI] fix resolving bindings for named TypedReference
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
As spotted in https://github.com/symfony/symfony/pull/34769#issuecomment-561064156
Commits
-------
62c227e368 [DI] fix resolving bindings for named TypedReference
This PR was merged into the 4.4 branch.
Discussion
----------
[DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/34752
| License | MIT
| Doc PR | -
One more case we forgot 😅
Commits
-------
b6c5a54cfd [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass
This PR was merged into the 5.0 branch.
Discussion
----------
[Routing][ObjectLoader] Remove forgotten deprecation after merge
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
https://github.com/symfony/symfony/pull/34621 needs to be gone on 5.0. We want to throw here. I think it was forgotten when merging in 5.0.
Commits
-------
4e60b9db22 [Routing][ObjectLoader] Remove forgotten deprecation after merge
* 4.4:
Fixed translations file dumper behavior
When set, get secret from config variable
[FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand
[SecurityBundle] Fix switch_user provider configuration handling
This PR was merged into the 4.4 branch.
Discussion
----------
[SecurityBundle] Use config variable in AnonymousFactory
| Q | A
| ------------- | ---
| Branch? | 4.4 and 5.0
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
It looks like the `AnonymousFactory` was copied incorrectly in https://github.com/symfony/symfony/pull/33503 as it uses the old `$firewall` variable available in `SecurityExtension.php`. Changing this to `$config` yields the desired results
Commits
-------
8d850d2da4 When set, get secret from config variable
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix https://github.com/symfony/symfony/issues/34526, Closes#34767
| License | MIT
| Doc PR | -
Alternative to https://github.com/symfony/symfony/pull/34767, idea by @nicolas-grekas.
Commits
-------
e8d3c2b969 [FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand
* 5.0:
[Security/Core] Fix checking for SHA256/SHA512 passwords
[Cache][Lock] fix tests
bumped Symfony version to 5.0.2
updated VERSION for 5.0.1
updated CHANGELOG for 5.0.1
bumped Symfony version to 4.4.2
updated VERSION for 4.4.1
updated CHANGELOG for 4.4.1
* 4.4:
[Security/Core] Fix checking for SHA256/SHA512 passwords
[Cache][Lock] fix tests
bumped Symfony version to 4.4.2
updated VERSION for 4.4.1
updated CHANGELOG for 4.4.1
This PR was merged into the 4.3 branch.
Discussion
----------
[MonologBridge] Add test on ServerLogHandler
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | /
| License | MIT
| Doc PR | /
After writing https://github.com/symfony/symfony/pull/34697#issuecomment-559840469 I realized that ServerLogHandler wasn't tested.
Tell me if it's a BugFix and should be rebased on 4.3
Commits
-------
8c7947f827 Add test on ServerLogHandler
This PR was merged into the 5.1-dev branch.
Discussion
----------
Deprecate *Response::create() methods
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | n/a<!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | -
The `::create()` methods of the `Response` class hierarchy are not needed anymore in modern PHP versions as we can use parenthesis around the new operator. So `Response::create()->...()` is equivalent to `(new Response)->...()`.
Let's deprecate the static method. It's also good as the first parameter type changes depending on the sub-class.
Commits
-------
ebb13e7c99 Deprecate *Response::create() methods
This PR was squashed before being merged into the 5.0 branch (closes#34539).
Discussion
----------
[Notifier] Add telegram tests
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | See #33687
| License | MIT
Adds tests for the Telegram bridge of the Notifier component. Not sure if this is the right way to go, but would love some feedback.
#SymfonyHackday
Commits
-------
3b4d83cb4a [Notifier] Add telegram tests
This PR was squashed before being merged into the 5.0 branch (closes#34549).
Discussion
----------
[Notifier] Add Slack bridge tests
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | See #33687
| License | MIT
Adds tests for the Slack bridge of the Notifier component.
#SymfonyHackday
Commits
-------
626fdaa9a4 [Notifier] Add Slack bridge tests
* 5.0:
[DI] auto-register singly implemented interfaces by default
[DI] fix overriding existing services with aliases for singly-implemented interfaces
remove service when base class is missing
do not depend on the QueryBuilder from the ORM
[Security/Http] call auth listeners/guards eagerly when they "support" the request
[Messenger] add tests to FailedMessagesShowCommand
Fix the translation commands when a template contains a syntax error
[Security] Fix clearing remember-me cookie after deauthentication
[Validator] Update Slovenian translations
[HttpClient] remove conflict rule with HttpKernel that prevents using the component in Symfony 3.4
[Config][ReflectionClassResource] Handle parameters with undefined constant as their default values
Fix compatibility with Monolog 2
fix dumping number-like string parameters
Fix CI
[Console] Fix autocomplete multibyte input support
[Config] don't break on virtual stack frames in ClassExistenceResource
more robust initialization from request
Changing the multipart form-data behavior to use the form name as an array, which makes it recognizable as an array by PHP on the $_POST globals once it is coming from the HttpClient component
* 4.4:
[DI] auto-register singly implemented interfaces by default
[DI] fix overriding existing services with aliases for singly-implemented interfaces
remove service when base class is missing
do not depend on the QueryBuilder from the ORM
[Security/Http] call auth listeners/guards eagerly when they "support" the request
[Messenger] add tests to FailedMessagesShowCommand
Fix the translation commands when a template contains a syntax error
[Security] Fix clearing remember-me cookie after deauthentication
[Validator] Update Slovenian translations
[HttpClient] remove conflict rule with HttpKernel that prevents using the component in Symfony 3.4
[Config][ReflectionClassResource] Handle parameters with undefined constant as their default values
fix dumping number-like string parameters
Fix CI
[Console] Fix autocomplete multibyte input support
[Config] don't break on virtual stack frames in ClassExistenceResource
more robust initialization from request
Changing the multipart form-data behavior to use the form name as an array, which makes it recognizable as an array by PHP on the $_POST globals once it is coming from the HttpClient component
* 4.3:
[Messenger] add tests to FailedMessagesShowCommand
Fix the translation commands when a template contains a syntax error
[Security] Fix clearing remember-me cookie after deauthentication
[Validator] Update Slovenian translations
[Config][ReflectionClassResource] Handle parameters with undefined constant as their default values
fix dumping number-like string parameters
Fix CI
[Console] Fix autocomplete multibyte input support
[Config] don't break on virtual stack frames in ClassExistenceResource
more robust initialization from request
This PR was merged into the 3.4 branch.
Discussion
----------
more robust initialization from request
Request::getPort is declared as int|string but can actually return null.
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
I discovered this problem with a functional test where i dispatch the RequestEvent with a `new Request()`. This used to work in symfony 4 and now triggers an error `Argument 1 passed to Symfony\Component\Routing\RequestContext::setHttpPort() must be of the type int, null given`
In regular web requests, this should probably never happen, but it seems to me if Request is not robust, the RequestContext should be robust about it.
Commits
-------
c6ed0f0208 more robust initialization from request
This PR was merged into the 4.4 branch.
Discussion
----------
[TwigBundle] remove service when base class is missing
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
c3a658ac0f remove service when base class is missing
This PR was merged into the 4.4 branch.
Discussion
----------
[Security/Http] call auth listeners/guards eagerly when they "support" the request
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34614, Fix#34679
| License | MIT
| Doc PR | -
This fixes the form authenticator linked to #34614.
Since laziness is here to provide compatibility with HTTP caching, it should be disabled when the request cannot be cached.
Tests don't pass yet, but I'm on the path to something here.
The PR now introduces a new `AbstractListener` that splits the handling logic in two:
- `supports(Request): ?bool` is always called eagerly and tells whether the listener matches the request for an earger call or a lazy call
- `authenticate(RequestEvent)` does the rest of the job when `supports()` allows so - lazily or not depending on the return value of `supports()`.
Of course, this remains compatible with non-lazy logics, see `AbstractListener::__invoke()`.
Commits
-------
b20ebe6b90 [Security/Http] call auth listeners/guards eagerly when they "support" the request
This PR was merged into the 3.4 branch.
Discussion
----------
[Security] Fix clearing remember-me cookie after deauthentication
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#26379
| License | MIT
| Doc PR | -
If you are using the `remember_me` listener and the refreshed user is deauthenticated, you are still logged in because the remember-me cookie does not get cleared.
This fixes it.
Commits
-------
d625a73705 [Security] Fix clearing remember-me cookie after deauthentication
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Mailer] Allow to configure or disable the message bus to use
| 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 | #34633 <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | todo
A new `mailer.message_bus` option allowing to choose the message bus to use instead of using the default one.
Also allows to set it to `false` so no message bus is used and the transport will be called directly.
Commits
-------
42fd0cf985 [Mailer] Allow to configure or disable the message bus to use
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Validator] Label regex in date validator
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | /
| License | MIT
| Doc PR |
This change makes sure that when extending the DateValidator you can easily change the format withouth changing anything else.
eg. you can change the pattern to
`/^(?<day>\d{2})/(?<month>\d{2})/(?<year>\d{4})$/` but the implementation still checks your date correctly.
Commits
-------
ec09f7e630 Label regex in date validator
This PR was merged into the 3.4 branch.
Discussion
----------
Fix the translation commands when a template contains a syntax error
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#34586
| License | MIT
| Doc PR | n/a
When using `debug:translation` or `translation:update`, we should catch exceptions to avoid breaking the command. It was not really an issue before Symfony 4.4/5 as we didn't have templates in the core that use features from optional dependencies.
Commits
-------
7f803bc674 Fix the translation commands when a template contains a syntax error
This PR was merged into the 4.4 branch.
Discussion
----------
[Mime] Fixing multidimensional array structure with FormDataPart
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33063#34031
| License | MIT
| Doc PR | -
The issue is pretty much described on #34031
The current structure of the raw body build on FormDataPart is not well recognized by the server. It considers all the fields as a root type, when actually it is possible to send arrays by html forms.
Lets the following structure on the html
```html
<input type="text" name="names[]" value="John" />
<input type="text" name="names[]" value="Doe" />
```
It creates the following raw body:
```
----------------------------466490401959219490193856
Content-Disposition: form-data; name="names[]"
John
----------------------------466490401959219490193856
Content-Disposition: form-data; name="names[]"
Doe
----------------------------466490401959219490193856--
```
Meanwhile, the FormDataPart on Mime component generates the following body:
```
--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data
John
--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_
Content-Type: text/plain; charset=utf-8; name=1
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name=1
Doe
--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_--
```
For more complex structures, the $_POST doesn't even recognize properly the field names and values.
Commits
-------
ca630e5351 Changing the multipart form-data behavior to use the form name as an array, which makes it recognizable as an array by PHP on the $_POST globals once it is coming from the HttpClient component
This PR was squashed before being merged into the 4.3 branch (closes#34641).
Discussion
----------
[Messenger] add tests to FailedMessagesShowCommand
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Add missing tests to FailedMessagesShowCommand in Messenger component
Commits
-------
4b9b93f5d6 [Messenger] add tests to FailedMessagesShowCommand
This PR was merged into the 3.4 branch.
Discussion
----------
[Config][ReflectionClassResource] Handle parameters with undefined constant as their default values
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/34053
| License | MIT
| Doc PR | -
Basically we can fix this bug by "reimplementing" php src way of building the __toString() of the method except that we avoid to call the undefined constant. Obviously we cannot invalidate the resource if the value of the constant changes since we never knew it. However, it's still better than now.
Commits
-------
8de2a226a8 [Config][ReflectionClassResource] Handle parameters with undefined constant as their default values
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Workflow] Added `Registry::has()` to check if a workflow exists
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#34584
| License | MIT
| Doc PR |
---
Allow to use
```php
$registry->has($subject);
// or
$registry->has($subject, 'workflow_a')
```
Commits
-------
8a4f03dee8 [Workflow] Added `Registry::has()` to check if a workflow exists
* 5.0: (30 commits)
bug #34554 [HttpClient] Fix early cleanup of pushed HTTP/2 responses (lyrixx)
Fix tests
[Console] Fix commands description with numeric namespaces
[HttpFoundation] Fixed typo
[DI] Skip unknown method calls for factories in check types pass
[EventDispatcher] Better error reporting when arguments to dispatch() are swapped
[errorHandler] Remove old references from the old debug component
improve upgrade instructions for twig.exception_controller configuration
[HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4
[Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor
[Form] Keep preferred_choices order for choice groups
[Debug] work around failing chdir() on Darwin
[PhpUnitBridge] Read configuration CLI directive
[DI] Missing test on YamlFileLoader
Revert "minor #34608 [Process] add tests for php executable finder if file does not exist (ahmedash95)"
Simpler example for Apache basic auth workaround
[Console] Fix trying to access array offset on value of type int
[Config] Remove extra sprintf arg
[HttpKernel] fix typo
[HttpKernel] Support typehint to deprecated FlattenException in controller
...
* 4.4: (28 commits)
bug #34554 [HttpClient] Fix early cleanup of pushed HTTP/2 responses (lyrixx)
Fix tests
[Console] Fix commands description with numeric namespaces
[HttpFoundation] Fixed typo
[DI] Skip unknown method calls for factories in check types pass
[EventDispatcher] Better error reporting when arguments to dispatch() are swapped
improve upgrade instructions for twig.exception_controller configuration
[HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4
[Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor
[Form] Keep preferred_choices order for choice groups
[Debug] work around failing chdir() on Darwin
[PhpUnitBridge] Read configuration CLI directive
[DI] Missing test on YamlFileLoader
Revert "minor #34608 [Process] add tests for php executable finder if file does not exist (ahmedash95)"
Simpler example for Apache basic auth workaround
[Console] Fix trying to access array offset on value of type int
[Config] Remove extra sprintf arg
[HttpKernel] fix typo
[HttpKernel] Support typehint to deprecated FlattenException in controller
Add preview mode support for Html and Serializer error renderers
...
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] Fix early cleanup of pushed HTTP/2 responses
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
0f51da6ec7 [HttpClient] Fix early cleanup of pushed HTTP/2 responses
* 4.3:
Fix tests
[Console] Fix commands description with numeric namespaces
[HttpFoundation] Fixed typo
[EventDispatcher] Better error reporting when arguments to dispatch() are swapped
[Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor
[Form] Keep preferred_choices order for choice groups
[Debug] work around failing chdir() on Darwin
[PhpUnitBridge] Read configuration CLI directive
[DI] Missing test on YamlFileLoader
Revert "minor #34608 [Process] add tests for php executable finder if file does not exist (ahmedash95)"
Simpler example for Apache basic auth workaround
[Console] Fix trying to access array offset on value of type int
[Config] Remove extra sprintf arg
[VarDumper] notice on potential undefined index
[HttpClient] turn exception into log when the request has no content-type
[Process] add tests for php executable finder if file does not exist
[Cache] Make sure we get the correct number of values from redis::mget()
[TwigBridge] Add row_attr to all form themes
[Serializer] Fix MetadataAwareNameConverter usage with string group
This PR was merged into the 3.4 branch.
Discussion
----------
[Console] Fix commands description with numeric namespaces
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/34111
| License | MIT
| Doc PR | -
This PR fixes the linked ticket case.
It also changes the keys sorting to display the numeric namespaces first.
It also fixes another bug if your command name starts with `_global:`. In this special case the command is considered global but its full name is still `_global:xxx`. We can't do better without more refactoring since the final array of namespaces and global commands is shared, `_global` just being a special key. Currently, if your command starts with `_global`, all global commands are not displayed at all so it's better like this anyway.
It also fixes another bug if your command starts with `0:` (cf `'' ===` comparison).
Commits
-------
4d47868125 [Console] Fix commands description with numeric namespaces
This PR was squashed before being merged into the 4.3 branch.
Discussion
----------
[EventDispatcher] Better error reporting when arguments to dispatch() are swapped
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34676
| License | MIT
Incorrect error is currently being reported when the second argument is an instance of `Symfony\Contracts\EventDispatcher\Event`.
Commits
-------
54aac56ab8 [EventDispatcher] Better error reporting when arguments to dispatch() are swapped
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34491
| License | MIT
As explained in https://github.com/symfony/symfony/issues/34491, there was a BC BREAK between 4.3 and 4.4, when using `PdoSessionHandler` with MySQL, where the column `sess_lifetime` was modified from `MEDIUMINT` to `INTEGER UNSIGNED`.
This PR updates `UPGRADE-4.4.md` with a suggested query for updating the database accordingly.
Commits
-------
eda4d68f7d [HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4
This PR was merged into the 4.3 branch.
Discussion
----------
[TwigBridge] Add row_attr to all form themes
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33552
| License | MIT
| Doc PR | -
The rules I applied:
- Always done on the first HTML tag of the row.
- Current existing row attrs (`class` or `style`) are applied unless they are defined by the `row_attr` override. They can be removed if they are explicitly set to `false`.
Starting from:
```
<div class="form-group">
```
With `row_attr: {foo: "bar"}`:
```
<div foo="bar" class="form-group">
```
With `row_attr: {class: "ccc"}`:
```
<div class="ccc">
```
With `row_attr: {foo: "bar", class: false}`:
```
<div foo="bar">
```
Commits
-------
dfdcbb401e [TwigBridge] Add row_attr to all form themes
This PR was squashed before being merged into the 4.3 branch.
Discussion
----------
[Form] Keep preferred_choices order for choice groups
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Since 4.3 ordering of `preferred_choices` is preserved when displaying form. But this only works for flat options. When the choices are grouped, the preferred groups are in default order.
Now the preferred choice group order is derived by taking the first matching choice from `preferred_choices` and using its position to sort the groups.
Commits
-------
75404e5287 [Form] Keep preferred_choices order for choice groups
This PR was merged into the 3.4 branch.
Discussion
----------
[DI] Missing test on YamlFileLoader
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? |no
| Deprecations? |no
| Tickets | -
| License | MIT
| Doc PR | -
Missing test on YamlFileLoader
Commits
-------
b9d5237f67 [DI] Missing test on YamlFileLoader
This PR was merged into the 4.3 branch.
Discussion
----------
[Debug] work around failing chdir() on Darwin
| Q | A
| ------------- | ---
| Branch? | 4.3 for bug fixes <!-- 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 https://github.com/happybottoms/coverd/issues/15 <!-- 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/roadmap):
- 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 4.4.
- Legacy code removals go to the master branch.
-->
Commits
-------
f40373eb7c [Debug] work around failing chdir() on Darwin
This PR was merged into the 4.3 branch.
Discussion
----------
[Serializer] Fix MetadataAwareNameConverter usage with string group
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34455
| License | MIT
| Doc PR |
Allow to use the short syntax for serialization context group like `['groups' => 'user']`
Commits
-------
d4f749a465 [Serializer] Fix MetadataAwareNameConverter usage with string group
* 3.4:
Simpler example for Apache basic auth workaround
[Console] Fix trying to access array offset on value of type int
[Process] add tests for php executable finder if file does not exist
[Cache] Make sure we get the correct number of values from redis::mget()
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] turn exception into log when the request has no content-type
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Spotted while merging a PR with ext-curl disabled:
```
[Symfony\Component\HttpClient\Exception\TransportException]
fopen(): Content-type not specified assuming application/x-www-form-urlencoded
```
This is now a log.
Commits
-------
4c671a4487 [HttpClient] turn exception into log when the request has no content-type
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[HttpKernel] Support typehint to deprecated FlattenException in controller
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34661
| License | MIT
| Doc PR |
We should support converting throwable to `FlattenException` with typehint to deprecated class also
Commits
-------
26b4e372dd [HttpKernel] Support typehint to deprecated FlattenException in controller
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[FWBundle] Remove error_renderer.serializer if the Serializer isn't available
| 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 -->
| Tickets | n/a
| License | MIT
| Doc PR | n/a
(Should help for https://github.com/hautelook/AliceBundle/pull/485).
Commits
-------
0b4c21b3d2 [FWBundle] Remove error_renderer.serializer if the Serializer isn't available
This PR was merged into the 5.0 branch.
Discussion
----------
[DoctrineBridge] Removed legacy checks in DoctrineChoiceLoader
| Q | A
| ------------- | ---
| Branch? | 5.0
| 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 | ~
<!--
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):
- 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
-------
20d2cca7f0 [DoctrineBridge] Removed legacy checks in DoctrineChoiceLoader
* 5.0: (47 commits)
reset the kernel cache after each test
[HttpKernel] Ability to define multiple kernel.reset tags
[Routing] Continue supporting single colon in object route loaders
[FWBundle] Remove unused parameter
[Intl] [Workflow] fixes English grammar typos
[Filesystem] [Serializer] fixes English grammar typo
mailer: mailchimp bridge is throwing undefined index _id when setting message id in mandrill http transport
has_roles should be is_granted in security upgrade file
has_roles should be is_granted in upgrade files
[HttpClient] Fix early cleanup of pushed HTTP/2 responses
skip test on incompatible PHP versions
[HttpKernel] Don't cache "not-fresh" state
Drop WebServerBundle directory
[FrameworkBundle][Cache] Don't deep-merge cache pools configuration
[Messenger] Adding exception to amqp transport in case amqp ext is not installed
[SecurityBundle] Don't require a user provider for the anonymous listener
[DoctrineBridge] Fixed cs in DoctrineType
[Monolog Bridge] Fixed accessing static property as non static.
Improve Symfony description
[Mailer] Add UPGRADE entries about Envelope and MessageEvent
...
* 4.4: (38 commits)
reset the kernel cache after each test
[HttpKernel] Ability to define multiple kernel.reset tags
[Routing] Continue supporting single colon in object route loaders
[FWBundle] Remove unused parameter
[Intl] [Workflow] fixes English grammar typos
[Filesystem] [Serializer] fixes English grammar typo
mailer: mailchimp bridge is throwing undefined index _id when setting message id in mandrill http transport
has_roles should be is_granted in upgrade files
[HttpClient] Fix early cleanup of pushed HTTP/2 responses
skip test on incompatible PHP versions
[HttpKernel] Don't cache "not-fresh" state
[FrameworkBundle][Cache] Don't deep-merge cache pools configuration
[Messenger] Adding exception to amqp transport in case amqp ext is not installed
[SecurityBundle] Don't require a user provider for the anonymous listener
[Monolog Bridge] Fixed accessing static property as non static.
Improve Symfony description
[Mailer] Add UPGRADE entries about Envelope and MessageEvent
[FrameworkBundle] fix leftover mentioning "secret:" processor
Add DateTimeZoneNormalizer into Dependency Injection
[Messenger] Error when specified default bus is not among the configured
...
* 4.3:
[FWBundle] Remove unused parameter
[Intl] [Workflow] fixes English grammar typos
[Filesystem] [Serializer] fixes English grammar typo
[Messenger] Adding exception to amqp transport in case amqp ext is not installed
[Monolog Bridge] Fixed accessing static property as non static.
Improve Symfony description
Add DateTimeZoneNormalizer into Dependency Injection
[Messenger] Error when specified default bus is not among the configured
[Validator] Add Japanese translation
[Workflow] Apply the same logic of precedence between the apply() and the buildTransitionBlockerList() method
Remove some unused methods parameters
Avoid empty \"If-Modified-Since\" header in validation request
[Security] Fix SwitchUser is broken when the User Provider always returns a valid user
Fix error message according to the new regex
compatibility with DoctrineBundle 2
[Validator] ConstraintValidatorTestCase: add missing return value to mocked validate method calls
This PR was merged into the 4.4 branch.
Discussion
----------
[Routing] Continue supporting single colon in object route loaders
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/34612
| License | MIT
| Doc PR | -
https://github.com/symfony/symfony/pull/32582#discussion_r304824139 was a bad idea. The new `ObjectLoader` class is used directly on 4.4 since we detagged the old service (and the old one). So we need to support the old notation on it. It changes the exception message but it should be alright.
Commits
-------
3c796e120c [Routing] Continue supporting single colon in object route loaders
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpKernel] reset the kernel cache after each test
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
5b5927b93b reset the kernel cache after each test
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] Fix early cleanup of pushed HTTP/2 responses
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
0f51da6ec7 [HttpClient] Fix early cleanup of pushed HTTP/2 responses
This PR was merged into the 4.3 branch.
Discussion
----------
[Intl] [Workflow] fixes English grammar typos
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | ~
| License | MIT
| Doc PR | ~
Also related to #34604
Commits
-------
492e1b5afd [Intl] [Workflow] fixes English grammar typos
This PR was merged into the 4.3 branch.
Discussion
----------
[Workflow] Apply the same logic of precedence between the apply() and the buildTransitionBlockerList() method
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34489
| License | MIT
| Doc PR |
Commits
-------
2ff3496d62 [Workflow] Apply the same logic of precedence between the apply() and the buildTransitionBlockerList() method
This PR was squashed before being merged into the 5.1-dev branch (closes#32937).
Discussion
----------
[Routing] Deprecate RouteCollectionBuilder
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #32240
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/12688
| Recipe PR | https://github.com/symfony/recipes/pull/690
A lot to be done here after the implementation is accepted:
- [x] finish deprecations in the MicroKernelTrait
- [x] deprecate the class
- [x] mention in the CHANGELOG file
- [x] mention in the UPGRADE file
- [x] mark tests as legacy
- [x] add a doc PR
- [x] update the recipe
Ping @Tobion , @nicolas-grekas .
Commits
-------
e641cbdd46 [Routing] Deprecate RouteCollectionBuilder
This PR was squashed before being merged into the 5.1-dev branch (closes#34557).
Discussion
----------
[PropertyInfo] Add support for typed properties (PHP 7.4)
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| 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 | n/a
Add support for [typed properties](https://wiki.php.net/rfc/typed_properties_v2), a new feature introduced in PHP 7.4:
```php
class Foo
{
public Bar $bar;
private ?bool $nullableBoolProp;
}
$this->extractor->getTypes(Foo::class, 'bar'); // Type[]
$this->extractor->getTypes(Foo::class, 'nullableBoolProp'); // Type[]
```
#SymfonyHackday
Commits
-------
7edfe4f741 [PropertyInfo] Add support for typed properties (PHP 7.4)
This PR was merged into the 4.4 branch.
Discussion
----------
[SecurityBundle] Don't require a user provider for the anonymous listener
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34504
| License | MIT
| Doc PR | -
Forgotten when adding the AnonymousFactory in #33503
Commits
-------
0950cfbc65 [SecurityBundle] Don't require a user provider for the anonymous listener
This PR was merged into the 5.0 branch.
Discussion
----------
[DoctrineBridge] Fixed cs in DoctrineType
| Q | A
| ------------- | ---
| Branch? | 5.0
| 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 | ~
<!--
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):
- 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.
-->
My bad, it could have been part of #34571, but I thought it was needed in an older branch.
Commits
-------
e3b2164bdf [DoctrineBridge] Fixed cs in DoctrineType
This PR was merged into the 5.1-dev branch.
Discussion
----------
[DX] [Workflow] Added a way to specify a message when blocking a transition + better default message in case it is not set
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34466
| License | MIT
| Doc PR |
Commits
-------
169bb2ff51 [Workflow] Added a way to specify a message when blocking a transition + better default message in case it is not set
This PR was squashed before being merged into the 5.1-dev branch (closes#34457).
Discussion
----------
Added context to exceptions thrown in apply method
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets |
| License | MIT
| Doc PR |
During the workflow and state machines workshop at SymfonyCon, we noticed that the context in the apply method was not passed to the exceptions that are thrown. This could prove to be convenient for debugging purposes.
Commits
-------
8f86c337f7 Added context to exceptions thrown in apply method
This PR was merged into the 4.4 branch.
Discussion
----------
Add missing defaultPriorityMethod field in TaggedIteratorArgument
| 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 | <!-- 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/roadmap):
- 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.
-->
#SymfonyHackday
Commits
-------
f5bd421597 Add missing defaultPriorityMethod field in TaggedIteratorArgument
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle][ContainerLint] Keep "removing" compiler passes
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/34498
| License | MIT
| Doc PR | -
Removing "removing" compiler passes when debug is off (why only in this case btw?) means that the container is never cleaned (the important thing being the "remove unused definitions" pass), leaving it in a "dirty" state. What is the point of testing a container that is different than the one that will be used anyway? 🤔
Making this truely work btw means that 100% of Symfony's declared services must end up valid whether they are used or not and in all combinations possible. I guess that should be the goal but from what I could test in the last hour, that will be a lot of work. However, there are definitely some fixes to do in our services declarations that we can detect thanks to this "bug".
Commits
-------
59d677182e [FrameworkBundle][ContainerLint] Keep removing compiler passes
This PR was merged into the 4.4 branch.
Discussion
----------
[Dotenv] don't fail when referenced env var does not exist
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34537
| License | MIT
| Doc PR |
Commits
-------
8026609dc9 don't fail when referenced env var does not exist
This PR was squashed before being merged into the 4.3 branch (closes#34547).
Discussion
----------
[Messenger] Error when specified default bus is not among the configured
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | n/a
This is a bug fix because the error occurs during the di compilation anyway.
Commits
-------
dd92d2bb10 [Messenger] Error when specified default bus is not among the configured
This PR was merged into the 5.0 branch.
Discussion
----------
[DoctrineBridge] Removed legacy extra argument in DoctrineChoiceLoader
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | ~
| License | MIT
| Doc PR | ~
<!--
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):
- 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
-------
55364cb55f [DoctrineBridge] Removed legacy extra argument in DoctrineChoiceLoader
This PR was merged into the 4.4 branch.
Discussion
----------
[Validator] remove return type declaration from __sleep()
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34478
| License | MIT
| Doc PR |
Commits
-------
bedad35e59 remove return type declaration from __sleep()
This PR was merged into the 3.4 branch.
Discussion
----------
Remove some unused methods parameters
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This PR removes some useless private method parameters.
Commits
-------
026730e913 Remove some unused methods parameters
This PR was squashed before being merged into the 3.4 branch (closes#34385).
Discussion
----------
Avoid empty "If-Modified-Since" header in validation request
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Just noticed that when a response has been cached that is `public` and has an `maxAge` but does _not_ provide `Last-Modified`, the validation subrequest will have an empty `If-Modified-Since` header value.
Commits
-------
960faef66f Avoid empty \"If-Modified-Since\" header in validation request
* 5.0:
[Routing] fix tests
[DI] minor cleanup
[Form] group constraints when calling the validator
Remove wrong @group legacy annotations
[DependencyInjection] Fix dumping multiple deprecated aliases
allow button names to start with uppercase letter
Allow PHP ^7.2.5
States that the HttpClient provides a Http Async implementation
[Routing] Fix ContainerLoader and ObjectLoaderTest
[HttpKernel] Make ErrorListener::onKernelException()'s dispatcher argument explicit
[HttpKernel] Drop deprecated ExceptionListener
Removed extra whitespace
[Security] Fix best encoder not wired using migrate_from
* 4.4:
[Routing] fix tests
[Form] group constraints when calling the validator
Remove wrong @group legacy annotations
[DependencyInjection] Fix dumping multiple deprecated aliases
allow button names to start with uppercase letter
States that the HttpClient provides a Http Async implementation
This PR was merged into the 4.4 branch.
Discussion
----------
[Form] group constraints when calling the validator
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Follow up of https://github.com/symfony/symfony/pull/34081
Spotted during the workshop at SymfonyCon, while trying to fix deprecation notices on symfony-demo:
the Form component currently passes constraints one by one for validation, effectively preventing the validator from taking care of cross-constraints dependencies.
This PR fixes it.
This will prevent ppl from having to fix things like
> Using the "Symfony\Component\Validator\Constraints\Length" constraint with the "min" option without setting the "allowEmptyString" one is deprecated and defaults to true. In 5.0, it will become optional and default to false.
Commits
-------
d15f77f33e [Form] group constraints when calling the validator
This PR was merged into the 5.0 branch.
Discussion
----------
Allow PHP ^7.2.5
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34442
| License | MIT
| Doc PR | -
Let's what the CI says.
Will need tagging all contracts as v2.0.1 after merge.
Commits
-------
6194c2a96c Allow PHP ^7.2.5
* 4.4:
[HttpKernel] Make ErrorListener::onKernelException()'s dispatcher argument explicit
Removed extra whitespace
[Security] Fix best encoder not wired using migrate_from
This PR was merged into the 4.4 branch.
Discussion
----------
[Security] Fix best encoder not wired using migrate_from
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Thanks @wouterj for spotting it.
Commits
-------
4132a60392 [Security] Fix best encoder not wired using migrate_from
* 5.0:
[Finder] Fixed docs
Fix PR template
Adjust pull request template for 5.0 branchout
Update HttpKernel.php
bumped Symfony version to 4.4.0
updated VERSION for 4.4.0-RC1
updated CHANGELOG for 4.4.0-RC1
* 4.4:
[Finder] Fixed docs
Fix PR template
Adjust pull request template for 5.0 branchout
Update HttpKernel.php
bumped Symfony version to 4.4.0
updated VERSION for 4.4.0-RC1
updated CHANGELOG for 4.4.0-RC1
* 4.4:
[Messenger] Perform no deep merging of bus middleware
[HttpFoundation] Added possibility to configure expiration time in redis session handler
[FrameworkBundle] Remove project dir from Translator cache vary scanned directories
[HttpFoundation] Allow redirecting to URLs that contain a semicolon
Drop useless executable bit
[DoctrineBridge] Improve queries parameters display in Profiler
catch exceptions when using PDO directly
[SecurityBundle] fix failing test
* 4.3:
[FrameworkBundle] Remove project dir from Translator cache vary scanned directories
[HttpFoundation] Allow redirecting to URLs that contain a semicolon
catch exceptions when using PDO directly
[SecurityBundle] fix failing test
This PR was merged into the 4.4 branch.
Discussion
----------
[Messenger] Perform no deep merging of bus middleware
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | n/a
This change helps in case one needs to configure a bus differently for a custom environment while keeping existing handlers attached by name.
Commits
-------
c264583f28 [Messenger] Perform no deep merging of bus middleware
This PR was squashed before being merged into the 4.4 branch (closes#34405).
Discussion
----------
[HttpFoundation] Added possibility to configure expiration time in redis session handler
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | n/a
Add possibility to manually configure expiration time in redis session handler.
Commits
-------
4a9d947b1a [HttpFoundation] Added possibility to configure expiration time in redis session handler
This PR was merged into the 4.3 branch.
Discussion
----------
[Cache] catch exceptions when using PDO directly
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fixsymfony/symfony-docs#12632
| License | MIT
| Doc PR |
Commits
-------
5c1f5594f5 catch exceptions when using PDO directly
* 4.4: (23 commits)
[HttpFoundation] fix docblock
[HttpKernel] Flatten "exception" controller argument if not typed
Fix MySQL column type definition.
Link the right file depending on the new version
[Cache] Redis Tag Aware warn on wrong eviction policy
[HttpClient] fix HttpClientDataCollector
[HttpKernel] collect bundle classes, not paths
[Config] fix id-generation for GlobResource
[HttpKernel] dont check cache freshness more than once per process
[Finder] Allow ssh2 stream wrapper for sftp
[FrameworkBundle] fix wiring of httplug client
add FrameworkBundle requirement
[SecurityBundle] add tests with empty authenticator
[Security] always check the token on non-lazy firewalls
[DI] Use reproducible entropy to generate env placeholders
[WebProfilerBundle] Require symfony/twig-bundle
[Mailer] Add UPGRADE entry about the null transport DSN
bumped Symfony version to 4.3.9
updated VERSION for 4.3.8
updated CHANGELOG for 4.3.8
...
* 4.3:
[HttpFoundation] fix docblock
Fix MySQL column type definition.
Link the right file depending on the new version
[Config] fix id-generation for GlobResource
[Finder] Allow ssh2 stream wrapper for sftp
[DI] Use reproducible entropy to generate env placeholders
[WebProfilerBundle] Require symfony/twig-bundle
bumped Symfony version to 4.3.9
updated VERSION for 4.3.8
updated CHANGELOG for 4.3.8
bumped Symfony version to 3.4.36
updated VERSION for 3.4.35
updated CHANGELOG for 3.4.35
* 3.4:
Link the right file depending on the new version
[Finder] Allow ssh2 stream wrapper for sftp
[WebProfilerBundle] Require symfony/twig-bundle
bumped Symfony version to 3.4.36
updated VERSION for 3.4.35
updated CHANGELOG for 3.4.35
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[Cache] Redis Tag Aware warn on wrong eviction policy
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| Deprecations? | no
| Tickets | n.a.
| License | MIT
| Doc PR | n.a.
Adds validation to make sure Redis has been setup with the supported eviction policy to avoid surprises when cache suddenly is inconsistent.
This PR replaces #34178, and instead of checking in constructor and throwing it only checks on save, warns about this and refuses to save cache as suggested on the other PR.
TODO:
- [x] ~Adapt test setups for this to set correct eviction policy~ _It already uses default noeviction_
Commits
-------
e77f6de1e8 [Cache] Redis Tag Aware warn on wrong eviction policy
This PR was merged into the 4.3 branch.
Discussion
----------
[Config] fix id-generation for GlobResource
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
I never encountered any issues related to this but still, it's a fix.
Commits
-------
6adbfa2ae7 [Config] fix id-generation for GlobResource
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpKernel] dont check cache freshness more than once per process
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
While running some functional tests in a loop, I noticed that half the time is spent computing cache freshness. This makes no sense - this mechanism is supposed to run once per process.
Here is the Blackfire comparison:
https://blackfire.io/profiles/compare/a4f2eb44-ae85-440b-ae87-edf43c2b2ef7/graph
![image](https://user-images.githubusercontent.com/243674/68955196-c5667780-07c5-11ea-9a19-f8e765664a8e.png)
Commits
-------
7f9556ce19 [HttpKernel] dont check cache freshness more than once per process
This PR was merged into the 4.4 branch.
Discussion
----------
[Form] Allow symfony/service-contracts v2
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
In Symfony 4.4 applications, the Form component currently prevents the installation of `symfony/service-contracts` 2.0.0. That should not be the case.
Commits
-------
4755e160be [Form] Allow symfony/service-contracts v2.
* 4.4:
[Console] Constant STDOUT might be undefined.
Add missing conflict with symfony/serializer <4.4
Allow returning null from NormalizerInterface::normalize
bumped Symfony version to 4.4.0
updated VERSION for 4.4.0-BETA1
updated CHANGELOG for 4.4.0-BETA1
[Security\Core] throw AccessDeniedException when switch user fails
[Mime] fix guessing mime-types of files with leading dash
[HttpFoundation] fix guessing mime-types of files with leading dash
[VarExporter] fix exporting some strings
[Cache] forbid serializing AbstractAdapter and TagAwareAdapter instances
Use constant time comparison in UriSigner
* 4.3:
[Console] Constant STDOUT might be undefined.
Allow returning null from NormalizerInterface::normalize
[Security\Core] throw AccessDeniedException when switch user fails
[Mime] fix guessing mime-types of files with leading dash
[HttpFoundation] fix guessing mime-types of files with leading dash
[VarExporter] fix exporting some strings
[Cache] forbid serializing AbstractAdapter and TagAwareAdapter instances
Use constant time comparison in UriSigner
This PR was merged into the 3.4 branch.
Discussion
----------
Allow returning null from NormalizerInterface::normalize
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes?
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
Looking at the code, it seems that a normalizer might be called with a `null` value for `$data`, and thus it's only sensible that it be allowed to return `null` too:
7064ff35f2/src/Symfony/Component/Serializer/Serializer.php (L141-L148)
Updating the phpdoc to match.
Commits
-------
1c8edc55ad Allow returning null from NormalizerInterface::normalize
This PR was merged into the 5.0-dev branch.
Discussion
----------
more strict requirements of experimental components
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
23bc40b764 more strict requirements of experimental components
* 3.4:
[HttpFoundation] fix guessing mime-types of files with leading dash
[Cache] forbid serializing AbstractAdapter and TagAwareAdapter instances
Use constant time comparison in UriSigner
This PR was merged into the 5.0-dev branch.
Discussion
----------
Last cleanups before beta
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
61c7c11a32 Last cleanups before beta
This PR was merged into the 4.4 branch.
Discussion
----------
[ErrorHandler] merge and remove the ErrorRenderer component
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This PR supersedes #34288.
Here is what it does:
- Merge the `ErrorRenderer` component into `ErrorHandler`
- Add `ErrorRendererInterface::render(\Throwable $e): FlattenException` and refactor error renderers around it.
- Add `FlattenException::setAsString()` to make the previous possible.
- Add `CliErrorRenderer` to render error on the CLI too. This means `VarDumper` is now a required dependency of `ErrorHandler`. This paves the way to use it also for rendering HTML - the logic there is much more advanced than what `HtmlErrorRenderer` provides and ever should provide.
- Make `BufferingLogger` map its collected logs to `error_log()` if they are not emptied before.
- Remove some classes that are not needed anymore (`ErrorRenderer`, `ErrorRendererPass`, `HtmlErrorRendererInterface`)
- Simplified the logic in `Debug::enable()` - nobody uses its arguments
- Fix a few issues found meanwhile.
With these changes, the component can be used standalone. One is now able to require only it, register it either with either `ErrorHandler::register()` or `Debug::enable()` and profit.
Commits
-------
d1bf1cada4 [ErrorHandler] help finish the PR
6c9157bbc2 [ErrorHandler] merge and remove the ErrorRenderer component
This PR was merged into the 5.0-dev branch.
Discussion
----------
[5.0][Security] Minor clarification of the new isGranted signature
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | n/a
As we now only allow a single attribute for `isGranted()` in Symfony 5, let's adapt the PHPdoc and parameter name as well.
Commits
-------
e41e6b48a9 Clarified single attribute to isGranted() a bit more
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpKernel] make ExceptionEvent able to propagate any throwable
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Tickets | -
| License | MIT
| Doc PR | -
An alternative to #34306.
As a reminder, the goal of this series of PRs is to remove the `FatalThrowableError` wrapper that we introduced to seamlessly handle throwables when they were introduced in PHP 7.
From the changelog of `HttpKernel`:
* Deprecated methods `ExceptionEvent::get/setException()`, use `get/setThrowable()` instead
* Deprecated class `ExceptionListener`, use `ErrorListener` instead
And the final target: removed `Symfony\Component\ErrorHandler\Exception\ErrorException` (`FatalThrowableError` is already deprecated.)
Commits
-------
6f67f0e0c0 [HttpKernel] make ExceptionEvent able to propagate any throwable
This PR was merged into the 4.4 branch.
Discussion
----------
[Security] Fix defining multiple roles per access_control rule
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/12371 needs to be reverted
#33584 deprecated passing multiple attributes to `AccessDecisionManager::decide()`, but this change must not impact `access_control` as you cannot define multiple rules with the same criteria for request matching (the first match wins).
Commits
-------
338b3dfd9f [Security] Fix defining multiple roles per access_control rule
* 4.4:
[Messenger] Fixed bad event dispatcher mocks.
[Workflow] Simplified EventDispatcherMock.
[Routing] revert the return type for UrlGeneratorInterface::generate to remove null
[HttpFoundation] Add a way to anonymize IPs
This PR was merged into the 4.4 branch.
Discussion
----------
[Messenger] Fixed bad event dispatcher mocks
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
`EventDispatcherInterface::dispatch()` must return the passed event object. This PR fixes two mocks that violated this contract.
Commits
-------
103930039b [Messenger] Fixed bad event dispatcher mocks.
This PR was merged into the 3.4 branch.
Discussion
----------
[Routing] revert the return type for UrlGeneratorInterface::generate to remove null
…to remove null
| Q | A
| ------------- | ---
| Branch? | 3.4 (only)
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| License | MIT
Bit of a casualty of commit tennis this:
A change to add `null` here as an option for how `UrlGeneratorInterface::generate()` (rather than the concrete `UrlGenerator`) was merged in https://github.com/symfony/symfony/pull/28321, but then [reverted](90494c20cc) for the reason [that this could be seen as a BC break](https://github.com/symfony/symfony/pull/28321#issuecomment-418540080), as the `null` return had not previously been documented (and is still not as part of the interface method docs).
However, in a subsequent change (https://github.com/symfony/symfony/pull/33252) with a wider scope, this doc change was added _back_ in order to reflect the underlying implementation as a result of a PHPStorm plugin complaining. There's no indication though of what a `null` return here though would mean, and for the same reason as the first revert (that this should be seen as a BC break), I'd like to submit this to be reverted for the 3.4 branch. (In 4.4 the `null` has already been removed.)
Having the interface indicating that this method can return `null` necessitates introducing a lot of actually redundant null checks in code that is covered by static analysis tools such as PHPStan.
Commits
-------
9f853f324f [Routing] revert the return type for UrlGeneratorInterface::generate to remove null
This PR was merged into the 4.3 branch.
Discussion
----------
[Workflow] Simplified EventDispatcherMock
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
This PR simplifies the Workflow component's mock implementation of the event dispatcher by implementing the much simpler contracts interface instead of the full-blown component interface.
Commits
-------
5aee181c83 [Workflow] Simplified EventDispatcherMock.
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpFoundation] Add a way to anonymize IPs
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features --> TODO
This is helpful for GDPR compliance reasons, and it isn't much code saved but it's also good if you don't have to think about how to do it.
Commits
-------
9e62330bc4 [HttpFoundation] Add a way to anonymize IPs
* 4.4:
[DI] fix locators with numeric keys
Add support for NO_COLOR env var
[DI][FrameworkBundle] add EnvVarLoaderInterface - remove SecretEnvVarProcessor
Fix error when we use VO for the marking property
[DI] Remove LazyString from 4.4, before adding back to the String component
This PR was merged into the 4.4 branch.
Discussion
----------
[DI] Remove LazyString from 4.4, before adding back to the String component
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
In #34190 I'm proposing to move LazyString to the Service contracts, but String might be a better fit actually. Let's remove the class from 4.4 where it's not really needed, and add it back on 5.0 in the String component.
Commits
-------
b1a3ee76ac [DI] Remove LazyString from 4.4, before adding back to the String component
This PR was merged into the 4.3 branch.
Discussion
----------
[Workflow] Fix error when we use ValueObject for the marking property
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#28203#22031
| License | MIT
Fix Illegal offset type in `MethodMarkingStore` class when we use Value Object for
the marking property.
Now, we can avoid to use only a string an we can have a Subject class with a Value Object like this :
```php
final class State
{
public const DRAFT = 'draft';
public const REVIEWED = 'reviewed';
public const REJECTED = 'rejected';
public const PUBLISHED = 'published';
/** @var string */
private $state;
public function __construct(string $state)
{
// some validation
$this->state = $state;
}
public function __toString()
{
return $this->state;
}
public static function Draft()
{
return new self(self::DRAFT);
}
...
}
final class Subject
{
private $marking;
public function __construct(State $marking = null)
{
$this->marking = $marking;
}
public function getMarking()
{
return $this->marking;
}
public function setMarking($marking)
{
$this->marking = $marking instanceof State ? $marking : new State($marking);
}
```
Commits
-------
6570d5cbe2 Fix error when we use VO for the marking property
This PR was merged into the 4.4 branch.
Discussion
----------
[Console] Add support for NO_COLOR env var
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| License | MIT
| Doc PR |
Adds support for https://no-color.org/ - ideally this would be considered a bugfix and added to older releases IMO, but submitting as new feature for now.
cc @johnstevenson
Commits
-------
c1b0a8e956 Add support for NO_COLOR env var
* 4.4:
[DI] Dont cache classes with missing parents
[HttpClient] Fix a crash when calling CurlHttpClient::__destruct()
Unallow symfony/http-kernel ^5.0
[FrameworkBundle] fix SodiumVault after stof review
[HttpClient] allow arbitrary JSON values in requests
[DependencyInjection] Added option `ignore_errors: not_found` while importing config files
[Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos
[FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change
This PR was merged into the 5.0-dev branch.
Discussion
----------
Remove \Throwable bubbling down support deprecation layer
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Remove deprecation layer of https://github.com/symfony/symfony/pull/33065
Commits
-------
ffcfdb42a7 Remove \Throwable support deprecation layer
This PR was merged into the 4.4 branch.
Discussion
----------
[DependencyInjection] Added option `ignore_errors: not_found` for imported config files
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | symfony/symfony-docs#11647
If someone want to add optional config file. The only available choice was to add `ignore_errors: true` option
e.g.
```
imports:
- { resource: parameters.yml, ignore_errors: true }
```
But this will hide all errors in imported file. We ran in many situations that broke our Symfony applications because we had a typo in this imported files.
This PR introduce new possible value `not_found` for `ignore_errors` option. It can be used for optional config files like the `ignore_errors: true`, but it will ignore only the file non-existence, not the possible syntax errors inside.
Usage:
```
imports:
- { resource: parameters.yml, ignore_errors: not_found}
```
Commits
-------
e0ee01c10d [DependencyInjection] Added option `ignore_errors: not_found` while importing config files
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] fix SodiumVault after stof review
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
As spotted by @stof in https://github.com/symfony/symfony/pull/34275#pullrequestreview-313355834
Commits
-------
a594599078 [FrameworkBundle] fix SodiumVault after stof review
* 4.3:
[DI] Dont cache classes with missing parents
[HttpClient] Fix a crash when calling CurlHttpClient::__destruct()
[Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos
[FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change
Allow arbitrary values in the "json" request option. Previously values were
limitated to arrays and objects of type JsonSerializable. This doesn't account
for scalar values and classes with public properties (which don't need to
implement JsonSerializable), all of which are perfectly acceptable arguments to
json_encode.
This PR was merged into the 5.0-dev branch.
Discussion
----------
[SecurityBundle] Remove deprecated service and code
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Remove deprecated service in https://github.com/symfony/symfony/pull/25839 and deprecated code in https://github.com/symfony/symfony/pull/33676.
Commits
-------
ad61d6f72b [SecurityBundle] Remove deprecated service and code
This PR was merged into the 5.0-dev branch.
Discussion
----------
[Debug] Remove it from master
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Looks like it came back from the dead 😅
Commits
-------
54ffd46 [Debug] Remove it from master
This PR was merged into the 4.3 branch.
Discussion
----------
[FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/33992
| License | MIT
| Doc PR | -
The cache file name needs to depend on the scanned directories list. Otherwise, when a new directory is added, even if the container is rebuilt and the `FWB Translator` gets the new scanned directories list, the cached catalogue name is still the same and is resolved accordingly.
An alternative would be to make the `Translation Translator` `getCatalogueCachePath()` method and `fallbackLocales` `@internal` and `protected` to just override everything in the `FWB Translator`. The `cacheVary` argument has the benefit to be reusable by all the `Translation` component users.
Note that there is a negative minor performance impact that increases when the list of scanned directories grows.
Commits
-------
6cbee0944c [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change
This PR was merged into the 4.4 branch.
Discussion
----------
[DoctrineBridge] fix min version of http-kernel
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Required after #34257 and #34230
Commits
-------
69ba86ba66 [DoctrineBridge] fix min version of http-kernel
This PR was merged into the 4.4 branch.
Discussion
----------
[DoctrineBridge] Reopen DoctrineDataCollector to extensibility
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Tickets | -
| License | MIT
| Doc PR | -
DoctrineBundle is using it (0d20a98fb8/DataCollector/DoctrineDataCollector.php (L41)) and we don't want to prevent them from doing it.
Commits
-------
af021248bf [DoctrineBridge] Reopen DoctrineDataCollector to extensibility
This PR was merged into the 5.0-dev branch.
Discussion
----------
[Notifier][Telegram] Fixing Telegram token
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Thanks, i really love this integration! i needed to do two minor changes while playing around:
- token needs to contain user and password, see https://core.telegram.org/bots/api#making-requests
- channel should be optional for bot interaction, using `chat_id` as message option instead
Commits
-------
c2c3e70e6b fixing telegram token
* 4.4:
[HttpClient] fix after merge from 4.3
[HttpClient] expose only gzip when doing transparent compression
[VarDumper] fix tests & displaying generators
Fix WeekType tests
add species to inflector and inflector tests
Add handling for delayed message to redis transport
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] fix after merge from 4.3
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
3c6dc96ab4 [HttpClient] fix after merge from 4.3
This PR was squashed before being merged into the 3.4 branch (closes#34135).
Discussion
----------
[Validator] Add the missing translations for the Hebrew ("he") locale and fix 2 typos
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#30166
| License | MIT
Ref #30166
Commits
-------
022cf67f19 [Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos
* 4.4: (39 commits)
[Console] Fix#33915, Detect dimensions using mode CON if vt100 is supported
[PhpUnitBridge] Also search for composer.phar in git root folder
[HttpKernel][DataCollectorInterface] Ease compatibility
Add tests to ensure defaultLocale is properly passed to the URL generator
[DependencyInjection] Fix broken references in tests
[VarDumper] display the method we're in when dumping stack traces
[HttpClient] Retry safe requests when then fail before the body arrives
[Console] Rename some methods related to redraw frequency
Avoid using of kernel after shutdown
Simplify PHP CS Fixer configuration
[PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements
[FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
Fix CS
[Serializer] Fix property name usage for denormalization
Name test accordingly to the tested class
Fix MockFileSessionStorageTest::sessionDir being used after it's unset
[Security] Fix SwitchUserToken wrongly deauthenticated
Supporting Bootstrap 4 custom switches
Add new Form WeekType
bumped Symfony version to 4.3.7
...
* 4.3: (26 commits)
[Console] Fix#33915, Detect dimensions using mode CON if vt100 is supported
[HttpKernel][DataCollectorInterface] Ease compatibility
Add tests to ensure defaultLocale is properly passed to the URL generator
[DependencyInjection] Fix broken references in tests
[HttpClient] Retry safe requests when then fail before the body arrives
Avoid using of kernel after shutdown
Simplify PHP CS Fixer configuration
[PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements
[FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
[Serializer] Fix property name usage for denormalization
Name test accordingly to the tested class
Fix MockFileSessionStorageTest::sessionDir being used after it's unset
bumped Symfony version to 4.3.7
updated VERSION for 4.3.6
updated CHANGELOG for 4.3.6
bumped Symfony version to 3.4.34
updated VERSION for 3.4.33
update CONTRIBUTORS for 3.4.33
updated CHANGELOG for 3.4.33
[HttpClient] Fix perf issue when doing thousands of requests with curl
...
This PR was merged into the 4.3 branch.
Discussion
----------
[Console] Detect dimensions using mode CON if vt100 is supported
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33915
| License | MIT
This fixes color support detection for users of Win10 + git-bash. If vt100 support is detected, the terminal will not try to use `stty` to test for dimensions. Calling such command implicitly disables vt100 support on STDOUT.
Commits
-------
fdeceff85e [Console] Fix#33915, Detect dimensions using mode CON if vt100 is supported
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] Retry safe requests using HTTP/1.1 when HTTP/2 fails
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
cURL support of HTTP/2 is not as robust as HTTP/1.1. When doing >1k requests, the stream can break for buggy reasons. New versions of cURL are fixed already, but let's make our logic more resilient anyway, and switch to HTTP/1.1 when a *safe* request fails for send/recv reasons.
Commits
-------
9f7cd66004 [HttpClient] Retry safe requests when then fail before the body arrives
* 3.4:
[DependencyInjection] Fix broken references in tests
Avoid using of kernel after shutdown
Simplify PHP CS Fixer configuration
[FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
Fix MockFileSessionStorageTest::sessionDir being used after it's unset
bumped Symfony version to 3.4.34
updated VERSION for 3.4.33
update CONTRIBUTORS for 3.4.33
updated CHANGELOG for 3.4.33
[Stopwatch] Fixed a bug in stopwatch event getStartTime
[Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods
Adding some validations tags on validators.et.xlf
add missing translation for 94 (it)
This PR was merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle] Avoid using of kernel after shutdown in KernelTestCase
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix #...
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
I had sadly something like this in my codebase:
```php
if (!static::$kernel) {
static::bootKernel();
}
```
As the $kernel is never set again to null a old $kernel was still there. I would not only set the $container also the $kernel variable to null. ~~As this could be a BC Break I'm targeting master~~.
Commits
-------
49b58ed45e Avoid using of kernel after shutdown
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[PhpUnitBridge] Also search for composer.phar in git root folder
| Q | A
| ------------- | ---
| Branch? | 4.4 for features
| Bug fix? | kindof
| New feature? | addition to existing feature
| Deprecations? | no
| Tickets | Related: https://github.com/symfony/symfony/issues/26637#issuecomment-390749681
| License | MIT
When you don't have a system `composer` installation, but a `composer.phar` in the project folder, you cannot use the `simple-phpunit` script from a subfolder of the project with e.g. `../vendor/bin/simple-phpunit`.
This change also searches for the `composer.phar` in the current git root folder if it was not found at any other places to increase the likelihood of it being found.
Commits
-------
97fd204d16 [PhpUnitBridge] Also search for composer.phar in git root folder
This PR was merged into the 4.4 branch.
Discussion
----------
[VarDumper] display the method we're in when dumping stack traces
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This PR adds the line in blue:
![image](https://user-images.githubusercontent.com/243674/68152006-131bee00-ff43-11e9-8270-1d547732a7e5.png)
Without it, we're missing some context as the method is from a trait. This allows knowing which class is actually importing and using the method.
Commits
-------
23600cc8e1 [VarDumper] display the method we're in when dumping stack traces
This PR was merged into the 4.4 branch.
Discussion
----------
[ErrorRenderer] Show generic message in non-debug mode
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
I agree with @Tobion here https://github.com/symfony/symfony/pull/34158#issuecomment-548181099, so let's always show the detail message, but for 5xx errors we'll send a generic message instead.
/cc @dunglas wdyt?
Commits
-------
45f1a5ee06 Show generic message in non-debug mode
This PR was squashed before being merged into the 4.4 branch (closes#33732).
Discussion
----------
[Console] Rename some methods related to redraw frequency
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
In #26339 we added `preventRedrawFasterThan()` and `forceRedrawSlowerThan()`. While merging the docs for them (https://github.com/symfony/symfony-docs/pull/12364) I thought that the method names are a bit hard to understand.
In this PR I propose a renaming for your consideration. Thanks!
In the following example, we want to update the progress bar every 100 iterations, but not faster than 100ms or slower than 200ms.
**Before**
```php
$progressBar = new ProgressBar($output, 50000);
$progressBar->start();
$progressBar->setRedrawFrequency(100);
$progressBar->preventRedrawFasterThan(0.1);
$progressBar->forceRedrawSlowerThan(0.2);
```
**After**
```php
$progressBar = new ProgressBar($output, 50000);
$progressBar->start();
$progressBar->setRedrawFrequency(100);
$progressBar->maxRefreshInterval(0.1);
$progressBar->minRefreshInterval(0.2);
```
Commits
-------
e6ee7b07f3 [Console] Rename some methods related to redraw frequency
This PR was merged into the 4.4 branch.
Discussion
----------
[Routing][Config] Allow patterns of resources to be excluded from config loading
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #31516
| License | MIT
| Doc PR | not yet
The PR will fix the following RFC: #31516
Like resource loading for services, this PR offers a way to exclude patterns of resources like:
```yml
// config/routes/annotations.yaml
controllers:
resource: ../../src/Controller/*
type: annotation
exclude: '../src/Controller/{DebugEmailController}.php'
```
All the annotation routes inside `Controller/` will be loaded in this example except all the one present inside the `Controller/DebugEmailController.php`
Commits
-------
332ff8811c [Routing][Config] Allow patterns of resources to be excluded from config loading
This PR was merged into the 4.4 branch.
Discussion
----------
[DI] Add compiler pass and command to check that services wiring matches type declarations
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27744
| License | MIT
| Doc PR |
PR replacing https://github.com/symfony/symfony/pull/27825.
It adds a `lint:container` command asserting the type hints used in your code are correct.
Commits
-------
8230a1543e Make it really work on real apps
4b3e9d4c96 Fix comments, improve the feature
a6292b917b [DI] Add compiler pass to check arguments type hint
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] fix retry of messages losing the routing key and properties
| Q | A
| ------------- | ---
| Branch? | 4.3
| 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#32994 <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR |
Messages sent for retry in rabbitmq lost the routing key and properties like the priority. Now we read those original properties and sent the retry message with the same properties (unless those properties have already been set manually before).
Commits
-------
75c674debc [Messenger] fix retry of messages losing the routing key and properties
This PR was merged into the 3.4 branch.
Discussion
----------
Adding some validations tags on validators.et.xlf
| Q | A
| ------------- | ---
| Branch? | 4.4 for features / 3.4 or 4.3 for bug fixes <!-- see below -->
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/30160
| License | MIT
I saw an issue in the **Issues Page** and i want to help to improve the repository, even with a simple modification
Commits
-------
16bd71b5b1 Adding some validations tags on validators.et.xlf
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] add missing translation for 94 (it)
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | None
| License | MIT
| Doc PR | not needed
Italian translation for validator is missing last item (id 94)
Commits
-------
1dc7ce1159 add missing translation for 94 (it)
This PR was merged into the 3.4 branch.
Discussion
----------
[Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34087
| License | MIT
| Doc PR | N/A
When running multiple periods in StopwatchEvent (start multiple times and not stop them all), the getDuration() method would return unexpected values.
This was because at every stop, the last entry in the `started` array was removed, while the `getDuration` method was still expecting all the started events to still be there.
Now, when calling `getDuration`, the duration of all the finished periods are added together with the unfinished counts.
Commits
-------
af00d8deab [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods
This PR was squashed before being merged into the 4.3 branch (closes#34165).
Discussion
----------
[PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
When an annotation is declared as `int[]|null`, it is handled like `(int|null)[]|null`. So array values are also nullable.
Now this behavior is fixed that `int[]|null` is either a collection of integers only or null.
How to reproduce:
```php
class Dummy
{
/** @var int[]|null */
public $nullableCollectionOfNonNullableElements;
}
/** @var Type[] $types */
$types = (new PhpDocExtractor())->getTypes(Dummy::class, 'nullableCollectionOfNonNullableElements');
$collectionType = $types[0];
assert($collectionType->isCollection() === true); // OK
assert($collectionType->isNullable() === true); // OK
assert($collectionType->getCollectionValueType()->getBuiltinType() === Type::BUILTIN_TYPE_INT); // OK
assert($collectionType->getCollectionValueType()->isNullable() === false); // FAILED
```
Commits
-------
5e394c40f0 [PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements
This PR was merged into the 3.4 branch.
Discussion
----------
[Stopwatch] Fixed a bug in StopwatchEvent::getStartTime
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34088
| License | MIT
| Doc PR | N/A
When using a `StopwatchEvent` with an `$origin` that's smaller than the first start time, calling `getStartTime()` before ending the event will give `0` instead of the correct number.
The proposed fix in #34088 fixes this.
Commits
-------
b2b7eab949 [Stopwatch] Fixed a bug in stopwatch event getStartTime
* Added a hardcoded day 01 in order to output the proper month November
which is the correct EOL and EOM month.
* \DateTime::createFromFormat('mY') will output December for every month
where day 31 exists.
This PR was merged into the 5.0-dev branch.
Discussion
----------
[Security] Add back ROLE_PREVIOUS_ADMIN to impersonated user
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Still useful as per https://symfony.com/doc/master/security/impersonating_user.html#knowing-when-impersonation-is-active
Commits
-------
64f4430cda [Security] Add back ROLE_PREVIOUS_ADMIN to impersonated user
This PR was merged into the 4.4 branch.
Discussion
----------
Add new Form WeekType
| 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32029
| License | MIT
| Doc PR | <!--symfony/symfony-docs#...--> coming soon
----
#### Update
After the first try, I've updated the field to have more options, and be more "straight".
The field acts like the `DateTimeType` or `TimeType`, various fields type (pure text, html5 type, select boxes), data validation, ....
For that I took the choice to update the `DateTimeToStringTransformer` and `DateTimeToArrayTransformer` to make them work with weeks format.
I was not sure if it was better to update them or create new ones, WDYT?
Before addind tests and docs, it would be nice to have your first thoughts/comments 😊
Do you need/want a small test repo?
Commits
-------
c4a2f026e0 Add new Form WeekType
This PR was merged into the 4.4 branch.
Discussion
----------
Form theme: support Bootstrap 4 custom switches
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | /
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/12464
Hello,
At the moment, Symfony form theme supports [custom checkboxes](https://getbootstrap.com/docs/4.3/components/forms/#checkboxes) through an extra class in `label_attr`.
Bootstrap4 introduced also [custom switches](https://getbootstrap.com/docs/4.3/components/forms/#switches), which has exactly the same HTML markup, but use a different class. This PR slightly modify `bootstrap_4_layout` to handle it.
![image](https://user-images.githubusercontent.com/919405/66651725-0eaa3100-ec34-11e9-8b68-94324730ac80.png)
Some reasons why I think supporting those have its place in Symfony:
- those are getting common in UI right now, it is a common use case
- it is complementary to normal checkboxes, and works the same way: required attribute, validation error, and so on are supported immediately
- implementing it yourself in your form theme is actually tricky, because of the way checkbox are handled (ie., `form_label` called inside `form_widget` with a `{ widget: parent() }`). You have to overwrite the whole fragment, otherwise you get an infinite recursion.
Finally, some screenshots and code examples.
Custom checkbox (as at the moment):
![image](https://user-images.githubusercontent.com/919405/66652982-41a1f400-ec37-11e9-813f-4b39087e89e7.png)
```php
->add('test', CheckboxType::class, [
'label_attr' => [
'class' => 'checkbox-custom',
],
])
```
Custom switch (proposed):
![image](https://user-images.githubusercontent.com/919405/66652902-1919fa00-ec37-11e9-98f3-9340b01b2335.png)
```php
->add('test', CheckboxType::class, [
'label_attr' => [
'class' => 'switch-custom',
],
])
```
Commits
-------
99f59e262f Supporting Bootstrap 4 custom switches
This PR was merged into the 4.4 branch.
Discussion
----------
[DI] Add ability to choose behavior of decorations on non existent decorated services
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | #33522
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/12442
# Handling decorations on non existent decorated services
Handle decorations on non existent decorated services by either throwing the service not found exception, silently ignoring services (decorator & decorated) all together or leave the decorated service to null (current behavior)
Something almost similar to how missing services as parameters are handles.
## Yaml configuration
```yaml
decorator:
decorates: decorated
decoration_on_invalid: ignore
```
Available values: `exception`, `ignore`, `null`. `exception` if nothing is specified.
## Xml configuration
```xml
<service id="decorator" decorates="decorated" decoration-on-invalid="ignore" />
```
Available values: `exception`, `ignore`, `null`. `exception` if nothing is specified.
## Behavior
- `exception`: Throws a `ServiceNotFoundException` telling that the decorator's dependency is missing
- `ignore`: Remove decorator definition. Decorator and decorated will not be available at all.
- `null`: Keep decorator but set decorated to null. Therefore, decorator `__construct` should be written with a nullable decorated dependency (`public function __contruct(?DecoratedInterface $decorated) {}`) and check should be done in other methods
Commits
-------
f167c77eaf Handle non existent decorated services
This PR was squashed before being merged into the 4.3 branch (closes#34035).
Discussion
----------
[Serializer] Fix property name usage for denormalization
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Using the `@SerializedName()` and passing it an existing property name affects the deserialization even if `@Groups()` are not supposed to be involved.
## How to reproduce
Given the following class
```php
class Foo
{
/**
* @Group("list")
*/
private $bar;
public function setBar($bar)
{
$this->bar = $bar;
}
public function getBar()
{
return $this->bar;
}
/**
* @Groups({"list:export"})
* @SerializedName("bar")
*/
public function getBarForExport()
{
return $this->bar.' Rocks';
}
}
```
This allow us to change the content of the property based on the normalization context.
```php
$obj = new Foo();
$obj->setBar('Api Platform');
$data = $normalizer->normalize($obj, null, ['groups' => ["list"]]);
// $data => ['bar' => 'Api Platform'] as expected
$data = $normalizer->normalize($obj, null, ['groups' => ["list:export"]]);
// $data => ['bar' => 'Api Platform Rocks'] as expected
$obj = $normalizer->denormalize(['bar' => 'Api Platform'], Foo::class, null, ['groups' => ['list']]);
// $obj->getBar() would return null instead of 'Api Platform' as expected.
```
Commits
-------
8ca4a3f345 [Serializer] Fix property name usage for denormalization
This PR was merged into the 4.4 branch.
Discussion
----------
Fix typo
| 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 | n/a <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | n/a
<!--
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):
- 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 4.4.
- Legacy code removals go to the master branch.
-->
Commits
-------
327a13cac0 Fix typo
This PR was merged into the 4.4 branch.
Discussion
----------
[Messenger] extract worker logic to listener and get rid of SendersLocatorInterface::getSenderByAlias
| 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 | Fix#32077 and #31848
| License | MIT
| Doc PR |
as discussed with @weaverryan sending messages for retry and failure directly to transport instead of redispatching on the bus makes things much cleaner
Commits
-------
d7e0f98cd0 [Messenger] extract worker logic to listener and sent messages for retry and failure directly to transport instead of redispatching on the bus
This PR was squashed before being merged into the 4.4 branch (closes#34155).
Discussion
----------
Revert SyncTransport simplification and fix properly
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34115 (and also related to #34066)
| License | MIT
| Doc PR | Not needed
In #34069, I made `SyncTransport` simpler by removing that transport class and making the whole things a config trick. I felt GREAT about that solution... until i realized two big problems:
1) It kills using env vars for `sync://` because we read the config values at build time - #34115 - that could probably be fixed by adding a factory, but then there is also the next problem
2) If someone routed a message to `[async, sync]` (weird, but allowed), my #34069 config solution basically maps this internally to `[async]`, which actually causes the message to *not* be handled immediately. Basically, my solution only worked if you route a message ONLY to one sync transport, but fails if you route to multiple transports.
So... this fixes things in a less-cool, but sensible way:
A) The first commit reverts #34069 exactly
B) The second commit solves the issue that we need to know if a message is being handled in a "worker" context or not, so middleware can decide if they should reset things before/after handling things. Previously we were using `ReceivedStamp` to know this. But because `SyncTransport` also "receives" the message and adds this stamp, it's not enough. To fix this, I added a new `ConsumedByWorkerStamp` that clearly means: "This message is being handled by a worker" (and so, you might want to "reset" some things before/after handling).
Thanks!
Commits
-------
01a9fefe77 Adding ConsumedByWorkerStamp as way to mark a message in a "worker context"
38f19a960c Revert "[Messenger] Removing "sync" transport and replacing it with much nicer config trick"
This PR was merged into the 4.4 branch.
Discussion
----------
[VarDumper] Do not dump the EventDispatcher
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
31c402a003 [VarDumper] Do not dump the EventDispatcher
This PR was merged into the 4.4 branch.
Discussion
----------
[Cache] add DeflateMarshaller - remove phpredis compression
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
phpredis compression doesn't play well with lua scripting as used in #33939
Let's remove it and provide a `DeflateMarshaller` instead.
Ppl can use it via decoration:
```yaml
services:
Symfony\Component\Cache\Marshaller\DeflateMarshaller:
decorates: cache.default_marshaller
arguments: ['@Symfony\Component\Cache\Marshaller\DeflateMarshaller.inner']
```
It's not enabled by default because that might break pools that are shared between different apps.
/cc @andrerom FYI
Commits
-------
452c863639 [Cache] add DeflateMarshaller - remove phpredis compression
This PR was merged into the 4.4 branch.
Discussion
----------
[DI] fix regexp for anonymous services with no class set
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Follows #33782
Commits
-------
a302d2050e [DI] fix regexp for anonymous services with no class set
This PR was merged into the 4.3 branch.
Discussion
----------
[4.3] Remove unused local variables
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Follow up of https://github.com/symfony/symfony/pull/34105 on 4.3.
Commits
-------
58161b8eec [4.3] Remove unused local variables
* 4.4:
[Config] Disable default alphabet sorting in glob function due of unstable sort
[HttpClient] always return the empty string when the response cannot have a body
[TwigBundle][exception] Added missing css variable to highlight line in trace
[Serializer] Improve messages for unexpected resources values
[SecurityBundle] correct types for default arguments for firewall configs
* 4.3:
[Config] Disable default alphabet sorting in glob function due of unstable sort
[HttpClient] always return the empty string when the response cannot have a body
[TwigBundle][exception] Added missing css variable to highlight line in trace
[Serializer] Improve messages for unexpected resources values
[SecurityBundle] correct types for default arguments for firewall configs
* 3.4:
[Config] Disable default alphabet sorting in glob function due of unstable sort
[Serializer] Improve messages for unexpected resources values
[SecurityBundle] correct types for default arguments for firewall configs
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[Config] Disable default alphabet sorting in glob function due of unstable sort
…table sort
| 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#33990 <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | no <!-- required for new features -->
`\Symfony\Component\Config\Resource\GlobResource::getIterator` loads files using `glob` not it the stable sorting, e.g several files: `doctrine.yml` and `doctrine_mongodb.yaml` in `config/packages` folder.
On requests these files come(randomly) in a different order, which leads to reinitialization of symfony kernel in `dev` environment. It's a little bit annoying and takes a lot of time in a common :(
<!--
Additionally (see https://symfony.com/roadmap):
- 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 4.4.
- Legacy code removals go to the master branch.
-->
Commits
-------
3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort
* 4.4:
[HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN
[Validator] Add AutoMapping constraint to enable or disable auto-validation
[DI] Fix "!tagged" related upgrade/changelog notes
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
```yaml
framework:
session:
handler_id: 'redis://localhost'
handler_id: '%env(REDIS_URL)%'
handler_id: '%env(DATABASE_URL)%'
handler_id: 'file://%kernel.project_dir%/var/sessions'
```
etc.
the database connection is not shared with the ORM (don't mess with transactions.)
redis/memcached connections are shared between cache and session.
(as a reminder, cache and ORM share the db connection: we're ok with trashing the cache on a rollback)
Lock-related changes are a follow up of #34043.
(fabbot failure is false positive)
Commits
-------
de9c61f423 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN
This PR was squashed before being merged into the 4.4 branch (closes#32107).
Discussion
----------
[Validator] Add AutoMapping constraint to enable or disable auto-validation
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32070, #32015 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | todo
As discussed in #32070 and #32015, it's sometimes mandatory to prevent some classes or properties to be auto mapped (auto-validated). This PR introduces a new constraint, `@AutoMapping` allowing to do exactly that. Examples:
Class:
```php
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @Assert\AutoMapping(false)
*/
class DoctrineLoaderNoAutoMappingEntity
{
/**
* @ORM\Id
* @ORM\Column
*/
public $id;
/**
* @ORM\Column(length=20, unique=true)
*/
public $maxLength;
}
```
Property:
```php
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
*/
class DoctrineLoaderEntity extends DoctrineLoaderParentEntity
{
/**
* @ORM\Id
* @ORM\Column
*/
public $id;
/**
* @ORM\Column(length=10)
* @Assert\AutoMapping(false)
*/
public $noAutoMapping;
}
```
The rules are the following:
* If the constraint is present on a property, and set to true, auto-mapping is always on, regardless of the config, and of any class level annotation
* If the constraint is present on a property, and set to false, auto-mapping is always off, regardless of the config, and of any class level annotation
* If the constraint is present on a class, and set to true, auto-mapping is always on except if a the annotation has been added to a specific property, and regardless of the config
* If the constraint is present on a class, and set to false, auto-mapping is always off except if a the annotation has been added to a specific property, and regardless of the config
Commits
-------
f6519ce88b [Validator] Add AutoMapping constraint to enable or disable auto-validation
This PR was merged into the 4.3 branch.
Discussion
----------
[TwigBundle][exception] Added missing css variable to highlight line in trace
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
---
To get the yellow background
![image](https://user-images.githubusercontent.com/408368/67779323-c331b880-fa64-11e9-9a2f-97730a89a6d6.png)
Commits
-------
5f19501 [TwigBundle][exception] Added missing css variable to highlight line in trace
* 4.4:
Re-allow to use "tagged" in service definitions
[HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()
Add missing lock connection string in FrameworkExtension
[DomCrawler] normalizeWhitespace should be true by default
[DoctrineBridge] Auto-validation must work if no regex are passed
Allows URL DSN in Lock and Cache
This PR was merged into the 4.4 branch.
Discussion
----------
Re-allow to use "tagged" in service definitions
| 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 | n/a
| License | MIT
| Doc PR | n/a
Re-allow to use `tagged` in 4.4 and 5.0. It makes it easier for bundles to support both Symfony 4.3- and Symfony 4.4+.
Needed to make API Platform compatible with Symfony 5 (api-platform/core#3009)
Commits
-------
7b7dc0df9a Re-allow to use "tagged" in service definitions
This PR was merged into the 4.4 branch.
Discussion
----------
[Lock][Cache] Allows URL DSN in PDO adapters
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | TODO
This PR duplicate a feature from PdoSessionHandler that convert URL DSN ( ie. mysql://localhost/test) into PDO DSN (ie. mysql:host=localhost;dbname=test)
that would ease configuration by using the same well-known variable
```
framework:
lock: '%env(DATABASE_URL)%'
```
note: I applied the same change on Cache component for consistency.
Commits
-------
474daf976e Allows URL DSN in Lock and Cache
This PR was squashed before being merged into the 4.3 branch (closes#33828).
Discussion
----------
[DoctrineBridge] Auto-validation must work if no regex are passed
| Q | A
| ------------- | ---
| Branch? | 4.3
| 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
Backport of https://github.com/symfony/symfony/pull/32107/files#r295762928.
This behavior if faulty, if no regex are passed, autvalidation must be triggered, [as done in `PropertyInfoLoader`](https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/Validator/Mapping/Loader/PropertyInfoLoader.php#L50).
Commits
-------
5ed7d6c759 [DoctrineBridge] Auto-validation must work if no regex are passed
This PR was merged into the 4.4 branch.
Discussion
----------
[ErrorRenderer] Security fix: hide sensitive error messages
| 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 -->
| Tickets | n/a
| License | MIT
| Doc PR | n/a
This PR fixes a security issue. Exception messages must not be displayed except when debugging, because they can contain sensitive data including credentials.
For instance, PDO and Doctrine throw exception with message such as `The details are: SQLSTATE[HY000] [1045] Access denied for user 'root'@'db.example.com' (using password: NO)` revealing internal details about the infrastructure usful for an attacker.
Also, I still think that ErrorRenderer should be removed in favor of using the Serializer directly (see https://github.com/symfony/symfony/pull/33650#issuecomment-534441889). I'll try to open some PRs to do that in tomorrow.
Commits
-------
d7d7f22 [ErrorRenderer] Security fix: hide sensitive error messages
This PR was merged into the 4.3 branch.
Discussion
----------
[OptionsResolver] Fix an error message to be more accurate
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#30432
| License | MIT
| Doc PR | -
Follow-up https://github.com/symfony/symfony/pull/30442 for 4.3
Commits
-------
1be68a752a Fix an error message to be more accurate
* 4.4:
[OptionsResolve] Revert change in tests for a not-merged change in code
[HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected
[Workflow] Made the configuration more robust for the 'property' key
[Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible
[FrameworkBundle] make SodiumVault report bad decryption key accurately
cs fix
[Security] Allow to set a fixed algorithm
[Security/Core] make encodedLength computation more generic
[Security/Core] add fast path when encoded password cannot match anything
#30432 fix an error message
fix paths to detect code owners
[HttpClient] ignore the body of responses to HEAD requests
[Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
[SecurityBundle] Fix wrong assertion
Remove unused local variables in tests
[Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method
Make sure to collect child forms created on *_SET_DATA events
[WebProfilerBundle] Improve display in Email panel for dark theme
do not render errors for checkboxes twice
* 4.3:
[OptionsResolve] Revert change in tests for a not-merged change in code
[HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected
[Workflow] Made the configuration more robust for the 'property' key
[Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible
#30432 fix an error message
fix paths to detect code owners
[HttpClient] ignore the body of responses to HEAD requests
[Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
[SecurityBundle] Fix wrong assertion
Remove unused local variables in tests
[Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method
Make sure to collect child forms created on *_SET_DATA events
[WebProfilerBundle] Improve display in Email panel for dark theme
do not render errors for checkboxes twice
This PR was merged into the 3.4 branch.
Discussion
----------
[SecurityBundle] correct types for default arguments for firewall configs
| Q | A
| ------------- | ---
| Branch? | 3.4 (and forward)
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | n/a
Up until now, the default template arguments in the `security.firewall.config` abstract service definition have been each defined (aside from the argument for `$listeners` which is given a `collection` type) in the XML as
```xml
<argument />
```
which resolves to an empty string, despite that some of the arguments are typed to being either `bool` or `array|null` on the `Symfony\Bundle\SecurityBundle\Security\FirewallConfig` class itself.
This wouldn't be so much of a problem if the child definitions that use this as a template overrode all the arguments every time, but in the case of firewall configs that mark security as _not_ being enabled, [only the first few arguments are overwritten](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L349-L352), so firewall config objects that do not have security enabled are instantiated by the DI container with parameters with some of the wrong types.
In general this wouldn't be an issue, as firewalls with security not enabled would not usually be consumed in a context where further security-related config were needed, but there is a case in `Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector` where the method `getSwitchUser()` on the firewall config object [can be called](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php#L181) without checking first whether the firewall has security enabled, which leads to an exception being thrown:
```
Symfony\Component\Debug\Exception\ContextErrorException
Warning: Illegal string offset 'parameter'
in vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php (line 184)
```
which is down to the firewall config being set with an empty string rather than `null` (in which case the logic here would function as expected).
It seemed most appropriate as a fix (especially given possible introduction of scalar type hints in the future) to apply types to the default arguments so that it was no longer possible to instantiate a firewall config object with parameters of unexpected types.
<!--
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):
- 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 4.4.
- Legacy code removals go to the master branch.
-->
Commits
-------
6b7044fc01 [SecurityBundle] correct types for default arguments for firewall configs
* 3.4:
#30432 fix an error message
fix paths to detect code owners
[Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
Remove unused local variables in tests
Make sure to collect child forms created on *_SET_DATA events
do not render errors for checkboxes twice
This PR was merged into the 4.3 branch.
Discussion
----------
[Workflow] Made the configuration more robust for the 'property' key
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34092
| License | MIT
| Doc PR |
Commits
-------
0c31ff007e [Workflow] Made the configuration more robust for the 'property' key
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
A `304` is the final response code.
This PR implements the same logic as curl.
Commits
-------
50a88c59f6 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected
This PR was merged into the 4.4 branch.
Discussion
----------
[Security] Allow to stick to a specific password hashing algorithm
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#33054
| License | MIT
| Doc PR | todo
Allows using `argon2i`, `argon2id` and `bcrypt`.
Commits
-------
6712d1e504 [Security] Allow to set a fixed algorithm
This PR was merged into the 5.0-dev branch.
Discussion
----------
Slack notifier actions
| Q | A
| ------------- | ---
| Branch? | 5.0 <!-- 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 | -
Slack messages can contain actions/buttons.
Commits
-------
b6e203dfe7 [Notifier] Add the possibility to add actions on Slack messages
This PR was merged into the 4.4 branch.
Discussion
----------
[Security/Core] add fast path when encoded password cannot match anything
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Only `MessageDigestPasswordEncoder` and `Pbkdf2PasswordEncoder` need this fast path: the sodium and the native encoders already implement it natively.
When a migrating encoder is used, a failed password validation fallbacks to all encoders. This makes the process slower than needed currently.
Commits
-------
c57f8f7f93 [Security/Core] add fast path when encoded password cannot match anything
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Remove suffix convention when using env vars to override secrets from the vault
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Right now, env vars that override encrypted secrets must en up with `_SECRET`.
This PR removes this convention. It also enforces that only vars defined in the vault can be overriden locally. This means one cannot set a local-only secret.
Commits
-------
2ec9647e75 [FrameworkBundle] Remove suffix convention when using env vars to override secrets from the vault
This PR was merged into the 3.4 branch.
Discussion
----------
[OptionsResolver] Fix an error message to be more accurate
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30432
| License | MIT
| Doc PR |
See #30432 for more details:
> **Symfony version(s) affected**: 3.4, maybe other versions too (not tested)
>
> **Description**
> Error message when allowedTypes is an array contains `[]` but should not:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer[]".`
> It should be:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer".`
>
> **How to reproduce**
>
> ```
> $resolver = (new OptionsResolver())
> ->setDefault('testme', [])
> ->setAllowedTypes('testme', ['string[]'])
> ->resolve(['testme' => ['test', 12]]);
> ```
In addition I changed an error message to be more
accurate if provided more than one incorrect value:
> [...] is expected to be of type "integer[][]", but is of type "integer|boolean|string".
Commits
-------
7fa2fc2#30432 fix an error message
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] Make sure to collect child forms created on *_SET_DATA events
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#29291
| License | MIT
| Doc PR | -
See reproducer provided by @WubbleWobble https://github.com/WubbleWobble/symfony-issue-29291.
Commits
-------
50efc1a Make sure to collect child forms created on *_SET_DATA events
This PR was merged into the 4.3 branch.
Discussion
----------
[Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This method is internal and unused. It was removed by a2ae6bf745 but was added back mistakenly by 1baac5a74f.
Commits
-------
49acc16424 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] ignore the body of responses to HEAD requests
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34102
| License | MIT
| Doc PR | -
Commits
-------
0fc371e7df [HttpClient] ignore the body of responses to HEAD requests
This PR was squashed before being merged into the 3.4 branch (closes#34097).
Discussion
----------
[Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Drupal is testing on PHP7.4 and hitting a problem with the line `if ('[' === $subPath[0]) {` because `$subPath` is not a string. We're already doing string casting in the method so we could do it once and be done. Note this is not a problem on the master branch / SF5 because of primitive typehinting.
Without this fix on PHP7.4 you see errors like...
```
1) Symfony\Component\Validator\Tests\Util\PropertyPathTest::testAppend with data set #5 ('0', 1, '0.1', 'Numeric subpaths do not cause...rrors.')
Trying to access array offset on value of type int
```
Commits
-------
6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] use database platform to convert correctly the DateTime
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/32427
| License | MIT
In Doctrine Messenger the method `\Symfony\Component\Messenger\Transport\Doctrine\Connection::formatDateTime()` is used to format dateTime into this: `Y-m-d\TH:i:s`.
But this is not supported in all databases platform.
Here we use the database platform to convert correctly the dateTime.
Commits
-------
cfa11561d1 Format DateTime depending on database platform
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] allow option "buffer" to be a stream resource
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
e87301603e [HttpClient] allow option "buffer" to be a stream resource
This PR was merged into the 5.0-dev branch.
Discussion
----------
[Notifier] Fix default value for phone number of admins
| Q | A
| ------------- | ---
| Branch? | 5.0
| 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 | n/a
`AdminRecipient` does not support `null` for phone.
Commits
-------
1f82ab6155 [Notifier] Fix default value for phone number of admins
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] Show exceptions after multiple retries
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #32311
| License | MIT
| Doc PR | n/a
After retrying a failed message, the `RedeliveryStamp` looses it's exception information. This PR will remedy that.
Commits
-------
598bd92313 [Messenger] Show exceptions on after empty fails
* 4.4:
[Validator] Set Length::$allowEmptyString to false when a NotBlank contraint is defined
[FrameworkBundle] Dont reset the test container but the real one instead
Import missing classes
[SecurityBundle] test with doctrine-bundle 2
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Don't reset the test container but the real one instead
| Q | A
| ------------- | ---
| Branch? | 4.4 for features / 3.4 or 4.3 for bug fixes <!-- see below -->
| Bug fix? | yes/no
| New feature? | yes/no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | -
After #31202 and #32056, the tearDown method keeps throwing deprecation notices about "Getting the container from a non-booted kernel". The reason is that resetting the test-container calls `$kernel->getContainer()` while the kernel has been shut down.
This fixes it and a few other glitches found meanwhile.
Commits
-------
8e16143256 [FrameworkBundle] Dont reset the test container but the real one instead
This PR was merged into the 4.4 branch.
Discussion
----------
[SecurityBundle] test with doctrine-bundle 2
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
e3261f4f7f [SecurityBundle] test with doctrine-bundle 2
* 4.4:
[Debug] remove return types that break FC badly
[Mailer][MailchimpBridge] Don't send address names if empty string
[ExpressionLanguage][Lexer] Exponential format for number
[Mailer] Fix SES Message Id retrieval
Add .gitignore to .gitattributes
This PR was merged into the 4.4 branch.
Discussion
----------
[Debug] remove return types that break FC badly
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
The return type on Debug's FlattenException blocks creating a child class that is compatible with both v4.4 and v5.0.
Removing it fixes the issue with no BC break.
Adding `final` on `setPrevious` will allow updating its type hint in v5.0.
Commits
-------
cb5ef6ec18 [Debug] remove return types that break FC badly
This PR was merged into the 4.4 branch.
Discussion
----------
Add .gitignore to .gitattributes
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #33946
| License | MIT
Commits
-------
246c5fdf43 Add .gitignore to .gitattributes
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Fix typo
| Q | A
| ------------- | ---
| Branch? | 4.4 for features / 3.4 or 4.3 for bug fixes <!-- 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#34006
| License | MIT
| Doc PR | n/a
The XML is different depending on the way we are sending email. So, it's `SendEmailResult` when using the API and `SendRawEmailResult` when using the HTTP class (we are then sending the raw email).
Commits
-------
4bd7cb0368 [Mailer] Fix SES Message Id retrieval
This PR was merged into the 4.4 branch.
Discussion
----------
[ExpressionLanguage][Lexer] Exponential format for number
Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Ex: expression (1 + 1.99E+3) = 1991
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Expressions:
0.1e+2 = 10
1e-2 = 0.01
(1 + 1.99E+3) = 1991
and etc...
Commits
-------
430ec32992 [ExpressionLanguage][Lexer] Exponential format for number
* 4.4:
[ErrorRenderer] FlattenException cannot be final
Fixing issue where worker-only middleware were run in all contexts
[Messenger] Removing "sync" transport and replacing it with much nicer config trick
Use port 465 for SES SMTP transport
[DI] made the `%env(base64:...)%` processor able to decode base64url
[VarDumper] improve displaying cut closures
Set ReturnType of LockFactory to LockInterface
[EventDispatcher] handle lazy-callable invokable
This PR was merged into the 4.4 branch.
Discussion
----------
Use port 465 for SES SMTP transport
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34064
| License | MIT
Commits
-------
8492e260cb Use port 465 for SES SMTP transport
This PR was merged into the 4.4 branch.
Discussion
----------
[Messenger] Fix worker-only Doctrine middleware from running always
| Q | A
| ------------- | ---
| Branch? | 4.4 (or 4.3?, this is a bug fix)
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#32436 Depends on #34069
| License | MIT
| Doc PR | not needed
Several Doctrine middleware are only meant to be run in a "worker" context: we want to "ping" the connection, "close" the connection and "clear" the entity manager ONLY when we are receiving messages. Before this PR, it was done always, which causes bad behavior for sync messages (imagine your Doctrine connection being closed in the middle of a controller or see https://github.com/symfony/symfony/pull/31334#issuecomment-544288437).
This fixes that in a pragmatic way: no new system for "worker-only" middleware or anything like that: just make the middleware smart enough to only do their work when a message is being received async.
Commits
-------
290a72917b Fixing issue where worker-only middleware were run in all contexts
This PR was merged into the 4.4 branch.
Discussion
----------
[ErrorRenderer] FlattenException cannot be final
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Making it final forces tight coupling with the implementation as soon as one type-hints for the class.
That's a blocker on making e.g. `EasyAdminBundle` compatible with Symfony 5.
Commits
-------
b125835056 [ErrorRenderer] FlattenException cannot be final
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] skip tests implemented in 4.4
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Needed after #34051 and #34044
Commits
-------
ae86ab18fa [HttpClient] skip tests implemented in 4.4
This PR was merged into the 4.4 branch.
Discussion
----------
[VarDumper] improve displaying cut closures
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Minor but still an improvement so 4.4: this change makes closures replaced by `CutStub` be displayed with their signature instead of just the `Closure` label.
Commits
-------
2b0a11de02 [VarDumper] improve displaying cut closures
This PR was merged into the 4.4 branch.
Discussion
----------
[Lock] Set ReturnType of LockFactory to LockInterface
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix #...
| License | MIT
| Doc PR |
LockFactory I think should return a LockInterface and not the Lock class.
/cc @chalasr
Commits
-------
ff1fa57ef2 Set ReturnType of LockFactory to LockInterface
This PR was merged into the 3.4 branch.
Discussion
----------
[TwigBridge] do not render errors for checkboxes twice
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34008
| License | MIT
| Doc PR |
Commits
-------
9eddea97d8 do not render errors for checkboxes twice
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] Fix ignored options in redis transport
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33425
| License | MIT
| Doc PR | -
Also fixes redis authentication failure handling (inline with invalid db index handling, borrowed from symfony/cache).
/cc @alexander-schranz
Commits
-------
c83ff94c37 [Messenger] Fix ignored options in redis transport
* 4.4:
[Console] Revert wrong change
[HttpClient] Add a canceled state to the ResponseInterface
Fix small typo in Exception message
Restrict secrets management to sodium+filesystem
Add secrets management
Proof of concept for encrypted secrets
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Add `secrets:*` commands and `%env(secret:...)%` processor to deal with secrets seamlessly
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#27351
| License | MIT
| Doc PR | symfony/symfony-docs/pull/11396
This PR continues #31101, please see there for previous discussions. The attached patch has been fine-tuned on https://github.com/nicolas-grekas/symfony/pull/33 with @jderusse.
This PR is more opinionated and thus a lot simpler than #31101: only Sodium is supported to encrypt/decrypt (polyfill possible), and only local filesystem is available as a storage, with little to no extension point. That's on purpose: the goal here is to provide an experience, not software building blocks. In 5.1, this might be extended and might lead to a new component, but we'd first need reports from real-world needs. Having this straight-to-the-point in 4.4 will allow gathering these needs (if they exist) and will immediately provide a nice workflow for the need we do want to solve now: forwarding secrets from dev to prod using git in a secure way.
The workflow this will allow is the following:
- public/private key pairs are generated in the `config/secrets/%kernel.environment%/` folder using `bin/console secrets:generate-keys`
- for the prod env, the corresponding private key should be deployed to the server using whatever means the hosting provider allows - this key MUST NOT be committed
- the public key is used to encrypt secrets and thus *may* be committed in the git repository to allow anyone *that can commit* to add secrets - this is done using `bin/console secrets:set`
DI configuration can reference secrets using `%env(secret:...)%` in e.g `services.yaml`.
There is also `bin/console secrets:remove` and `bin/console debug:secrets` to complete the toolbox.
In terms of design, vs #31101, this groups the dual "encoder" + "storage" concepts in a single "vault" one. That's part of what makes this PR simpler.
That's all folks :)
Commits
-------
c4653e1f65 Restrict secrets management to sodium+filesystem
02b5d740e5 Add secrets management
8c8f62390a Proof of concept for encrypted secrets
* 4.4:
[HttpKernel] fix wrong removal of the just generated container dir
bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
[Routing] fix route loading with wildcard, but dir or file is empty
bump Form component compatibility versions
execute all compatible tests across versions
[Mailer][MailchimpBridge] Fix NamedAddress obsolete paths
* 4.3:
[HttpKernel] fix wrong removal of the just generated container dir
bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
[Routing] fix route loading with wildcard, but dir or file is empty
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpKernel] fix wrong removal of the just generated container dir
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
The patch applies to 3.4 but the fix really affects to 4.4 with the introduction of the new `.preload.php` file.
/cc @fabpot since you encountered this error quite often recently during `composer up/req` :)
Commits
-------
4ad09ebafb [HttpKernel] fix wrong removal of the just generated container dir
This PR was merged into the 4.3 branch.
Discussion
----------
[Routing] fix route loading with wildcard, but dir or file is empty
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | no ticket i see so far
| License | MIT
In my route config i have something like:
```yaml
empty_wildcard:
resource: ../controller/empty_wildcard/*
prefix: /empty_wildcard
```
But ``empty_wildcard`` is empty or has no route configured.
So i had this error:
``Call to a member function addPrefix() on null``
This PR take care if no route is configured, there will be no error.
Commits
-------
217058b475 [Routing] fix route loading with wildcard, but dir or file is empty
This PR was merged into the 4.3 branch.
Discussion
----------
[Routing] fix route loading with wildcard, but dir or file is empty
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | no ticket i see so far
| License | MIT
In my route config i have something like:
```yaml
empty_wildcard:
resource: ../controller/empty_wildcard/*
prefix: /empty_wildcard
```
But ``empty_wildcard`` is empty or has no route configured.
So i had this error:
``Call to a member function addPrefix() on null``
This PR take care if no route is configured, there will be no error.
Commits
-------
217058b475 [Routing] fix route loading with wildcard, but dir or file is empty
* 4.4:
[DI] add `LazyString` for lazy computation of string values injected into services
[Dotenv] allow LF in single-quoted strings
Replace STDIN by php://stdin
[Yaml] Throw exception for tagged invalid inline elements
[Mailer] Fix Mandrill Transport API payload with named addresses
[HttpClient] improve StreamWrapper
* 4.3:
[Dotenv] allow LF in single-quoted strings
[Yaml] Throw exception for tagged invalid inline elements
[Mailer] Fix Mandrill Transport API payload with named addresses
This PR was merged into the 3.4 branch.
Discussion
----------
[Dotenv] allow LF in single-quoted strings
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
in a shell:
```sh
FOO='bar
baz'
```
is legal to set a value to (in PHP):
```php
"bar\nbaz"
```
Commits
-------
4d79116a0d [Dotenv] allow LF in single-quoted strings
This PR was merged into the 3.4 branch.
Discussion
----------
[Yaml] Throw exception for tagged invalid inline elements
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | n/a
At the moment the result for `!foo 'don't do somthin' like that'` is a `TaggedValue` with value "don".
Commits
-------
bed479c561 [Yaml] Throw exception for tagged invalid inline elements
This PR was merged into the 4.4 branch.
Discussion
----------
Replace STDIN by php://stdin
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
`STDIN` is SAPI-dependent.
Commits
-------
365d02be77 Replace STDIN by php://stdin
* 4.4:
extend legacy exception for backwards compatibility
[HttpClient] workaround curl_multi_select() issue
[CI] fix building local packages
Add show-deprecations option to lint:twig command
[HttpClient] try using php-http/discovery when nyholm/psr7 is not installed
[FrameworkBundle] Improve the sorting of tagged services
[HttpClient] add HttpClient::createForBaseUri()
Increase limits for flakey appveyor tests
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] add HttpClient::createForBaseUri()
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
I've seen ppl use `HttpClient::create()` with default `base_uri` & `auth_bearer`. That's a security risk as the bearer would be sent to any hosts that the client requests.
Instead, ppl should use `ScopingHttpClient`.
The new method should help to discover and use it.
Commits
-------
1aa9a118d6 [HttpClient] add HttpClient::createForBaseUri()
This PR was merged into the 5.0-dev branch.
Discussion
----------
[String] Added test for replaceMatches
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33905
| License | MIT
| Doc PR |
Added test for String:replaceMatches
Commits
-------
1cbbddd4a9 [String] Added test for replaceMatches
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Improve the sorting of tagged services
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix https://github.com/symfony/symfony/issues/33716
| License | MIT
| Doc PR | -
Little DX improvement, to sort the tags inside each service tagged.
More details in linked issue.
Commits
-------
f892289351 [FrameworkBundle] Improve the sorting of tagged services
This PR was merged into the 5.0-dev branch.
Discussion
----------
[String] wrap(): test and fix
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | symfony/symfony-docs/pull/12440
Commits
-------
015b81a2f5 [String] wrap(): test and fix
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] try using php-http/discovery when nyholm/psr7 is not installed
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
In case one has `php-http/discovery`, we can leverage it...
Commits
-------
6e0cb581a1 [HttpClient] try using php-http/discovery when nyholm/psr7 is not installed
* 4.4:
fix PHP 5.6 compatibility
[Cache] fixed TagAwareAdapter returning invalid cache
Add plus character `+` to legal mime subtype
Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract
bug #33942 [DI] Add extra type check to php dumper
[Dotenv] search variable values in ENV first then env file
[PropertyInfo] Respect property name case when guessing from public method name
[VarDumper] fix resetting the "bold" state in CliDumper
Missing argument in method_exists
SCA: added missing break in a loop
* 4.3:
fix PHP 5.6 compatibility
[Cache] fixed TagAwareAdapter returning invalid cache
Add plus character `+` to legal mime subtype
Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract
bug #33942 [DI] Add extra type check to php dumper
[Dotenv] search variable values in ENV first then env file
[PropertyInfo] Respect property name case when guessing from public method name
[VarDumper] fix resetting the "bold" state in CliDumper
Missing argument in method_exists
SCA: added missing break in a loop
* 3.4:
fix PHP 5.6 compatibility
[Cache] fixed TagAwareAdapter returning invalid cache
[PropertyInfo] Respect property name case when guessing from public method name
This PR was squashed before being merged into the 4.4 branch (closes#33967).
Discussion
----------
[Mailer] Add Message-Id to SentMessage when sending an email
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes-ish
| New feature? | yes-ish as well
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | fixes#33681
| License | MIT
| Doc PR | -
This adds `SentMessage::getMessageId()` to retrieve the message id as generated internally OR by the provider sending the email.
Commits
-------
d97d1f9bb4 [Mailer] Fix Message ID for Postmark SMTP
b42c269760 Add Message-Id to SentMessage when sending an email
This PR was merged into the 4.4 branch.
Discussion
----------
[Serializer][CSV] Add context options to handle BOM
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#33684
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/12461
This allows BOM handling in en/decoded CSV files. To keep current behaviour intact both skipping BOM at the beginning of the CSV and outputting BOM are an opt-in feature.
Personally I'd propose to make `SKIP_INPUT_BOM` default to `false` in 5.0 so the BOM is transparent and people that for some reasons expect BOM characters to be present in the parsed text explicitly opt-out of trimming it.
Commits
-------
3eb36684d8 Add context options to handle BOM
This PR was merged into the 3.4 branch.
Discussion
----------
[PropertyInfo] Respect property name case when guessing from public method name
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#32656
| License | MIT
| Doc PR |
Using camelCase, with an attribute `$aFooBar`, naming the getter/setter `getAFooBar()`/`setAFooBar()`, returns the property name as AFooBar instead of aFooBar.
# Before
Property name `'AFooBar'`
# After
Property name `'aFooBar'` as expected
Commits
-------
843bb76f8a [PropertyInfo] Respect property name case when guessing from public method name
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] resolve promise chains on HttplugClient::wait()
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#32142
| License | MIT
| Doc PR | -
Follow up of #33743
Right now, keeping a reference to promise objects returned by `HttplugClient::sendAsyncRequest()`, then calling their `wait()` method is the only way to actually resolve the promises. That's why when these promises are destructed, we cancel the corresponding HTTP request.
But thanks to the `HttplugClient::wait()` method, we have a hook to tick the event loop managed by the Symfony client.
I added a test case to run into this situation.
~It fails currently. I'd like asking @joelwurtz, @dbu and/or maybe @Nyholm if you could have a look and finish this PR? I'm not that familiar with promises and you might get faster and better to the goal. Anyone else is welcome also of course. Thank you for having a look :) PR welcome on my fork or as a separate one on this repos.~
Commits
-------
ea0be07a33 [HttpClient] resolve promise chains on HttplugClient::wait()
This PR was merged into the 4.4 branch.
Discussion
----------
[Cache] fix 2RTT + race condition in AbstractTagAwareAdapter::deleteItems()
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
A final improvement to `AbstractTagAwareAdapter::deleteItems()`: this PR makes `deleteItems()` operate in 1RTT instead of 2.
Commits
-------
0613c227ec [Cache] fix 2RTT + race condition in AbstractTagAwareAdapter::deleteItems()
This PR was merged into the 3.4 branch.
Discussion
----------
[Cache] fixed TagAwareAdapter returning invalid cache
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33953
| License | MIT
| Doc PR |
This PR fixes `TagAwareAdapter` returning `CacheItem` when item-tags pair is missing tag key in pool. Currently `TagAwareAdapter` returns `CacheItem` with empty tags and `isHit` set to `true`. With this PR it returns `CacheItem` with `isHit` set to `false` as we can't know if item is valid or invalid when it's missing tag entry so we treat it as cache miss.
Commits
-------
946f0a1e11 [Cache] fixed TagAwareAdapter returning invalid cache
This PR was merged into the 4.3 branch.
Discussion
----------
Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #33946
| License | MIT
Commits
-------
c2dd804a24 Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract
This PR was merged into the 4.3 branch.
Discussion
----------
[DI] Add extra type check to php dumper
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33942
| License | MIT
| Doc PR
This PR adds a missing type check in the PHP Dumper. The bug has been detected while working on the https://github.com/prooph/service-bus-symfony-bundle and I haven't been able to reproduce it within a minimalist testcase.
I would like to add a unit test to cover it once I have figured out the exact context in which the bug occurs.
Any help would be greatly appreciated to do so, especially from "senior" contributors of the DependencyInjection component, many thanks in advance!
You will find more information about this bug in the linked ticket above.
Commits
-------
b17ebdf081 bug #33942 [DI] Add extra type check to php dumper
* 3.4:
Add plus character `+` to legal mime subtype
[Dotenv] search variable values in ENV first then env file
[VarDumper] fix resetting the "bold" state in CliDumper
SCA: added missing break in a loop
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] added ReplyTo option for PostmarkApiTransport
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Supports "ReplyTo" option with Postmark transport
Commits
-------
d49a7387de [Mailer] added ReplyTo option for PostmarkApiTransport
This PR was merged into the 4.4 branch.
Discussion
----------
[ErrorHandler] Rework fatal errors
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/32605
| License | MIT
| Doc PR | -
Built on top of https://github.com/symfony/symfony/pull/33038 so review only the second commit : d5c3f7ed48
The goals of this PR is to replace current "fatal error handlers" with "error enhancers" since all our current fatal error handlers works on \Error since PHP7.
That means we won't use the FatalErrorException anymore, so we will be able to remove it (once we don't need it in the rest of the codebase).
The final goal btw is to handle \Throwable everywhere in the code so we can remove FatalThrowableError & FatalErrorException classes.
Commits
-------
aaa0cdf523 [ErrorHandler] Rework fatal error handlers
This PR was merged into the 4.4 branch.
Discussion
----------
[Cache] add TagAwareMarshaller to optimize data storage when using AbstractTagAwareAdapter
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | #33924
| License | MIT
| Doc PR | -
This is the final touch in my series of PR that fixes the linked issue.
Remarkably, the solutions I implemented for this issue are completely different than the one I described there. Fortunately, the issues themselves were correctly identified.
Plannification of implementation is gambling :)
/cc @andrerom
Commits
-------
5a4a30c6ef [Cache] add TagAwareMarshaller to optimize data storage when using AbstractTagAwareAdapter
This PR was merged into the 5.0-dev branch.
Discussion
----------
[String] add $lastGlue argument to join() methods
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
An idea that came when reviewing https://github.com/symfony/symfony-docs/pull/12440
Commits
-------
714d6290df [String] add $lastGlue argument to join() methods
This PR was merged into the 3.4 branch.
Discussion
----------
[VarDumper] fix resetting the "bold" state in CliDumper
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
21645a5b96 [VarDumper] fix resetting the "bold" state in CliDumper
This PR was merged into the 4.4 branch.
Discussion
----------
[Mime] added image/svg MIME support
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33909
| License | MIT
| Doc PR |
Added `image/svg` MIME type to `svg` extension.
More @#33909.
Commits
-------
015eb6625c added image/svg MIME support
* 4.3:
[Cache] ignore unserialization failures in AbstractTagAwareAdapter::doDelete()
[HttpClient] send `Accept: */*` by default, fix removing it when needed
This PR was merged into the 4.3 branch.
Discussion
----------
[Cache] ignore unserialization failures in AbstractTagAwareAdapter::doDelete()
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Making things more robust, part of #33924
Commits
-------
a1f334c1b7 [Cache] ignore unserialization failures in AbstractTagAwareAdapter::doDelete()
* 4.4: (26 commits)
cs fix
[Validator] sync NO and NB translations
[Cache] improve perf of pruning for fs-based adapters
[Cache] cs fix
[Cache] clean tags folder on invalidation
[Cache] remove implicit dependency on symfony/filesystem
Allow to set cookie_samesite to 'none'
[Dotenv] support setting default env var values
[VarDumper] fix array key error for class SymfonyCaster
[Cache] Improve RedisTagAwareAdapter invalidation logic & requirements
Adds missing translations for no nb
[HttpKernel] fix $dotenvVars in data collector
Add the missing translations for the Swedish ("sv") locale
Prevent ProgressBar redraw when message is same
[DI] enable improved syntax for defining method calls in Yaml
bumped Symfony version to 4.3.6
updated VERSION for 4.3.5
updated CHANGELOG for 4.3.5
bumped Symfony version to 3.4.33
updated VERSION for 3.4.32
...
* 4.3:
[Cache] clean tags folder on invalidation
[Cache] remove implicit dependency on symfony/filesystem
Allow to set cookie_samesite to 'none'
[VarDumper] fix array key error for class SymfonyCaster
Adds missing translations for no nb
[HttpKernel] fix $dotenvVars in data collector
Add the missing translations for the Swedish ("sv") locale
bumped Symfony version to 4.3.6
updated VERSION for 4.3.5
updated CHANGELOG for 4.3.5
bumped Symfony version to 3.4.33
updated VERSION for 3.4.32
update CONTRIBUTORS for 3.4.32
updated CHANGELOG for 3.4.32
[Messenger] DoctrineTransport: ensure auto setup is only done once
[Form][DateTimeImmutableToDateTimeTransformer] Preserve microseconds and use \DateTime::createFromImmutable() when available
[Crawler] document $default as string|null
* 3.4:
Adds missing translations for no nb
Add the missing translations for the Swedish ("sv") locale
bumped Symfony version to 3.4.33
updated VERSION for 3.4.32
update CONTRIBUTORS for 3.4.32
updated CHANGELOG for 3.4.32
This PR was merged into the 4.3 branch.
Discussion
----------
Allow to set SameSite config to 'none'
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33926
| License | MIT
| Doc PR | -
Commits
-------
eec7e8cc61 Allow to set cookie_samesite to 'none'
This PR was merged into the 4.4 branch.
Discussion
----------
[EventDispatcher] Allow to omit the event name when registering listeners
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | #33453 (kind of)
| License | MIT
| Doc PR | TODO
After #30801 and #33485, this is another attempt at taking advantage of FQCN events for simplifying the registration of event listeners by inferring the event name from the parameter type declaration of the listener. This is my last attempt, I promise. 🙈
This time, I'd like to make the `event` attribute of the `kernel.event_listener` tag optional. This would allow us to build listeners like the following one without adding any attributes to the `kernel.event_listener` tag.
```php
namespace App\EventListener;
final class MyRequestListener
{
public function __invoke(RequestEvent $event): void
{
// do something
}
}
```
This in turn allows us to register a whole namespace of such listeners without having to configure each listener individually:
```YAML
services:
App\EventListener\:
resource: ../src/EventListener/*
tags: [kernel.event_listener]
```
Commits
-------
6f32584c76 [EventDispatcher] Allow to omit the event name when registering listeners.
This PR was merged into the 4.3 branch.
Discussion
----------
[Form][DateTimeImmutableToDateTimeTransformer] Preserve microseconds and use \DateTime::createFromImmutable() when available
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
For PHP >= 7.3, we should use [\DateTime::createFromImmutable()](https://www.php.net/manual/en/datetime.createfromimmutable.php) directly.
This patch also preserves the `\DateTime` microseconds when the conversion is done with `\DateTime::createFromFormat()`.
Commits
-------
dfa23034c3 [Form][DateTimeImmutableToDateTimeTransformer] Preserve microseconds and use \DateTime::createFromImmutable() when available
This PR was merged into the 4.4 branch.
Discussion
----------
[Cache] Improve RedisTagAwareAdapter invalidation logic & requirements
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes, _and improvment_
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
| Doc PR |
Changes logic of invalidation in RedisTagAwareAdapter in order to:
- Delete the tag key on invalidation => _avoiding possible left behind empty tag keys that Redis is not allowed to evict, gradually consuming more and more memory_
Positive side effects of no longer using sPOP:
- Lowered requirements to Redis 2.8, and no specific version constraint for phpredis
- Lift limitation of 2 billion keys per tag _(Now only limited by Redis Set datatype: 4 billion)_
Commits
-------
3d38c58b42 [Cache] Improve RedisTagAwareAdapter invalidation logic & requirements
This PR was squashed before being merged into the 4.4 branch (closes#33884).
Discussion
----------
Prevent ProgressBar redraw when message is same
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
This PR prevents ProgressBar from performing unnecessary redrawes if new output is same as current one. This is mostly useful when working with multiple progress bars. Same behavior can enforced by carefully setting redraw frequency, but I don't see any downsides for smarter redrawing by default.
This can be moved to `if ($this->overwrite)` if necessary, so it's applied only in case overwriting is enabled.
Commits
-------
78b515f049 Prevent ProgressBar redraw when message is same
This PR was merged into the 4.3 branch.
Discussion
----------
[Crawler] document $default as string|null
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This has been introduced in 4.3
Commits
-------
e96add4787 [Crawler] document $default as string|null
This PR was squashed before being merged into the 4.3 branch (closes#32308).
Discussion
----------
[Messenger] DoctrineTransport: ensure auto setup is only done once
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Setup is done for every invocation of `get`, `find`, and `findAll`.
For `get`, this causes message consumption to be very slow, as slow as 1 message per second on my moderately sized schema, because a schema diff is done in `setup` every `get`.
I'm not sure what the desired behaviour is here, but it seems like we should try performing a query, fail once, `setup`, and retry. This will the same approach taken by the PDO Cache.
However, we still need auto setup in `get`, as `get` starts a transaction, so the auto setup in `executeQuery` won't be called.
Further more, the same problem seems to exist for the AMPQ Transport, but the performance impact should be less there, but i have not tried.
Commits
-------
02414027e1 [Messenger] DoctrineTransport: ensure auto setup is only done once
* 4.4:
[travis] Fix build-packages script
Add types to constructors and private/final/internal methods (Batch III)
[HttpClient] Async HTTPlug client
[Messenger] Allow to configure the db index on Redis transport
[HttpClient] bugfix exploding values of headers
[VarDumper] Made all casters final
[VarDumper] Added a support for casting Ramsey/Uuid
Remove useless testCanCheckIfTerminalIsInteractive test case
[Validator] Add the missing translations for the Thai (\"th\") locale
[Routing] gracefully handle docref_root ini setting
[Validator] Fix ValidValidator group cascading usage
* 4.3:
[travis] Fix build-packages script
[HttpClient] bugfix exploding values of headers
Remove useless testCanCheckIfTerminalIsInteractive test case
[Validator] Add the missing translations for the Thai (\"th\") locale
[Routing] gracefully handle docref_root ini setting
[Validator] Fix ValidValidator group cascading usage
* 3.4:
[travis] Fix build-packages script
Remove useless testCanCheckIfTerminalIsInteractive test case
[Validator] Add the missing translations for the Thai (\"th\") locale
[Validator] Fix ValidValidator group cascading usage
This PR was merged into the 5.0-dev branch.
Discussion
----------
[Console] Replace posix_isatty with cross-platform, always available stream_isatty
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
stream_isatty is always available since PHP 7.2, which is the minimal version required for Symfony 5.0, so we can remove usages of old, not cross-platform compatible `posix_isatty`
DeprecationErrorHandler left out, since AFAIK it's still meant to be compatible with PHP 5.5
Commits
-------
c9b8b046a7 Replace posix_isatty with cross-platform, always available stream_isatty
This PR was squashed before being merged into the 4.4 branch (closes#33770).
Discussion
----------
Add types to constructors and private/final/internal methods (Batch III)
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | #32179, #33228
| License | MIT
| Doc PR | N/A
Followup to #33709, this time with:
* Validator
* VarDumper
* Workflow
* Yaml
* all bridges
* all bundles
That should be the final batch. 😃
Commits
-------
6493902287 Add types to constructors and private/final/internal methods (Batch III)
This PR was squashed before being merged into the 4.4 branch (closes#33743).
Discussion
----------
[HttpClient] Async HTTPlug client
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#33710, Fix#32142
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/12389
This PR removes `HttplugClient`'s dependency on `Psr18Client`. It will also add an `HttplugPromise` to make sure we sure we respect the Httplug's `HttpAsyncClient` interface.
It implements `HttpAsyncClient::sendAsyncRequest()` and provides two extensions:
- `HttplugPromise::cancel()` allows cancelling a promise (and the underlying response)
- `HttplugClient::wait()` allows to tick the promise pool, with configurable timeouts.
Commits
-------
4fd593f869 [HttpClient] Async HTTPlug client
This PR was merged into the 5.0-dev branch.
Discussion
----------
[String] renamed core classes to Byte/CodePoint/UnicodeString
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
In #33553 there have been discussions about the naming of the classes - eg. "what's a grapheme", "why `Utf8String`", "lowercase on binary is weird", etc.
What about these names? Would they get your votes *vs* the current ones?
- `BinaryString` -> `ByteString`
- `Utf8String` -> `CodePointString`
- `GraphemeString` -> `UnicodeString`
Commits
-------
63c105d406 [String] renamed core classes to Byte/CodePoint/UnicodeString
This PR was merged into the 4.4 branch.
Discussion
----------
[Messenger] Allow to configure the db index on Redis transport
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#33724
| License | MIT
| Doc PR | todo
Quite useful for testing.
Commits
-------
115a9bbeda [Messenger] Allow to configure the db index on Redis transport
This PR was squashed before being merged into the 4.3 branch (closes#33871).
Discussion
----------
[HttpClient] bugfix exploding values of headers
| Q | A
| ------------- | ---
| Branch? | 4.3 for bug fixes
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
I tried to use CachingHttpClient yesterday and I received an error.
```
explode() expects parameter 2 to be string, array given
C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpClient\HttpClientTrait.php:200
C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpClient\HttpClientTrait.php:131
C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpClient\HttpClientTrait.php:45
C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpClient\CurlHttpClient.php:105
C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpKernel\HttpClientKernel.php:54
C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpKernel\HttpCache\SubRequestHandler.php:85
C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpKernel\HttpCache\HttpCache.php:477
C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpKernel\HttpCache\HttpCache.php:450
C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpKernel\HttpCache\HttpCache.php:347
C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpKernel\HttpCache\HttpCache.php:222
C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpClient\CachingHttpClient.php:96
C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpClient\Tests\CachingHttpClientTest.php:34
```
This PR fix this.
Commits
-------
5cd8895c67 [HttpClient] bugfix exploding values of headers
This PR was squashed before being merged into the 4.4 branch (closes#33881).
Discussion
----------
[VarDumper] Added a support for casting Ramsey/Uuid
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
I worked on a project using ramsey/uuid and I noticed a dumped uuid does
not contain the uuid. So here we go :)
(Note: don't get me wrong, I still do not recommend this lib)
---
Before / After:
![Before / After](https://user-images.githubusercontent.com/408368/66298080-49892d80-e8f1-11e9-969f-95ae5169adb1.png)
Commits
-------
99247bbd47 [VarDumper] Added a support for casting Ramsey/Uuid
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Fix ValidValidator group cascading usage
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
`$this->context->getGroup()` returns `string` or `null`.
`ContextualValidatorInterface::validate()` 3rd argument accepts an array but it must not contain `null` (its contract doesn't allow it). If it does, it will fail in `RecursiveContextualValidator::validateInGroup()` for example because of the `string` scalar type on the `$group` argument. (on 4.4)
Note that in our "common" usage of the `Valid` constraint, the group in its validator will never be `null` because this constraint has a special treatment. However, if this validator is reused in a custom way, it can fail.
Commits
-------
72684b001c [Validator] Fix ValidValidator group cascading usage
* 4.4: (27 commits)
[Validator] add notice in UPGRADE file for new Range constraint option
[CssSelector] Support *:only-of-type pseudo class selector
[Intl] Update the ICU data to 65.1 (4.4 branch)
[Intl] Update the ICU data to 65.1 (4.3 branch)
Replace deprecated calls in tests
[Intl] Update the ICU data to 65.1
Delete 5_Security_issue.md
[DI] Whitelist error_renderer.renderer tag in UnusedTagsPass
[DI] Whitelist validator.auto_mapper in UnusedTagsPass
Update CHANGELOG.md
[HttpClient] Fixed#33832 NO_PROXY option ignored in NativeHttpClient::request() method
[EventDispatcher] A compiler pass for aliased userland events.
[Cache] give 100ms before starting the expiration countdown
[Cache] fix logger usage in CacheTrait::doGet()
[VarDumper] fix dumping uninitialized SplFileInfo
Added missing translations.
[Form] Added CountryType option for using alpha3 country codes
Fixed invalid changelog 4.0.0 for VarDumper
[Workflow] Fixed BC break on WorkflowInterface
Fix wrong expression language value
...
This PR was merged into the 4.4 branch.
Discussion
----------
[Intl] Update the ICU data to 65.1 (4.4 branch)
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Followup for #33862
| License | MIT
| Doc PR | -
Commits
-------
5b2da724d7 [Intl] Update the ICU data to 65.1 (4.4 branch)
This PR was squashed before being merged into the 5.0-dev branch (closes#33868).
Discussion
----------
Skip the intl notice if run with phpunit
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Re #33825
| License | MIT
| Doc PR | -
Commits
-------
25461b358c Skip the intl notice if run with phpunit
This PR was squashed before being merged into the 3.4 branch (closes#33844).
Discussion
----------
[Validator] Add the missing translations for the Thai ("th") locale
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#30191
| License | MIT
| Doc PR |
I have added the missing translations for the Thai.
Also fixed a typo on trans-unit id=54.
Commits
-------
2315be85d8 [Validator] Add the missing translations for the Thai (\"th\") locale
* 4.3:
[Intl] Update the ICU data to 65.1 (4.3 branch)
Replace deprecated calls in tests
[Intl] Update the ICU data to 65.1
Delete 5_Security_issue.md
[DI] Whitelist validator.auto_mapper in UnusedTagsPass
[HttpClient] Fixed#33832 NO_PROXY option ignored in NativeHttpClient::request() method
[Cache] give 100ms before starting the expiration countdown
[Cache] fix logger usage in CacheTrait::doGet()
[VarDumper] fix dumping uninitialized SplFileInfo
Added missing translations.
Fixed invalid changelog 4.0.0 for VarDumper
Fixed invalid VarDumper upgrade doc.
[HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array
Don't let falsey usernames slip through
This PR was merged into the 4.3 branch.
Discussion
----------
[Cache] give 100ms before starting the expiration countdown
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#31573, Fix#33837
| License | MIT
| Doc PR | -
Because the expiration count-down starts immediately after calling `CachItem::expiresAfter(N)`, it's impossible to actually cache items for more than `N-1` seconds.
This PR adds a 0.1s grace period so that backends that have a second-level resolution can store the items for `N` seconds, provided the time between calling `CachItem::expiresAfter(N)` and saving the value to the backend is lower than 0.1s.
This PR also fixes the calculation of the computation time in `ContractsTrait`.
Commits
-------
ba63e181fd [Cache] give 100ms before starting the expiration countdown
* 3.4:
[Intl] Update the ICU data to 65.1
[VarDumper] fix dumping uninitialized SplFileInfo
Added missing translations.
Fixed invalid VarDumper upgrade doc.
[HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array
Don't let falsey usernames slip through
This PR was merged into the 3.4 branch.
Discussion
----------
[Intl] Update the ICU data to 65.1
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33548
| License | MIT
| Doc PR | -
Commits
-------
5cc9811fa9 [Intl] Update the ICU data to 65.1
This PR was merged into the 5.0-dev branch.
Discussion
----------
[FrameworkBundle] encourage installing intl when String is available
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
215595be5a [FrameworkBundle] encourage installing intl when String is available
This PR was merged into the 4.4 branch.
Discussion
----------
[Validator] Fix wrong expression language value
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
766162c4c7/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php (L28)
```php
(new ExpressionValidator($propertyAccessor))->validate($object, $constraint);
```
Based on the previous method signature (4.3 above), that code would result in an exception in 4.4:
```
Call to undefined method Symfony\Component\PropertyAccess\PropertyAccessor::evaluate()
```
Spotted by @fancyweb in https://github.com/symfony/symfony/pull/33829#discussion_r330995572
Fixed here and updated test case to avoid regression.
Commits
-------
4288f1c9f9 Fix wrong expression language value
This PR was squashed before being merged into the 4.4 branch (closes#33791).
Discussion
----------
[Form] Added CountryType option for using alpha3 country codes
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fixes#20313
| License | MIT
| Doc PR | -
In the linked issue #20313 was a proposal to add an alpha3 option to the country type.
Here it is..
Hopefully I've made no mistake, so when the code is fine, I will create a documentation PR.. :-)
Commits
-------
d07f5a33db [Form] Added CountryType option for using alpha3 country codes
I changed CHANGELOG.md to reflect actual changes in the code. The third argument is called $filter, not $context. This mistake was propageted to UPGRADE-4.0.md. I fixed that in https://github.com/symfony/symfony/pull/33821
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpKernel] Inherit Throwable in HttpExceptionInterface
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| **BC BREAKS?**| **YES**
| Tickets | n/a
| License | MIT
| Doc PR | n/a
When using a static analysis tools, it is not possible to do this:
```php
if ($exception instanceof HttpExceptionInterface) {
$exception->getStatusCode();
$exception->getHeaders();
$exception->getMessage(); // ❌ Will fail here
}
```
This is due to `getMessage()` not being a method declared in `HttpExceptionInterface`. Since Symfony now requires PHP 7.1+ to run, it is safe to inherit from the `Throwable` interface (added in PHP 7.0).
### About backward compatibility
Adding new methods to `HttpExceptionInterface` [breaks BC](https://symfony.com/doc/current/contributing/code/bc.html#changing-interfaces), however this interface shouldn't be used on a class other than an exception, so this shouldn't affect much code.
### About tests
I'm not sure this really needs tests, but maybe I'm wrong? Tell me what to test if you think this is required.
Commits
-------
2ac3fbf232 Inherit Throwable in HttpExceptionInterface
This PR was merged into the 3.4 branch.
Discussion
----------
[Security]: Don't let falsy usernames slip through impersonation
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
When you try to impersonate users with a falsy username, `SwitchUserListener::handle()` would `return;` and impersonation would fail.
I'm using a third party OAuth provider that allows users to change their usernames with no guaranteed protection against re-use. To overcome that issue, I implemented `UserLoaderInterface::loadUserByUsername()` and query by a `providerId`.
After loading development fixtures, One user has `0` as it's `providerId`.
Commits
-------
64aecab0a7 Don't let falsey usernames slip through
This PR was merged into the 4.4 branch.
Discussion
----------
[DependencyInjection] added Ability to define a priority method for tagged service
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#32976
| License | MIT
| Doc PR |
Commits
-------
c1917c2999 [DependencyInjection] added Ability to define a priority method for tagged service
This PR was merged into the 5.0-dev branch.
Discussion
----------
[Workflow] Fixed default marking store value of Workflow
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33749
| License | MIT
| Doc PR |
Commits
-------
a2330b7a90 [Workflow] Fixed default marking store value of Workflow
* 4.4: (24 commits)
[Console] Command::execute() should always return int - deprecate returning null
[FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand
[AnnotationCacheWarmer] add RedirectController to annotation cache
[WebProfilerBundle] Try to display the most useful panel by default
Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in the upgrade guide
fix merge
[DI] add tests loading calls with returns-clone
[DI] dont mandate a class on inline services with a factory
Fixed Redis Sentinel usage when only one Sentinel specified
[EventDispatcher] Added tests for aliased events.
Sync Twig templateExists behaviors
Fix the :only-of-type pseudo class selector
Deprecate the XmlEncoder::TYPE_CASE_ATTRIBUTES constant
[Mailer] Tweak some code
[Serializer] Add CsvEncoder tests for PHP 7.4
Copy phpunit.xsd to a predictable path
[WebserverBundle] Remove duplicated deprecation message
remove duplicated test
[Security/Http] fix parsing X509 emailAddress
[FrameworkBundle] conflict with VarDumper < 4.4
...
- added deprecation message for non-int return value in Command::execute()
- fixed all core commands to return proper int values
- added proper return type-hint to Command::execute() method in all core Commands
This PR was merged into the 4.3 branch.
Discussion
----------
[DI] Add CSV env var processor tests / support PHP 7.4
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Similar as #32051
Commits
-------
82f341864c [DI] Add CSV env var processor tests
This PR was merged into the 4.3 branch.
Discussion
----------
[EventDispatcher] Added tests for aliased events
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
While working on #33793 I discovered that I could remove the event alias feature of `RegisterListenersPass` without breaking the component's tests. This PR adds the missing tests.
Commits
-------
8e8a6ed99b [EventDispatcher] Added tests for aliased events.
This PR was merged into the 5.0-dev branch.
Discussion
----------
[Serializer] Remove XmlEncoder::TYPE_CASE_ATTRIBUTES constant
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | not really
| Deprecations? | yes (well, sort of)
| Tickets | N/A
| License | MIT
| Doc PR | N/A
There is a small typo in the `XmlEncoder` constant. This can only be fixed in the master branch for Symfony 5 as it is a breaking change. I'm not sure if it's possible to deprecate the usage of the old constant name in 4.4? As the constant just resolves to a string, there is no way of determining if someone used the constant or not (a quick search on Github, I can't find any direct usages of the constant outside of this class)
Commits
-------
001d0f1693 Remove XmlEncoder::TYPE_CASE_ATTRIBUTES constant
This PR was merged into the 4.4 branch.
Discussion
----------
[WebProfilerBundle] Try to display the most useful panel by default
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | yes
| Tickets | -
| License | MIT
| Doc PR | -
Alternative to https://github.com/symfony/symfony/pull/32491, the goal stays the same.
I think reserving a data collector name is fine, isn'it ? It's not likely that end users use this name (that's why I added an underscore) + shouldn't be hard for them to just rename it.
I don't think adding a configuration option to toggle the "_best" behavior is useful, should be by default for DX IMHO.
Not adding an extension point for now (for end users to set their panel as the "best"), maybe later if someone request it?
Commits
-------
a45dd98b73 [WebProfilerBundle] Try to display the most useful panel by default
This prevents to exclude the RedirectController from the warmed annotation cache which would lead to warnings when trying to use the warmed cache on read only file systems
See #29357
This PR was merged into the 4.4 branch.
Discussion
----------
[DI] dont mandate a class on inline services with a factory
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This check is too strict, useless and boring for inline services :)
Commits
-------
a2665d17cd [DI] dont mandate a class on inline services with a factory
* 4.3:
Sync Twig templateExists behaviors
Fix the :only-of-type pseudo class selector
[Serializer] Add CsvEncoder tests for PHP 7.4
Copy phpunit.xsd to a predictable path
[Security/Http] fix parsing X509 emailAddress
[Serializer] fix denormalization of string-arrays with only one element #33731
[Cache] fix known tag versions ttl check
* 3.4:
Sync Twig templateExists behaviors
Fix the :only-of-type pseudo class selector
[Serializer] Add CsvEncoder tests for PHP 7.4
Copy phpunit.xsd to a predictable path
[Security/Http] fix parsing X509 emailAddress
[Serializer] fix denormalization of string-arrays with only one element #33731
[Cache] fix known tag versions ttl check
This PR was merged into the 4.4 branch.
Discussion
----------
[Cache] Fixed Redis Sentinel usage when only one Sentinel specified
Added check for $params['redis_sentinel'] to line 274, as by converting the array of hosts to a single host configuration (as you might in a test environment), this causes the class to initialise incorrectly.
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33796
| License | MIT
| Doc PR |
As from Issue #33796
In a Redis Sentinel setup, if only a single Redis Sentinel, or multiple Sentinels with the same host/port are specified (as we're currently doing in a test environment), then the call to `setSentinelTimeout` in `RedisTrait.php` throws an exception, as the wrong interface appears to be initialised as a result.
Adding a check for the `redis_sentinel` parameter, as was done with a check for the `redis_cluster` parameter, avoids this, and the Redis Client is initialised correctly.
Commits
-------
13233fcd8e Fixed Redis Sentinel usage when only one Sentinel specified
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpKernel] wrap compilation of the container in an opportunistic lock
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
https://github.com/symfony/symfony/pull/32764#issuecomment-516924305
This PR adds a lock around the compilation of the container. When two or more concurrent requests want to compile the container, the first one runs the computation and the others wait for its completion. If for any reasons the lock doesn't work, compilation happens as usual.
The effect is visible when developing locally:
Here is what all concurrent requests consume now:
![image](https://user-images.githubusercontent.com/243674/65603626-4e231d00-dfa6-11e9-8b6c-62dbd5eb30fe.png)
And here is what they will consume with this PR (they wait but reuse the just compiled container):
![image](https://user-images.githubusercontent.com/243674/65603733-7f9be880-dfa6-11e9-930b-ce793c3e280c.png)
Commits
-------
0b5b3ed7f9 [HttpKernel] wrap compilation of the container in an opportunistic lock
Added check for $params['redis_sentinel'] to line 274, as by converting the array of hosts to a single host configuration (as you might in a test environment), this causes the class to initialise incorrectly.
This PR was squashed before being merged into the 3.4 branch (closes#33777).
Discussion
----------
Fix the :only-of-type pseudo class selector
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33773
| License | MIT
| Doc PR | -
Commits
-------
c2a9bf08f1 Fix the :only-of-type pseudo class selector
This PR was squashed before being merged into the 3.4 branch (closes#32051).
Discussion
----------
[Serializer] Add CsvEncoder tests for PHP 7.4
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? |no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Some CSV encoder tests to show the broken behavior of a trailing slash. Spotted in #31867, not sure what to do with it :)
Commits
-------
760354d533 [Serializer] Add CsvEncoder tests for PHP 7.4
This PR was merged into the 3.4 branch.
Discussion
----------
Copy phpunit.xsd to a predictable path
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | yes-ish
| Deprecations? | no
| Tickets | https://github.com/symfony/recipes/pull/652#discussion_r329446277
| License | MIT
| Doc PR | -
In symfony/recipes#652 I would like to make Flex create the `phpunit.xml.dist` file with a local URI for the `phpunit.xsd`. This is doable when using `phpunit/phpunit` standalone because the path to the XSD file is known. This PR aims to allow doing this when using the PHPUnit Bridge, which installs PHPUnit in a path that might change.
Is is simple `@copy()` call ok? Should I add some error handling?
Commits
-------
233dcb4b75 Copy phpunit.xsd to a predictable path
This PR was merged into the 3.4 branch.
Discussion
----------
[Serializer] fix denormalization of string-arrays with only one element
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? |no
| Deprecations? |no
| Tickets | Fix#33731
| License | MIT
| Doc PR |
This PR does almost the same as ac70edf8cd, just not only for arrays of objects.
Commits
-------
8814751b96 [Serializer] fix denormalization of string-arrays with only one element #33731
This PR was merged into the 5.0-dev branch.
Discussion
----------
[String] improve AbstractUnicodeString::ascii() fallback logic
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
`any-latin/bgn` is a better default when available, and accepting `\Transliterator` instances allows the consumer code to decide how they are instantiated.
Commits
-------
59069626fd [String] improve AbstractUnicodeString::ascii() fallback logic
This PR was merged into the 4.4 branch.
Discussion
----------
[VarDumper] Output the location of calls to dump()
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | not tested yet
| Fixed tickets | #30830
| License | MIT
| Doc PR |
see #30830
Commits
-------
f0a59d3eab [VarDumper] Output the location of calls to dump()
* 4.4:
sync phpunit script with master
[HttpFoundation] allow additinal characters in not raw cookies
[Console] Deprecate abbreviating hidden command names using Application->find()
Do not include hidden commands in suggested alternatives
[Messenger] Improve error message when routing to an invalid transport (closes#31613)
[DependencyInjection] Fix wrong exception when service is synthetic
[Security] add "anonymous: lazy" mode to firewalls
This PR was merged into the 4.4 branch.
Discussion
----------
[DX][Messenger] Improve error message when routing to an invalid transport
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31613
| License | MIT
| Doc PR | -
Commits
-------
7909092891 [Messenger] Improve error message when routing to an invalid transport (closes#31613)
This PR was merged into the 4.4 branch.
Discussion
----------
[Security] add "anonymous: lazy" mode to firewalls
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fixes#26769 et al.
| License | MIT
| Doc PR | -
Contains #33663 until it is merged.
This PR allows defining a firewall as such:
```yaml
security:
firewalls:
main:
anonymous: lazy
```
This means that the corresponding area should not start the session / load the user unless the application actively gets access to it. On pages that don't fetch the user at all, this means the session is not started, which means the corresponding token neither is. Lazily, when the user is accessed, e.g. via a call to `is_granted()`, the user is loaded, starting the session if needed.
See #27817 for previous explanations on the topic also.
Note that thanks to the logic in #33633, this PR doesn't have the drawback spotted in #27817: here, the profiler works as expected.
Recipe update pending at https://github.com/symfony/recipes/pull/649
Commits
-------
5cd1d7b4cc [Security] add "anonymous: lazy" mode to firewalls
This PR was squashed before being merged into the 3.4 branch (closes#33625).
Discussion
----------
[DependencyInjection] Fix wrong exception when service is synthetic
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #32874
| License | MIT
This fixes wrongfully thrown exception when service is defined as synthetic and some arguments are binded in _defaults
Commits
-------
152dec95bc [DependencyInjection] Fix wrong exception when service is synthetic
* 4.4:
[Form][Validator][Intl] Fix tests
[Messenger] return empty envelopes when RetryableException occurs
[Intl] Excludes locale from language codes (split localized language names)
[FrameworkBundle] WebTestCase KernelBrowser::getContainer null return type
[Intl] Fix compile type errors
[Validator] Accept underscores in the URL validator as the URL will resolve correctly
[Translation] Collect original locale in case of fallback translation
Add types to constructors and private/final/internal methods (Batch I)
[HttpFoundation] optimize normalization of headers
Replace REMOTE_ADDR in trusted proxies with the current REMOTE_ADDR
[ErrorHandler] Forward \Throwable
Fix toolbar load when GET params are present in "_wdt" route
* 4.3:
[Form][Validator][Intl] Fix tests
[Messenger] return empty envelopes when RetryableException occurs
[Validator] Accept underscores in the URL validator as the URL will resolve correctly
[Translation] Collect original locale in case of fallback translation
Fix toolbar load when GET params are present in "_wdt" route
* 3.4:
[Form][Validator][Intl] Fix tests
[Validator] Accept underscores in the URL validator as the URL will resolve correctly
[Translation] Collect original locale in case of fallback translation
Fix toolbar load when GET params are present in "_wdt" route
This PR was squashed before being merged into the 4.3 branch (closes#32979).
Discussion
----------
[Messenger] return empty envelopes when RetryableException occurs
| Q | A
| ------------- | ---
| Branch? | 3.4 or 4.3 for bug fixes <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| License | MIT
| ~~Doc PR~~ | ~~symfony/symfony-docs#12109~~
<!--
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.
-->
Problem occurs when you are using more than 1 worker with Doctrine Transport.
`Symfony\Component\Messenger\Transport\Doctrine\Connection::get` does a query `SELECT ... FOR UPDATE` and this locking query could lock table and workers stops. But using locks can result in dead locks or lock timeouts. Doctrine renders these SQL errors as RetryableExceptions. These exceptions are often normal if you are in a high concurrency environment. They can happen very often and your application should handle them properly.
Commits
-------
9add32a9ca [Messenger] return empty envelopes when RetryableException occurs
This PR was merged into the 4.4 branch.
Discussion
----------
[Intl] Excludes locale from language codes (split localized language names)
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #33146
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
(includes #33140)
Commits
-------
1a9f517903 [Intl] Excludes locale from language codes (split localized language names)
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] WebTestCase KernelBrowser::getContainer null return type
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #25920 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | <!-- required for new features -->
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- Bug fixes must be submitted against the lowest 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 the master branch.
-->
As @stof suggested in the #25920 I started deprecating the behaviour of returning null when the container is non booted / null.
If this is not wanted we should close both the PR and the issue ;).
Commits
-------
e169e1a4d5 [FrameworkBundle] WebTestCase KernelBrowser::getContainer null return type
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Accept underscores in the URL validator, as the URL will load
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #32506
| License | MIT
| Doc PR | -
As @javiereguiluz mentioned, regardless of convention a URL with an underscore in it will load perfectly fine - so in that respect it must be valid.
Commits
-------
c9c7a1118c [Validator] Accept underscores in the URL validator as the URL will resolve correctly
This PR was merged into the 4.4 branch.
Discussion
----------
[ErrorHandler] Forward \Throwable
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/32605
| License | MIT
| Doc PR | -
The goal of this PR is that `ErrorHandler::handleException()` handles `\Throwable` directly and forwards it without altering it.
Commits
-------
62483ed305 [ErrorHandler] Forward \Throwable
This PR was merged into the 3.4 branch.
Discussion
----------
Fix toolbar load when GET params are present in "_wdt" route
When using a custom router that inject GET parameters, eg:
```
# services.yaml
parameters:
# Replace default url generator service
router.options.generator_base_class: Combodo\iTop\Portal\Routing\UrlGenerator
```
The path generated by the toolbar JS is HTML entity encoded which breaks the JS call (`&` becomes `&`).
| Q | A
| ------------- | ---
| Branch? | 4.4 for features / 3.4, 4.2 or 4.3 for bug fixes <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | #... <!-- #-prefixed issue number(s), 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/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
-------
5309e64949 Fix toolbar load when GET params are present in "_wdt" route
This PR was squashed before being merged into the 3.4 branch (closes#32925).
Discussion
----------
[Translation] Collect original locale in case of fallback translation
Before, it collected the fallback locale that was used to translate a key. But this information is confusing, as it does not reveal which translation key is missing in the requested language.
So I'd like to propose to track the "requested" locale instead, so that the Symfony profiler gives me the information in which locale the key is missing instead of which locale was used as a fallback.
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | yes?
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
In principle, this change is a BC break, but imho also a bug. It's really confusing when the Profiler tells you that it uses a translation fallback for an ID and locale that is actually translated. Took some debugging so recognize that this fallback came from another locale. If you think it's better to target 5.0, I'll update the PR.
Commits
-------
5564e149cb [Translation] Collect original locale in case of fallback translation
This PR was merged into the 4.4 branch.
Discussion
----------
[Http][DI] Replace REMOTE_ADDR in trusted proxies with the current REMOTE_ADDR
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| License | MIT
| Doc PR |
Currently handling trusted ips when deploying behind some CDNs/Load balancers such as ELB is difficult because they dont have a constant IP address, its possible to overcome this as is suggested by the docs - https://symfony.com/doc/current/deployment/proxies.html#but-what-if-the-ip-of-my-reverse-proxy-changes-constantly - by settings trusted proxies to `$request->server->get('REMOTE_ADDR')` - but this has to be done in code, and so becomes dangerous if you code is deployed in different environments.
This change would allow the developer to stick to providing the envvar `TRUSTED_PROXIES`, and in the environment behind a ELB set the value to the literal string `REMOTE_ADDR`, and have it replaced at run time. This way in environments that are not using ELB his app is kept safe.
I think doing this replacement in `Request:: setTrustedProxies` is the best place because it means this feature isn't exposed to other parts of the code that might call `Request::getTrustedProxies`.
Commits
-------
643c9ff257 Replace REMOTE_ADDR in trusted proxies with the current REMOTE_ADDR
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpFoundation] optimize normalization of headers
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
I was experimenting with using maps to bypass calls to normalization functions, but that didn't lead to any significant perf improvement.
I still found this, the new call is twice as fast :)
Commits
-------
9c676d37a0 [HttpFoundation] optimize normalization of headers
* 4.4: (28 commits)
[FrameworkBundle] Fix framework bundle lock configuration not working as expected
[Validator] Add the missing translations for the Azerbaijani locale
[HttpClient] workaround bad Content-Length sent by old libcurl
[Cache] dont override native Memcached options
Fix CS
Fix exceptions (PDOException) error code type
[ErrorHandler] fix return-type patching logic
[Messenger] Added support for `from_transport` attribute on `messenger.message_handler` tag
[ErrorHandler] don't throw deprecations for return-types by default
ensure legacy event dispatcher compatibility
ensure legacy event dispatcher compatibility
Fix return type of Process::restart().
[Cache] fail gracefully when locking is not supported
[HttpKernel] compress files generated by the profiler
tweak deprecation messages and changelog
fix version in @deprecated annotation
Use VarCloner data instead of legacy array for query params
[Security] use LegacyEventDispatcherProxy
[HttpClient] fix undefined index access
[HttpClient] fix race condition when reading response with informational status
...
* 4.3:
[FrameworkBundle] Fix framework bundle lock configuration not working as expected
[Validator] Add the missing translations for the Azerbaijani locale
[HttpClient] workaround bad Content-Length sent by old libcurl
[Cache] dont override native Memcached options
Fix CS
Fix exceptions (PDOException) error code type
Fix return type of Process::restart().
[Cache] fail gracefully when locking is not supported
[HttpClient] fix race condition when reading response with informational status
Names for buttons should start with lowercase
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] fix race condition when reading response with informational status
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Spotted by some transiently failing jobs on Travis.
Commits
-------
450c3c4998 [HttpClient] fix race condition when reading response with informational status
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] workaround bad Content-Length sent by old libcurl
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Issue described in https://curl.haxx.se/mail/lib-2014-01/0106.html, happens with curl 7.29 at least.
Commits
-------
b8d2496979 [HttpClient] workaround bad Content-Length sent by old libcurl
* 3.4:
[FrameworkBundle] Fix framework bundle lock configuration not working as expected
[Validator] Add the missing translations for the Azerbaijani locale
[Cache] dont override native Memcached options
Fix return type of Process::restart().
This PR was squashed before being merged into the 3.4 branch (closes#31198).
Discussion
----------
[FrameworkBundle] Fix framework bundle lock configuration not working as expected
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31197
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/11465 & https://github.com/symfony/symfony-docs/pull/11466
This fixes#31197 and makes the lock configuration work with installations that are not full stack ones and configurations that use xml files.
Commits
-------
c7af2df340 [FrameworkBundle] Fix framework bundle lock configuration not working as expected
This PR was merged into the 4.4 branch.
Discussion
----------
[DoctrineBridge] Use VarCloner data instead of legacy array for query params
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR |
When I implemented Symfony 4.0 support in DoctrineBundle, I have run into issue that DoctrineBridge does not return VarCloner instance here, so I had to introduce [conversion inside DoctrineBundle](af8ac792c9/DataCollector/DoctrineDataCollector.php (L135-L141)).
We need this because `WebProfilerBundle\Twig\WebProfilerExtension::dumpData()` requires this instance since Symfony 4.0. Not returning this instance here was oversight during work on Symfony 4.0. I did not contribute this sooner, because we can't remove code in DoctrineBundle until we drop Symfony 3.4 support anyways. But not doing this in Symfony 4.4 would mean having to keep transformation code not just during 3.4 LTS lifetime, but 4.4 LTS lifetime too.
Commits
-------
81c6df511d Use VarCloner data instead of legacy array for query params
This PR was merged into the 5.0-dev branch.
Discussion
----------
[String] a new component for object-oriented strings management with an abstract unit system
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This is a reboot of #22184 (thanks @hhamon for working on it) and a generalization of my previous work on the topic ([patchwork/utf8](https://github.com/tchwork/utf8)). Unlike existing libraries (including `patchwork/utf8`), this component provides a unified API for the 3 unit systems of strings: bytes, code points and grapheme clusters.
The unified API is defined by the `AbstractString` class. It has 2 direct child classes: `BinaryString` and `AbstractUnicodeString`, itself extended by `Utf8String` and `GraphemeString`.
All objects are immutable and provide clear edge-case semantics, using exceptions and/or (nullable) types!
Two helper functions are provided to create such strings:
```php
new GraphemeString('foo') == u('foo'); // when dealing with Unicode, prefer grapheme units
new BinaryString('foo') == b('foo');
```
`GraphemeString` is the most linguistic-friendly variant of them, which means it's the one ppl should use most of the time *when dealing with written text*.
Future ideas:
- improve tests
- add more docblocks (only where they'd add value!)
- consider adding more methods in the string API (`is*()?`, `*Encode()`?, etc.)
- first class Emoji support
- merge the Inflector component into this one
- use `width()` to improve `truncate()` and `wordwrap()`
- move method `slug()` to a dedicated locale-aware service class
- propose your ideas (send PRs after merge)
Out of (current) scope:
- what [intl](https://php.net/intl) provides (collations, transliterations, confusables, segmentation, etc)
Here is the unified API I'm proposing in this PR, borrowed from looking at many existing libraries, but also Java, Python, JavaScript and Go.
```php
function __construct(string $string = '');
static function unwrap(array $values): array
static function wrap(array $values): array
function after($needle, bool $includeNeedle = false, int $offset = 0): self;
function afterLast($needle, bool $includeNeedle = false, int $offset = 0): self;
function append(string ...$suffix): self;
function before($needle, bool $includeNeedle = false, int $offset = 0): self;
function beforeLast($needle, bool $includeNeedle = false, int $offset = 0): self;
function camel(): self;
function chunk(int $length = 1): array;
function collapseWhitespace(): self
function endsWith($suffix): bool;
function ensureEnd(string $suffix): self;
function ensureStart(string $prefix): self;
function equalsTo($string): bool;
function folded(): self;
function ignoreCase(): self;
function indexOf($needle, int $offset = 0): ?int;
function indexOfLast($needle, int $offset = 0): ?int;
function isEmpty(): bool;
function join(array $strings): self;
function jsonSerialize(): string;
function length(): int;
function lower(): self;
function match(string $pattern, int $flags = 0, int $offset = 0): array;
function padBoth(int $length, string $padStr = ' '): self;
function padEnd(int $length, string $padStr = ' '): self;
function padStart(int $length, string $padStr = ' '): self;
function prepend(string ...$prefix): self;
function repeat(int $multiplier): self;
function replace(string $from, string $to): self;
function replaceMatches(string $fromPattern, $to): self;
function slice(int $start = 0, int $length = null): self;
function snake(): self;
function splice(string $replacement, int $start = 0, int $length = null): self;
function split(string $delimiter, int $limit = null, int $flags = null): array;
function startsWith($prefix): bool;
function title(bool $allWords = false): self;
function toBinary(string $toEncoding = null): BinaryString;
function toGrapheme(): GraphemeString;
function toUtf8(): Utf8String;
function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): self;
function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): self;
function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): self;
function truncate(int $length, string $ellipsis = ''): self;
function upper(): self;
function width(bool $ignoreAnsiDecoration = true): int;
function wordwrap(int $width = 75, string $break = "\n", bool $cut = false): self;
function __clone();
function __toString(): string;
```
`AbstractUnicodeString` adds these:
```php
static function fromCodePoints(int ...$codes): self;
function ascii(array $rules = []): self;
function codePoint(int $index = 0): ?int;
function folded(bool $compat = true): parent;
function normalize(int $form = self::NFC): self;
function slug(string $separator = '-'): self;
```
and `BinaryString`:
```php
static function fromRandom(int $length = 16): self;
function byteCode(int $index = 0): ?int;
function isUtf8(): bool;
function toUtf8(string $fromEncoding = null): Utf8String;
function toGrapheme(string $fromEncoding = null): GraphemeString;
```
Case insensitive operations are done with the `ignoreCase()` method.
e.g. `b('abc')->ignoreCase()->indexOf('B')` will return `1`.
For reference, CLDR transliterations (used in the `ascii()` method) are defined here:
https://github.com/unicode-org/cldr/tree/master/common/transforms
Commits
-------
dd8745aced [String] add more tests
82a00956bc [String] add tests
012e92a772 [String] a new component for object-oriented strings management with an abstract unit system
This PR was merged into the 4.3 branch.
Discussion
----------
[Cache] fail gracefully when locking is not supported
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33392
| License | MIT
| Doc PR | -
Commits
-------
93485190f9 [Cache] fail gracefully when locking is not supported
This PR was merged into the 4.3 branch.
Discussion
----------
[Form] Names for buttons should start with lowercase
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
This fix changes the messages related to the changes in https://github.com/symfony/symfony/pull/28969 - the message used to state that names should start with a letter, a digit ... - so I got a confusing message:
```
Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated since Symfony 4.3 and will throw an exception in 5.0 ("Search" given).'
```
Which made me find the message, look at the regex that was used, and work out that actually it should start with a lowercase letter, and hence this PR - where I assume there is a reason that the name must start with lowercase letters.
Commits
-------
f65524e4e0 Names for buttons should start with lowercase
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Sort tagged services
| Q | A
| ------------- | ---
| Branch? | 4.4 <!-- see below -->
| 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | https://github.com/symfony/symfony/issues/32439 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | -
Hi
This PR it's to improve DX when `debug:container` command is use with tag argument by sorting them by priority (More details in linked issue).
Currently they are sort by alphabetical order.
Commits
-------
54cef2a3a3 [FrameworkBundle] Sort tagged service by priority
This PR was merged into the 4.4 branch.
Discussion
----------
[DI] scope singly-implemented interfaces detection by file
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| License | MIT
[DependencyInjection] fixed handling singly implemented interfaces when importing multiple resources
for example:
```yaml
App\Adapter\:
resource: '../src/Adapter/*'
App\Port\:
resource: '../src/Port/*'
```
this configuration wont create service for interface (in other words singly implemented interface wont be autowired) and this chage fixes it
**Also** this will prevent false positives - for example if I had one implementation in \App\Port namespace and another in \App\Adapter then interface service would still be registered
but that could potentially break exisitng code not aware of this bug
Commits
-------
c1f39709ff [DI] add FileLoader::registerAliasesForSinglyImplementedInterfaces()
bec38900d8 [DI] scope singly-implemented interfaces detection by file
This PR was merged into the 4.4 branch.
Discussion
----------
[ErrorHandler] Show fallback error page when default error controller is disabled
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This would avoid a blank page on errors when we've disabled the default error controller. e.g:
```yaml
framework:
error_controller: null
```
So, we will show you the default HTML error page.
Commits
-------
8eea11cc26 Show fallback error page when framework.error_controller is null
This PR was merged into the 4.4 branch.
Discussion
----------
[ErrorHandler] don't throw deprecations for return-types by default
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33235
| License | MIT
| Doc PR | -
As discussed a few times already, in 4.4, `DebugClassLoader` shouldn't trigger deprecations when return types are missing. We'll enable them back in 5.1.
Commits
-------
2cb419edf4 [ErrorHandler] don't throw deprecations for return-types by default
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpKernel] compress files generated by the profiler
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | #33006
| License | MIT
| Doc PR | -
I've recently seen several reports of fastly growing profiler storages. Let's compress them when possible.
Locally for the skeleton homepage, a single profile goes from 150k to 15k. Level 3 is producing significant compression ratio while being measurably faster than level 6 (the default), that's why I'm using it.
Commits
-------
08f9470556 [HttpKernel] compress files generated by the profiler
This PR was squashed before being merged into the 4.4 branch (closes#33317).
Discussion
----------
[Messenger] Added support for `from_transport` attribute on `messenger.message_handler` tag
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #33306
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/12231
Right now, it's only possible to have dynamic `from_transport` when using `MessageSubscriberInterface`. Things like `priority` and `bus` can already be added as attributes on the messenger.message_handler` tag.
With this PR it now also supports `from_transport`.
Commits
-------
c965e4e844 [Messenger] Added support for `from_transport` attribute on `messenger.message_handler` tag
This PR was merged into the 4.3 branch.
Discussion
----------
Add missing row_attr option to FormType
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix: #33682 - related issue #33573
| License | MIT
The #33573 modified Symfony's form themes. But the [FormType](https://github.com/symfony/form/blob/master/Extension/Core/Type/FormType.php) don't allow the option `row_attr` so the OptionResolver throw an exception that the option is unknown.
This PR basically add the option and give it to the form view (like `label_attr` do)
Commits
-------
d711ea2b54 Add missing row_attr option to FormType
This PR was merged into the 4.3 branch.
Discussion
----------
[Security] use LegacyEventDispatcherProxy
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
I ran into an issue on one of my apps that has its own event dispatcher class using the old dispatch method signature
```php
public function dispatch($eventName, Event $event = null)
```
This leads to
```
TypeError: Argument 2 passed to X\Tests\Base\TestEventDispatcher::dispatch() must be an instance of Symfony\Component\EventDispatcher\Event or null, string given, called in /var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php on line 230
/var/www/x/symfony/tests/Base/TestEventDispatcher.php:20
/var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php:230
/var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php:111
```
since the event here is dispatched using the new signature:
https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Security/Http/Firewall/ContextListener.php#L259
Commits
-------
7067e48165 [Security] use LegacyEventDispatcherProxy
* 4.4:
[Security/Http] fix typo in deprecation message
[Security] Deprecate isGranted()/decide() on more than one attribute
Fixed a minor typo in the UPGRADE to 5.0 guide
Various tweaks 3.4
Various tweaks 4.3
[Security] Make stateful firewalls turn responses private only when needed
[PhpUnit] Fix usleep mock return value
Revert \"feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)\"
[TwigBundle] typo
[TwigBundle] fix test case
[Lock] use Predis\ClientInterface instead of Predis\Client
Allow Twig 3
Minor tweaks
Fix version typo in deprecation notice
[Form][SubmitType] Add "validate" option
hint to the --parse-tags when parsing tags fails
Make legacy "wrong" RFC2047 encoding apply only to one header
* 4.3:
[Security/Http] fix typo in deprecation message
Various tweaks 3.4
Various tweaks 4.3
[PhpUnit] Fix usleep mock return value
[Lock] use Predis\ClientInterface instead of Predis\Client
Fix version typo in deprecation notice
Make legacy "wrong" RFC2047 encoding apply only to one header
This PR was merged into the 4.3 branch.
Discussion
----------
[Security/Http] fix typo in deprecation message
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
spotted by @stof in #33676
Commits
-------
e70057aed4 [Security/Http] fix typo in deprecation message
This PR was squashed before being merged into the 4.4 branch (closes#33584).
Discussion
----------
[Security] Deprecate isGranted()/decide() on more than one attribute
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Tickets | -
| License | MIT
| Doc PR | tbd
While I expect it not be used much, it is currently possible to call `isGranted()` on more than one attribute:
```php
if ($this->authorizationChecker->isGranted(['ROLE_USER', 'ROLE_ADMIN'])) {
// ...
}
```
Supporting this includes a couple of problems/questions:
- It is not clear whether this is `OR` or `AND`;
- In fact, this is left over to the voter to decide upon. So it can vary for each voter and writers of new voters need to consider this (otherwise, you get issues like https://github.com/LeaseWeb/LswSecureControllerBundle/issues/4 );
- It promotes to vote over roles instead of actions.
I think we can do better. In the past, we've created all tooling for this to be self-explaining and easier:
```php
// ExpressionLanguage component (also includes other functions, like `is_granted('EDIT')`)
if ($this->authorizationChecker->isGranted("has_role('ROLE_USER') or has_role('ROLE_ADMIN')")) {
// ...
}
// calling it multiple times in PHP (may reduce performance)
if ($this->authorizationChecker->isGranted('ROLE_USER')
|| $this->authorizationChecker->isGranted('ROLE_ADMIN')
) {
// ...
}
// or by using Role Hierarchy, if a user really wants to vote on roles
```
This PR deprecates passing more than one attribute to `isGranted()` and `decide()` to remove this confusing bit in Security usage.
Backwards compatiblity help
---
I need some help in how to approach changing the `VoterInterface::vote(TokenInterface $token, $subject, array $attributes)` method in a backwards compatible way. Removing `array` breaks all Voters, so does changing it to `string` and removed the parameter all together.
Commits
-------
c64b0beffb [Security] Deprecate isGranted()/decide() on more than one attribute
This PR was merged into the 4.4 branch.
Discussion
----------
[Security] Make stateful firewalls turn responses private only when needed
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26769 *et al.*
| License | MIT
| Doc PR | -
Replaces #28089
By taking over session usage tracking and replacing it with token usage tracking, we can prevent responses that don't actually use the token from turning responses private without changing anything to the lifecycle of security listeners. This makes the behavior much more seamless, allowing to still log the user with the monolog processor, and display it in the profiler toolbar.
This works by using two separate token storage services:
- `security.token_storage` now tracks access to the token and increments the session usage tracker when needed. This is the service that is injected in userland.
- `security.untracked_token_storage` is a raw token storage that just stores the token and is disconnected from the session. This service is injected in places where reading the session doesn't impact the generated output in any way (as e.g. in Monolog processors, etc.)
Commits
-------
20df3a125c [Security] Make stateful firewalls turn responses private only when needed
This PR was merged into the 4.4 branch.
Discussion
----------
[Form][SubmitType] Add "validate" option
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/issues/8763
| License | MIT
| Doc PR | TODO
The second part of the ticket requires more work but is kind of unrelated.
Commits
-------
a2bc06d811 [Form][SubmitType] Add "validate" option
This PR was merged into the 4.3 branch.
Discussion
----------
Make legacy "wrong" RFC2047 encoding apply only to one header
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| License | MIT
It says in a comment in the code that "We have to go against RFC 2183/2231 in some areas for interoperability". But I would like that to be the exception and not the rule. As the code was, all parameterized headers except from "Content-Disposition" was not encoded according to RFC 2231.
This change is to make it so that the exception (to not follow the RFC) is for the header "Content-Type" only, and all other parameterized headers will follow the rule of RFC 2231.
The code kind of worked before, because in emails we generally only have two parameterized headers; "Content-Disposition" and "Content-Type". But I think it is a good thing that if another parameterized header would happen to be added, by default it should follow the rule of the RFC and not by default be an exception.
Commits
-------
3817a8b036 Make legacy "wrong" RFC2047 encoding apply only to one header
This PR was merged into the 4.4 branch.
Discussion
----------
[Yaml] hint to the --parse-tags when parsing tags fails
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix https://github.com/symfony/symfony/issues/28465#issuecomment-533182079
| License | MIT
| Doc PR |
Commits
-------
012111524b hint to the --parse-tags when parsing tags fails
This PR was merged into the 4.4 branch.
Discussion
----------
[Twig] Remove deprecated tag usage
| 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 -->
| Tickets | n/a
| License | MIT
| Doc PR | n/a
<!--
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):
- 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 4.4.
- Legacy code removals go to the master branch.
-->
Commits
-------
cd74cb32ef [Twig] Remove deprecated tag usage
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Spotted while discussing the client with @Seldaek
The current behavior is transient: depending on the speed of the network/server, the exception can be thrown, or not.
This forces one do deal with 3/4/5xx when the first chunk is yielded.
Commits
-------
3c93764f10 [HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted
* 4.4:
Re-enable previously failing PHP 7.4 test cases
[PhpUnitBridge] fix uninitialized variable
[ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631
[Twig] Add missing check
Revert "bug #33618 fix tests depending on other components' tests (xabbuh)"
install from source to include components tests
Fix undefined constant and other minor issues
[Twig] Add NotificationEmail
ensure compatibility with type resolver 0.5
Call AssertEquals with proper parameters
[DependencyInjection] Allow binding iterable and tagged services
[Twig] Fix Twig config extra keys
fix tests depending on other components' tests
Fix lint commands frozen on empty stdin
* 3.4:
Re-enable previously failing PHP 7.4 test cases
Revert "bug #33618 fix tests depending on other components' tests (xabbuh)"
install from source to include components tests
This PR was squashed before being merged into the 4.4 branch (closes#33632).
Discussion
----------
[ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#33631
| License | MIT
This fixes exception thrown when trying to render ErrorException as an array
Commits
-------
063dc78b49 [ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631
This PR was merged into the 4.4 branch.
Discussion
----------
[TwigBridge] Fix undefined constant and other minor issues
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
/cc @fabpot
Commits
-------
e9e004e Fix undefined constant and other minor issues
* 4.3:
ensure compatibility with type resolver 0.5
Call AssertEquals with proper parameters
[Twig] Fix Twig config extra keys
fix tests depending on other components' tests
* 3.4:
ensure compatibility with type resolver 0.5
Call AssertEquals with proper parameters
[Twig] Fix Twig config extra keys
fix tests depending on other components' tests
This PR was merged into the 4.4 branch.
Discussion
----------
[Twig] Add NotificationEmail
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | -
This PR is an extract of the new Notifier component. It's a default template to send standardized emails with the Mailer component, which can be used independently of the Notifier component.
Such emails look like the following:
<img width="618" alt="image" src="https://user-images.githubusercontent.com/47313/65018883-694cb780-d92a-11e9-940a-875ea68f9e5d.png">
More info on SpeakerDeck (be warned that names have change since my presentation): https://speakerdeck.com/fabpot/symfony-notifier?slide=7
It requires Twig 1.12 which should be released later this week.
Usage example:
```php
$email = (new NotificationEmail())
->from('fabien@example.com')
->to('fabien@example.org')
->subject('My first notification email via Symfony')
->markdown(<<<EOF
There is a **problem** on your website, you should investigate it right now.
Or just wait, the problem might solves itself automatically, we never know.
EOF
)
->action('More info?', 'https://example.com/')
->importance('high')
//->exception(new \LogicException('That does not work at all...'))
;
```
Instead of `markdown()`, you can also use `content()` for simple emails.
Note that you can use Inky tags in the content:
```php
$email = (new NotificationEmail())
->from('fabien@example.com')
->to('fabien@example.org')
->subject('My first notification email via Symfony')
->markdown(<<<EOF
There is a **problem** on your website, you should investigate it right now.
Or just wait, the problem might solves itself automatically, we never know.
Some Title
==========
<center>
<button href="https://example.com/">Go?</button>
</center>
EOF
);
```
There is also the concept of a theme. By default, it uses the `default` theme, which is an alias for the `zurb_2` theme.
You can use `setTheme()` to override the theme for a given instance, or override the themes globally via the following config in `twig.yaml`:
```yaml
twig:
paths:
templates/email: email
```
Then, create `templates/email/default/notification/body.html.twig` and `templates/email/default/notification/body.txt.twig`. Extends the existing template via `{% extends "@!email/default/notification/body.html.twig" %}` (note the `!`).
Commits
-------
f6c6cf7dc9 [Twig] Add NotificationEmail
This PR was merged into the 3.4 branch.
Discussion
----------
fix tests depending on other components' tests
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
cd2f3a6056 fix tests depending on other components' tests
This PR was merged into the 3.4 branch.
Discussion
----------
[PropertyInfo] ensure compatibility with type resolver 0.5
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
same as #33588 but for the `3.4` branch
Commits
-------
2d708b3e60 ensure compatibility with type resolver 0.5
This PR was merged into the 4.4 branch.
Discussion
----------
Fix lint commands frozen on empty stdin
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Running e.g. `lint:yaml -` with no piped content makes the command hangs currently, this makes it fail instead. Also fixes the command help which we forgot to update
Commits
-------
b60e0c1454 Fix lint commands frozen on empty stdin
Since `$response->getContent()` returns string and our first parameter is already string as well, in some cases (with different precisions) it may "compare strings" as "strings" and this is not what the test wants.
By changing the first parameter to actual number we force `AssertEquals` to compare them numerically rather than literally by string content.
This PR was merged into the 4.4 branch.
Discussion
----------
[Console] Fix tests
| 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 -->
| Tickets | n/a
| License | MIT
| Doc PR | n/a
<!--
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):
- 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 4.4.
- Legacy code removals go to the master branch.
-->
Commits
-------
abe11a3024 [Console] Fix tests
This PR was merged into the 4.4 branch.
Discussion
----------
New tweaks to the Welcome Page
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Sorry for the noise! This is hopefully the last pull request related to the Welcome Page design tweaks. This one tweaks some margins, makes it look better on ultra-wide screens and prevents some unwanted horizontal/vertical scrollbars on some browsers.
Commits
-------
2737a00233 New tweaks to the Welcome Page
* 4.4:
[Twig] Remove dead code
Minor updates in the new Welcome page
Add gitignore file for Symfony 4.3
Add gitignore file for Symfony 3.4
[Inflector] Add .gitignore file
[Messenger] Fix exception message of failed message is dropped on retry
Add default value for Accept header
[HttpClient] Add .gitignore file
[Finder] Adjust regex to correctly match comments in gitignore contents
[Security] Removed unused argument in Test
[Console] Get dimensions from stty on windows if possible
[Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
* 4.3:
[Twig] Remove dead code
Add gitignore file for Symfony 4.3
Add gitignore file for Symfony 3.4
[Inflector] Add .gitignore file
[Messenger] Fix exception message of failed message is dropped on retry
Add default value for Accept header
[HttpClient] Add .gitignore file
[Finder] Adjust regex to correctly match comments in gitignore contents
[Security] Removed unused argument in Test
[Console] Get dimensions from stty on windows if possible
[Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
* 3.4:
[Twig] Remove dead code
Add gitignore file for Symfony 3.4
[Inflector] Add .gitignore file
[Security] Removed unused argument in Test
[Console] Get dimensions from stty on windows if possible
[Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
This PR was merged into the 3.4 branch.
Discussion
----------
[Twig] Remove dead code
| 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 | n/a
| License | MIT
| Doc PR | n/a
As the min version of Twig is 1.41, we can remove some dead code.
Commits
-------
786d136b5e [Twig] Remove dead code
This PR was squashed before being merged into the 4.3 branch (closes#33611).
Discussion
----------
Add gitignore file for Symfony 4.3
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
856b9a8a6e Add gitignore file for Symfony 4.3
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] Fix exception message of failed message is dropped on retry
| Q | A
| ------------- | ---
| Branch? | 4.3 <!-- 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#32719
| License | MIT
| Doc PR | NA <!-- 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/roadmap):
- 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 4.4.
- Legacy code removals go to the master branch.
-->
Commits
-------
8f9f44eb21 [Messenger] Fix exception message of failed message is dropped on retry
This PR was squashed before being merged into the 4.3 branch (closes#33340).
Discussion
----------
[Finder] Adjust regex to correctly match comments in gitignore contents
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #32985
| License | MIT
Description from issue:
When using `ignoreVCSIgnored` as argument with the Symfony Finder, it will construct a regex equivalent of the gitignore pattern. However it seems that when a comment line (prefixed with `#`) is present in the `.gitignore`, the regex used to remove comment lines matches every line and thus returns `$gitignoreFileContent` as empty.
Commits
-------
e56fc7cb58 [Finder] Adjust regex to correctly match comments in gitignore contents
This PR was merged into the 4.4 branch.
Discussion
----------
[WebProfilerBundle] Clean time.js
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
The `classnames` property was removed in https://github.com/symfony/symfony/pull/33535.
Commits
-------
997ca70385 [WebProfilerBundle] Clean time.js
This PR was merged into the 4.4 branch.
Discussion
----------
Adding .gitattributes to remove Tests directory from "dist"
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no?
| Tickets |
| License | MIT
| Doc PR |
This is a controversial topic that have been mentioned before. We recently had some discussions on Slack about it and the community not in an agreement. This was asked back in 2014 already.
Im making this PR again, because I think this will help more people than it hurts to keep the tests in the "dist" version.
### Reasons for keeping the tests with the source
* You can look at the tests to understand how the code works
* It is convenient
In the past there were an argument of people might depend on Symfony's classes in Tests. That is no longer the case since we moved reusable classes from Tests to Test.
### Reasons for removing them (merging this PR)
* There should be difference between `composer update --prefer-source` and `composer update --prefer-dist`
* Smaller packages when deploying with Docker or on Serverless.
* Static analysis tools will not complain on PHP syntax errors in our tests ([example](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/xml_with_wrong_ext.php))
## How to decide?
Merging this PR or not is tricky because no side has a solid technical argument. It is basically just personal preference. Please give this PR a 👍 or 👎 if you want to give your opinion.
## Other PRs and issues related to this:
Add .gitattributes file (https://github.com/symfony/symfony/pull/29277)
Added .gitattributes files to root and all components (https://github.com/symfony/symfony/pull/26472)
Exclude non-essential files from Composer package (https://github.com/symfony/symfony/issues/25414)
[HttpFoundation] optimize files for distribution (https://github.com/symfony/symfony/pull/24427)
Add .gitattributes files (https://github.com/symfony/symfony/pull/23926)
[Suggestion] Adding .gitattributes to ignore unnecessary folders and files for production env (https://github.com/symfony/symfony/issues/20057)
Add lightweight and root only .gitattributes (https://github.com/symfony/symfony/pull/18004)
Add .gitattributes to exclude tests from ZIPs (https://github.com/symfony/symfony/pull/17995)
[RFC] Move tests out of the source and source out of the tests (https://github.com/symfony/symfony/issues/17749)
Removal of development & testing files using .gitattributes (https://github.com/symfony/symfony/issues/16174)
Please add .gitattributes files and fix line endings (https://github.com/symfony/symfony/issues/13521)
making use of .gitattributes (https://github.com/symfony/symfony/issues/11810)
## Workarounds
There are workarounds for both sides. Example:
### Workaround if merged
* `composer update --prefer-source`
### Workaround if closed
* `find vendor/symfony -name "Tests" -type d -exec rm -r "{}" \;`
* https://github.com/editorconfig/editorconfig/issues/228
* https://github.com/dg/composer-cleaner
Commits
-------
ac7dc24bcb Adding .gitattributes to remove Tests directory from "dist"
* 4.4:
[Mailer] Fix SmtpEnvelope renaming to Envelope
fixed "link" to Contracts packages
[WebProfilerBundle] Fix time panel legend buttons
Some styling tweaks
Fixed cache pools affecting each other due to an overwritten seed variable
don't change state in case of exception
properly catch legacy tag syntax usages
minor tweaks to the welcome page
After #32998 there was a minor left over, the `testHandleAuthenticationClearsToken`
`$tokenClass` argument is no longer used and can be safely removed.
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Fix SmtpEnvelope renaming to Envelope
| 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 -->
| Tickets | n/a
| License | MIT
| Doc PR | n/a
<!--
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):
- 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 4.4.
- Legacy code removals go to the master branch.
-->
Commits
-------
5796c780ba [Mailer] Fix SmtpEnvelope renaming to Envelope
* 4.3:
fixed "link" to Contracts packages
[WebProfilerBundle] Fix time panel legend buttons
Fixed cache pools affecting each other due to an overwritten seed variable
properly catch legacy tag syntax usages
This PR was merged into the 4.4 branch.
Discussion
----------
Minor tweaks to the welcome page
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/33189#issuecomment-529177310
| License | MIT
| Doc PR | -
/cc @fabpot
Commits
-------
acd50615e7 Some styling tweaks
ddffc972a8 minor tweaks to the welcome page
This PR was merged into the 3.4 branch.
Discussion
----------
[Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | - <!-- 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/roadmap):
- 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 4.4.
- Legacy code removals go to the master branch.
-->
I don't know if this is considered a bug or a new feature ? Tell me if I need to change target branch
This PR improves the singularization of words such as "trees", "employees" or "fees"
Commits
-------
45b4edc2dc [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
This PR was merged into the 4.4 branch.
Discussion
----------
[Validator] don't change state in case of exception
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
dcd47335a8 don't change state in case of exception
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] rename SmtpEnvelope to Envelope
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Drop the Smtp prefix so that arbitrary transports do not have to depend
on SMTP specific concepts.
Commits
-------
5e2c6da349 rename SmtpEnvelope to Envelope
* 4.4:
[Mailer] Rename an exception class
[Workflow] Use a better exception message when many workflow are found
use debug.file_link_formatter service when possible
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle][ErrorRenderer] Use FileLinkFormatter service when possible
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Consistent the way TwigBundle defines the `Symfony\Bridge\Twig\Extension\CodeExtension` service:
789448b65c/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml (L88)
Commits
-------
d4a6867 use debug.file_link_formatter service when possible
* 4.4:
Re-enable push support for HttpClient
[DependencyInjection] Accept existing interfaces as valid named args
Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property
[Cache] Added reserved characters constant for CacheItem
[DI] cascade preloading only to public parameters/properties
Move Anonymous config to a SecurityFactory
* 4.3:
Re-enable push support for HttpClient
[DependencyInjection] Accept existing interfaces as valid named args
Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property
This PR was squashed before being merged into the 4.3 branch (closes#33521).
Discussion
----------
Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #33355
| License | MIT
| Doc PR |
Commits
-------
954dad44a1 Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property
This PR was squashed before being merged into the 4.4 branch (closes#33516).
Discussion
----------
[Cache] Added reserved characters constant for CacheItem
| Q | A
| ------------- | ---
| Branch? | 4.4 <!-- see below -->
| Bug fix? | no
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A <!-- required for new features -->
This PR introduces a `RESERVED_CHARACTERS` constant to the `CacheItem` class to keep things DRY.
The rationale for making the constant public is so that developers can access the list of reserved characters so they could - for example - sanitise keys before passing them to the Cache component.
Commits
-------
d8533066de [Cache] Added reserved characters constant for CacheItem
This PR was merged into the 4.4 branch.
Discussion
----------
[SecurityBundle] Move Anonymous DI integration to new AnonymousFactory
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | n/a
For some reason, all security authentication providers/listeners have a `SecurityFactory` that adds configuration and registers the necessary services, except from anonymous security. I'm not sure why that has not been done. The only thing I can think of is making sure it is added to the end.
I've added a new "internal" factory position, to make sure it is always the last registered provider and moved everything to a new `AnonymousFactory`.
Nothing changes on the usage side, but it makes internal code a bit easier to understand and makes sure we don't break anything while refactoring the `SecurityExtension` in the future.
Commits
-------
0da2761c15 Move Anonymous config to a SecurityFactory
* 4.4:
Update GitHub PR template
[DI] fix related to preloading
[HttpKernel] fix compat with legacy DebugClassLoader
[WebProfilerBundle] Assign automatic colors to custom Stopwatch categories
[DI] use dirname() when possible
Simplify usage of dirname()
Remove Google references when not needed
Simplify usage of dirname()
don't dump a scalar tag value on its own line
Remove Google references when not needed
[DI] fix Preloader
[HttpClient] fix calling the buffer-enabling callback
[HttpClient] fix php notice on push
do not perform string operations on null
Require exact match when reading from stdin with a dash
This PR was merged into the 4.4 branch.
Discussion
----------
[DI] use dirname() when possible
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
On second look, I think this works :)
Commits
-------
2eae300537 [DI] use dirname() when possible
This PR was merged into the 3.4 branch.
Discussion
----------
[Yaml] don't dump a scalar tag value on its own line
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
This commit fine tunes the bugfix made in #33377 with the feedback provided in https://github.com/symfony/symfony/issues/33464#issuecomment-528290985.
Commits
-------
a549069a49 don't dump a scalar tag value on its own line
This PR was merged into the 5.0-dev branch.
Discussion
----------
[Console] Use correct EventDispatcherInterface
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
The parameter type declaration of `Symfony\Component\Console\Application::setDispatcher()` was announced to be changed to the contracts' `EventDispatcherInterface`, but in fact we're still referencing the component's interface there.
Commits
-------
5ccb472623 [Console] Use correct EventDispatcherInterface.
This PR was merged into the 4.4 branch.
Discussion
----------
Require exact match when reading from stdin with a dash
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
I think reading from stdin should happen only when the argument is exactly a dash, with no other files on the command line.
The alternative is to allow a dash at any position in the list of files, but I'm not sure that'd make sense.
Commits
-------
3d14b79dad Require exact match when reading from stdin with a dash
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] Allow enabling buffering conditionally with a Closure
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31883
| License | MIT
| Doc PR | symfony/symfony-docs#12043
With this PR, responses can be buffered automatically from a closure passed to the `buffer` option.
```php
$resp = $client->request('GET', $url, [
'buffer' => function (array $headers): bool { return true/false; },
]);
```
When no option is provided, buffering is now enabled only for json, xml and text/* content types.
Commits
-------
f705ac9dc4 [HttpClient] Allow enabling buffering conditionally with a Closure
* 4.4: (21 commits)
[appveyor] exclude tty group
[HttpFoundation] Add types to private/final/internal methods and constructors.
Add types to private/final/internal methods and constructors.
SCA: minor code tweaks
Tweak output
[FrameworkBundle] Added --sort option for TranslationUpdateCommand
[HttpClient] fallbackto CURLMOPT_MAXCONNECTS when CURLMOPT_MAX_HOST_CONNECTIONS is not available
[DI] generate preload.php file for PHP 7.4 in cache folder
Allow version 2 of the contracts package.
[Serializer] Allow multi-dimenstion object array in AbstractObjectNormalizer
fixed typo
[HttpKernel] Fix Apache mod_expires Session Cache-Control issue
deprecated not passing dash symbol (-) to STDIN commands
[VarDumper] display ellipsed FQCN for nested classes
[VarDumper] Display fully qualified title
[Mailer] Change the syntax for DSNs using failover or roundrobin
Removed workaround introduced in 4.3
[Console] Added support for definition list
[OptionsResolver] Display full nested options hierarchy in exceptions
New welcome page
...
* 4.3:
SCA: minor code tweaks
[HttpClient] fallbackto CURLMOPT_MAXCONNECTS when CURLMOPT_MAX_HOST_CONNECTIONS is not available
fixed typo
[HttpKernel] Fix Apache mod_expires Session Cache-Control issue
Fix getFileLinkFormat() to avoid returning the wrong URL in Profiler
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpFoundation] Add types to private/final/internal methods and constructors
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #32179, #33228
| License | MIT
| Doc PR | N/A
Commits
-------
1978d88f1b [HttpFoundation] Add types to private/final/internal methods and constructors.
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] fallbackto CURLMOPT_MAXCONNECTS when CURLMOPT_MAX_HOST_CONNECTIONS is not available
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #33462
| License | MIT
| Doc PR | -
Commits
-------
0aae1d7c0a [HttpClient] fallbackto CURLMOPT_MAXCONNECTS when CURLMOPT_MAX_HOST_CONNECTIONS is not available
This PR was merged into the 4.4 branch.
Discussion
----------
[DI] generate preload.php file for PHP 7.4 in cache folder
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29105
| License | MIT
| Doc PR | -
This PR makes the PhpDumper generate a preloading file suited for PHP 7.4.
On a skeleton app, the generated file is `var/cache/dev/srcApp_KernelDevDebugContainer.preload.php` (of course, this varies by env name + kernel class)
One missing thing is listing some classes that are always needed but are not related to services.
Typically: `Request` and `Response`. We might need a new mechanism to make this list extensible.
I did not measure the benefit of this on PHP 7.4. I would really appreciate if someone could give it a try on PHP 7.4 with preloading enabled.
Commits
-------
c4dad0de5d [DI] generate preload.php file for PHP 7.4 in cache folder
This PR was merged into the 4.4 branch.
Discussion
----------
Allow version 2 of the contracts package
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | prepares #33497
| License | MIT
| Doc PR | N/A
The plan is to release a version 2 of the contracts package that will require php 7.2 but remains compatible to Symfony 4.
Commits
-------
a1ee32039b Allow version 2 of the contracts package.
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpKernel] Fix getFileLinkFormat() to avoid returning the wrong URL in Profiler
| Q | A
| ------------- | ---
| Branch? | >= 3.4 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32444 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A <!-- required for new features -->
I had this problem and I noticed that an issue had already been registered.
So I registered the pull request.
Commits
-------
9ed5f03b98 Fix getFileLinkFormat() to avoid returning the wrong URL in Profiler
This PR was merged into the 4.4 branch.
Discussion
----------
New welcome page on startup for 4.4 LTS & 5.0
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
A new LTS version of Symfony is coming and a new major version too. That deserves a little more ❤️ than usual.
This picture simulate two components of the live: the Ocean and the sky/Universe, with the aim of inspiring calm at the same time desire to build good & great things:
![welcome-page](https://user-images.githubusercontent.com/2028198/63116799-77dd3300-bf68-11e9-8bb5-8c03b301c9e2.gif)
The HUE value changes randomly each time you enter to the homepage. That's just an idea to make it dynamic. I invite you to try it and send your ideas too. I'd like this experience to be extremely exciting for newcomers.
About all text & message this would be a good time to say what people want to hear :) Symfony's amazing \o/. Some communication skills are required here.
I'm not a designer, so I'd want some expert on this topic destroying the proposal making it even better :)
HTML+CSS only: I tried to use some moderm features that were compatible with most of browser, but I might be forgetting something.
The icons were taken from https://material.io/resources/icons/ (free), but I don't know how to deal with this license:
> Our icons are free for everyone to use. Please don’t try to sell them.
> Available under [Apache license version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html).
Should we copy it somewhere? should it be visible to the user?
**Before:**
![old-welcome-page](https://user-images.githubusercontent.com/2028198/63117275-6cd6d280-bf69-11e9-9ffc-cce6000e3518.png)
A good first feeling is really really important, is it worth it? Thoughts!
ping to my friend @javiereguiluz this is for sure something you would like to check.
Cheers!
Commits
-------
328b97ec71 New welcome page
This PR was merged into the 4.4 branch.
Discussion
----------
[OptionsResolver] Display full nested option hierarchy in exceptions
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
It kind of improve the DX, especially when you define a lot of nested form options since the file and line cannot be displayed.
```php
$resolver->setDefaults([
'array' => function (OptionsResolver $arrayResolver): void {
$arrayResolver->setRequired('foo');
},
]);
```
Before:
`The required option "foo" is missing.`
After:
`The required option "array[foo]" is missing.`
That can go to 4.3 I guess.
Commits
-------
a981fc3b50 [OptionsResolver] Display full nested options hierarchy in exceptions
This PR was merged into the 4.4 branch.
Discussion
----------
[VarDumper] Display fully qualified title
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
We can see the objects with namespace that help us to navigate to the file easily.
Before: These are diffrent Collection class
<img width="203" alt="Screen Shot 2019-09-06 at 1 02 37 PM" src="https://user-images.githubusercontent.com/13897936/64410319-663f0500-d0a8-11e9-98d5-743e2ccf2737.png">
Now: we can see the diffrent
<img width="376" alt="Screen Shot 2019-09-06 at 1 02 20 PM" src="https://user-images.githubusercontent.com/13897936/64410304-60e1ba80-d0a8-11e9-9cb1-f88c0f8c3de9.png">
Commits
-------
a8252a23ff [VarDumper] display ellipsed FQCN for nested classes
84682eaa03 [VarDumper] Display fully qualified title
This PR was merged into the 4.4 branch.
Discussion
----------
Deprecated not passing dash symbol (-) to STDIN commands
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/33446#issuecomment-528276646
| License | MIT
| Doc PR | -
Follow-up https://github.com/symfony/symfony/pull/33446
> There's a conflict here: when no argument was provided, the command also reads from STDIN.
So now, it reads from STDIN, and if there is nothing there, reads from the default template.
This has been caught in php/php-src#4672
> This creates an ambiguous situation - maybe one did pipe nothing but doesn't expect the default template dir to be linted.
> I'd suggest resolving the ambiguity by reading from STDIN only when explicitly asked for. Passing - as argument could the way. And we could trigger a deprecation for now.
For consistency, the other 2 lint commands (`lint:yaml` and `lint:xliff`) have been touched as well.
The plan for 5.0 is read from the STDIN only when `-` is given.
/cc @nicolas-grekas
Commits
-------
586f299ebd deprecated not passing dash symbol (-) to STDIN commands
This PR was merged into the 4.4 branch.
Discussion
----------
[Console] Added support for definition list and horizontal table
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
I need that in a projet where I want to display some data horizontally.
Usage:
```php
<?php
use Symfony\Component\Console\Helper\TableSeparator;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Style\SymfonyStyle;
require __DIR__.'/vendor/autoload.php';
$io = new SymfonyStyle(new ArrayInput([]), new ConsoleOutput());
$io->table(['a', 'b', 'c'], [[1, 2, 3], [4, 5, 6]]);
$io->table(['a', 'b', 'c'], [[1, 2, 3], [4, 5, 6]], true);
$io->definitionList(
['foo' => 'bar'],
new TableSeparator(),
'this is a title',
new TableSeparator(),
['foo2' => 'bar2']
);
```
![image](https://user-images.githubusercontent.com/408368/63788677-2df43580-c8f6-11e9-9ce6-b7abcecf7f24.png)
Commits
-------
66028fe19f [Console] Added support for definition list
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Change DSN syntax
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License | MIT
| Doc PR | -
The current syntax for failover and roundrobin is confusing. `&&` and `||` do not really convey the right meaning. I realized that while working on a new transport that will send on more than one transport in parallel. `&&` would be a natural fit, but that's already taken.
So, this pull request changes the syntax to be more explicit.
Commits
-------
39dd213960 [Mailer] Change the syntax for DSNs using failover or roundrobin
* 4.4:
[MonologBridge] Bump min version for monolog ^1.25 and drop dead code
[Bridge/Twig] use tty group on testLintDefaultPaths
fix tests mocking final events
This PR was merged into the 4.4 branch.
Discussion
----------
fix tests mocking final events
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR |
Fix tests in 4.4 extracted from #33297
Commits
-------
637461fd51 fix tests mocking final events
This PR was merged into the 4.4 branch.
Discussion
----------
[MonologBridge] Bump min version for monolog ^1.25 and drop dead code
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
1e19c65b67 [MonologBridge] Bump min version for monolog ^1.25 and drop dead code
This PR was merged into the 4.4 branch.
Discussion
----------
[Bridge/Twig] use tty group on testLintDefaultPaths
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/33446#issuecomment-528811376
| License | MIT
| Doc PR | -
Note that I still think we should deprecate reading from STDIN when not explicitly asked for, as explained in https://github.com/symfony/symfony/pull/33446#issuecomment-528276646
Commits
-------
3c59bb5c93 [Bridge/Twig] use tty group on testLintDefaultPaths
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Check email validity before opening an SMTP connection
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes-ish
| New feature? | yes
| BC breaks? | no-ish
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
When using an SMTP server to send emails, the connection to the SMTP server happens before being sure that the email to sent is valid. That does not happen with HTTP transports.
This pull request implements a new method to be sure that we don't connect to the SMTP server if the email is not valid.
Commits
-------
dc376f52a5 [Mailer] Check email validity before opening an SMTP connection
* 4.4:
[Debug] disable new DebugClassLoader when testing the legacy one
- updated AbstractToken to compare Roles - Updated isEqualTo method to match roles as default User implements EquatableInterface - added test case - bumped symfony/security-core to 4.4
typos bis
typos
Fix more bad tests
Fix test fixtures with deprecated method signatures.
Fix 4.3 tests forward compat
[Messenger] fix empty amqp body returned as false
[Mailer] Added messenger to dev dependencies.
[Validator] Update "suggest" section in composer.json.
Fix routing cache broken when using generator_class
This PR was merged into the 4.4 branch.
Discussion
----------
[Debug] disable new DebugClassLoader when testing the legacy one
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
25a683bbeb [Debug] disable new DebugClassLoader when testing the legacy one
* 4.3:
Fix more bad tests
Fix test fixtures with deprecated method signatures.
Fix 4.3 tests forward compat
[Messenger] fix empty amqp body returned as false
Fix routing cache broken when using generator_class
This PR was merged into the 4.3 branch.
Discussion
----------
[Router] routing cache crash when using generator_class
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31807
| License | MIT
Since #28865 the Router use, by default, new generator, matcher, and dumpers.
This leads to crash when the Router use a custom generator, or matcher based on the old ones.
Commits
-------
a5b46e5390 Fix routing cache broken when using generator_class
This PR was merged into the 4.3 branch.
Discussion
----------
Fix test fixtures with deprecated method signatures
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #33483 (partly)
| License | MIT
| Doc PR | N/A
This PR upgrades two fixtures that implemented deprecated method signatures. As far as I can tell, they are used in tests that do not specifically test legacy behavior, so the fixtures should be up to date. Currently, these fixtures cause failing tests on the 4.4 branch.
Commits
-------
cc3e3d54ea Fix more bad tests
592aacff6f Fix test fixtures with deprecated method signatures.
This PR was merged into the 5.0-dev branch.
Discussion
----------
[Validator] Removed CacheInterface in favor of PSR-6
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #33414
| License | MIT
| Doc PR | symfony/symfony-docs#12276
This PR removes the deprecation layer of #33459.
Commits
-------
34b141c4eb [Validator] Removed CacheInterface in favor of PSR-6.
* 4.4:
[Validator] Deprecated CacheInterface in favor of PSR-6.
Fix wrong namespace
[Mailer] Fix typo
[Mailer] Fix an error message
maintain sender/recipient name in SMTP envelopes
[Mailer] Improve an exception when trying to send a RawMessage without an Envelope
Fix#32148 TransportException was not thrown
Add ErrorController to preview and render errors
This PR was merged into the 4.4 branch.
Discussion
----------
Added new ErrorController + Preview and enabling there the error renderer mechanism
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes (deps=high failure is normal)
| Fixed tickets | -
| License | MIT
| Doc PR | TODO
After deprecating the `ExceptionController` in TwigBundle (refs https://github.com/symfony/symfony/pull/31398) the `twig.exception_controller` config key becomes useless as feature provided by TwigBundle, while the preview controller is taking more relevance for the error renderer mechanish.
**Proposal**
* Deprecate the `twig.exception_controller` config key in favor of `framework.error_controller` with default `ErrorController` that activates the error renderer mechanism through the current `ExceptionListener`, meaning also that `DebugHandlersListener::onKernelException` method becomes useless too.
* Deprecate the `PreviewErrorController` from TwigBundle in favor of similar in FrameworkBundle.
So you no longer need to install TwigBundle to create a custom error controller or check the preview output of an error renderer (included `TwigHtmlErrorRenderer`).
Btw this would fix https://github.com/symfony/symfony/pull/31398#issuecomment-490081769, removing here workaround in SecurityBundle.
TODO:
- [x] Update CHANGELOG & UPGRADE files
- [x] Add tests
WDYT?
Commits
-------
b79532ab0e Add ErrorController to preview and render errors
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Fix an error message
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Now that the host is not the name anymore, the error message when not having a host is wrong.
Commits
-------
60bb1c0ddc [Mailer] Fix an error message
This PR was merged into the 4.3 branch.
Discussion
----------
Fix gmail relay
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #32148
| License | MIT
This tiny PR fixes#32148 by removing the emission of a notice which prevented a `TransportException` to be thrown when something wrong occured.
Commits
-------
6c90e08368Fix#32148 TransportException was not thrown
* 4.4:
[HttpClient] Fix a bug preventing Server Pushes to be handled properly
[HttpClient] fix support for 103 Early Hints and other informational status codes
fix typo
[DI] fix failure
[Validator] Add ConstraintValidator::formatValue() tests
[HttpClient] improve handling of HTTP/2 PUSH
Fix#33427
lint all templates from configured Twig paths if no argument was provided
Nullable message id?
[Validator] Only handle numeric values in DivisibleBy
[Validator] Sync string to date behavior and throw a better exception
Check phpunit configuration for listeners
registering basic exception handler for late failures
[DI] fix support for "!tagged_locator foo"
[Mailer] Add a more precise exception
[ErrorHandler][Bridge/PhpUnit] display deprecations for not-autoloaded classes
* 4.3:
[HttpClient] Fix a bug preventing Server Pushes to be handled properly
[HttpClient] fix support for 103 Early Hints and other informational status codes
[DI] fix failure
[Validator] Add ConstraintValidator::formatValue() tests
[HttpClient] improve handling of HTTP/2 PUSH
Fix#33427
[Validator] Only handle numeric values in DivisibleBy
[Validator] Sync string to date behavior and throw a better exception
Check phpunit configuration for listeners
[DI] fix support for "!tagged_locator foo"
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] fix support for 103 Early Hints and other informational status codes
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
I learned quite recently how 1xx status codes work in HTTP 1.1 when I discovered the [103 Early Hint](https://evertpot.com/http/103-early-hints) status code from [RFC8297](https://tools.ietf.org/html/rfc8297)
This PR fixes support for them by adding a new `getInformationalStatus()` method on `ChunkInterface`. This means that you can now know about 1xx status code by using the `$client->stream()` method:
```php
$response = $client->request('GET', '...');
foreach ($client->stream($response) as $chunk) {
[$code, $headers] = $chunk->getInformationalStatus();
if (103 === $code) {
// $headers['link'] contains the early hints defined in RFC8297
}
// ...
}
```
Commits
-------
34275bba1c [HttpClient] fix support for 103 Early Hints and other informational status codes
* 3.4:
[Validator] Add ConstraintValidator::formatValue() tests
[Validator] Sync string to date behavior and throw a better exception
Check phpunit configuration for listeners
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] improve handling of HTTP/2 PUSH, disable it by default
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This follows discussions with @dunglas
For the test cases, https://http2-push.io is down, let's use Akamai instead
This PR now considers the proxy settings before accepting a pushed response.
It also splits the responsibility of dealing with accepting pushed responses in method `acceptPushForRequest`.
The logic in this method could also be delegated to a userland callback passed as an option. Let's wait for someone with an actual use case before adding the option.
This PR also disables HTTP/2 PUSH by default because it is not stable: locally, with the latest curl version, enabling this on a server that pushes things fails with `Failure when receiving data from the peer`. This is not ready for prime time in either ext-curl or the underlying libcurl. You can still enable it explicitly by passing some positive number to the constructor.
Commits
-------
019bce7230 [HttpClient] improve handling of HTTP/2 PUSH
This PR was squashed before being merged into the 3.4 branch (closes#33434).
Discussion
----------
[Validator] Add ConstraintValidator::formatValue() tests
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
So https://github.com/symfony/symfony/pull/33401 tests can be built on top of this.
Commits
-------
b688aa31ec [Validator] Add ConstraintValidator::formatValue() tests
This PR was merged into the 4.3 branch.
Discussion
----------
[Validator] Only handle numeric values in DivisibleBy
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Currently it probably breaks because `abs` throws a notice on objects.
Commits
-------
f974add66a [Validator] Only handle numeric values in DivisibleBy
This PR was merged into the 4.4 branch.
Discussion
----------
[ErrorHandler] Registering basic exception handler for late failures
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Follow-up https://github.com/symfony/symfony/pull/33260 but when all handlers fail.
It'll becomes common since 4.4 where the user has control over the error rendering mechanism. If they make a mistake, we have a support page to show it, currently a blank page is displayed.
Commits
-------
ffab734615 registering basic exception handler for late failures
This PR was merged into the 4.3 branch.
Discussion
----------
Fix#33427
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #33427
| License | MIT
| Doc PR | none
Fix#33427 by checking if the message returned by the intl-icu catalog is empty. If yes then the translator returns an empty string instead of running `formatIntl()` which uses the constructor of `MessageFormatter` which throws an exception with empty strings.
Commits
-------
414dcebfc4Fix#33427
This PR was merged into the 4.4 branch.
Discussion
----------
[Translator] Nullable message id?
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
610a4e978f/src/Symfony/Component/Translation/DataCollectorTranslator.php (L144)
The message id shouldn't be `null`, but it's breaking the current code now. Shouldn't we first deprecate of passing `null` even if it's well documented?
Out there can be a lot of `->trans($var)` and `var|trans()` (like the current ones fixed here) that will break without previous warning.
WDTY?
Commits
-------
55eac63 Nullable message id?
This PR was merged into the 4.3 branch.
Discussion
----------
[DI] fix support for "!tagged_locator foo"
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Spotted during the workshop at WebSummerCamp
Commits
-------
a9f75692c9 [DI] fix support for "!tagged_locator foo"
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Add a more precise exception
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
<!--
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
-------
561f9b7345 [Mailer] Add a more precise exception
This PR was squashed before being merged into the 5.0-dev branch (closes#33431).
Discussion
----------
Casting getInt to integer
| Q | A
| ------------- | ---
| Branch? | 4.4 for features / 3.4 or 4.3 for bug fixes <!-- see below -->
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| License | MIT
Until two months ago (until here ead419b77b ) getInt was casting the returned value to integer however this was removed.
Commits
-------
68e92022e0 Casting getInt to integer
This PR was merged into the 3.4 branch.
Discussion
----------
[PHPUnit Bridge] Avoid registering listener twice
The listener can be registered via configuration by the user. In that
case, we do not want to add it again to the list of listeners.
Closes#31649
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
b190536205 Check phpunit configuration for listeners
The bridge listener can be registered via configuration by the user. In that
case, we do not want to add it again to the list of listeners.
Closes#31649
* 4.4:
[Bridge/PhpUnit] fix looking for composer
cs fix
[Mailer] fixed Mailgun support when a response is not JSON as expected
[4.3] Cleanup tests
Cleanup tests
[Finder] Prevent unintentional file locks in Windows
[FrameworkBundle] Fix about command not showing .env vars
[DomCrawler] Fix FileFormField PHPDoc
[Mailer] Remove the default dispatcher in AbstractTransport
Fix#33395 PHP 5.3 compatibility
This PR was merged into the 4.3 branch.
Discussion
----------
[Mailer] Fix Mailgun support when a response is not JSON as expected
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32043
| License | MIT
| Doc PR | n/a
Sometimes, like when getting a 401, the Mailgun API does not respond with JSON :(
Commits
-------
3b2db425f6 [Mailer] fixed Mailgun support when a response is not JSON as expected
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Add support for multiple mailers
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | closes#32535
| License | MIT
| Doc PR | -
This adds the possibility to define several email transports.
If you only have one email transport, nothing changes:
```yaml
framework:
mailer:
dsn: '%env(MAILER_DSN)%'
```
But if you need more than one, use the `transports` entry instead:
```yaml
framework:
mailer:
transports:
main: '%env(MAILER_DSN)%'
important: '%env(MAILER_DSN_IMPORTANT)%'
```
Then, when sending an email via the `Mailer`, pass the mailer name explicitly (by default, the first one is used):
```php
// use the first "main" transport
$mailer->send($email);
// or use the "important" one (`null` is the envelope)
$mailer->send($email, null, 'important');
```
The web profiler now displays the name and the shorten DSN.
Commits
-------
de5fae4dd8 [Mailer] Add support for multiple mailers
This PR was merged into the 4.3 branch.
Discussion
----------
[Mailer] Remove the default dispatcher in AbstractTransport
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License | MIT
| Doc PR | n:a
Creating a default event dispatcher does not make sense as nobody can listen on it.
Commits
-------
55d6a65df9 [Mailer] Remove the default dispatcher in AbstractTransport
This PR was merged into the 5.0-dev branch.
Discussion
----------
Add parameter type declarations to magic methods
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #32179
| License | MIT
| Doc PR | N/A
Commits
-------
ec8215c386 Add parameter type declarations to magic methods.
This PR was squashed before being merged into the 4.3 branch (closes#33357).
Discussion
----------
[FrameworkBundle] Fix about command not showing .env vars
Before this fix, `bin/console about` can't properly show `Environment (.env)` section because:
`SYMFONY_DOTENV_VARS` which stores all keys of Dotenv-set env vars, is being fetched via `getenv()`.
However, in Symfony Dotenv 4.3, usage of `putenv()` is deprecated:
d2fa94d259 (diff-a6967492da82dce9ba93bcba3eee0334)
so we can get env vars via `getenv()` only when `new Dotenv(true)`.
In the default shipped `config/bootstrap.php`, there is `new Dotenv(false)` set.
(Maybe related #29131)
| Q | A
| ------------- | ---
| Branch? | 4.3 for bug fixes <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- 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 -->
| License | MIT
<!--
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
-------
f48f19db91 [FrameworkBundle] Fix about command not showing .env vars
This PR was squashed before being merged into the 3.4 branch (closes#33289).
Discussion
----------
[DomCrawler] Fix FileFormField PHPDoc
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
`null` is a valid value, it is used in case of errors. Then the parent class must allow `null` values too. I think it's important regarding the ongoing process of adding typehints everywhere.
Commits
-------
162bfc3cad [DomCrawler] Fix FileFormField PHPDoc
* 4.4:
[Routing] fix static route reordering when a previous dynamic route conflicts
conflict with HttpKernel 5
Return null as Expire header if it was set to null
bug #33370 Fix import statement typo in NullCache (adrienbrault)
[ProxyManager] remove ProxiedMethodReturnExpression polyfill
fix dumping not inlined scalar tag values
Fix import statement typo in NullCache
[DoctrineBridge] Allow configuring class names through methods instead of class parameters
* 4.3:
[Routing] fix static route reordering when a previous dynamic route conflicts
Return null as Expire header if it was set to null
bug #33370 Fix import statement typo in NullCache (adrienbrault)
[ProxyManager] remove ProxiedMethodReturnExpression polyfill
fix dumping not inlined scalar tag values
* 3.4:
Return null as Expire header if it was set to null
[ProxyManager] remove ProxiedMethodReturnExpression polyfill
fix dumping not inlined scalar tag values
This PR was merged into the 4.3 branch.
Discussion
----------
[Routing] fix static route reordering when a previous dynamic route conflicts
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Spotted while playing with the code.
I confirm the test case is green on 3.4 too (but route reordering didn't exist then.)
Commits
-------
cba3b6245a [Routing] fix static route reordering when a previous dynamic route conflicts
This PR was squashed before being merged into the 3.4 branch (closes#33353).
Discussion
----------
Return null as Expire header if it was set to null
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
This PR fixes a regression introduces in #33332. If you set the `Expires` header to null when creating a `Response`, the `getExpires` function returned a date instead of null.
```php
$response = new Response(null, 200, ['Expires' => null]);
$response->getExpires(); // Returns a date currently, but should return null
```
See also [the comment](https://github.com/symfony/symfony/pull/33332#discussion_r317934607) in the PR introducing this regression.
Commits
-------
5e3c7ea452 Return null as Expire header if it was set to null
This PR was merged into the 5.0-dev branch.
Discussion
----------
[Security] drop support for non-boolean return values from checkCredentials()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
6a66e19b88 drop support for non-boolean return values from checkCredentials()
This PR was merged into the 4.4 branch.
Discussion
----------
Allow configuring class names through methods instead of class parameters in Doctrine extensions
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
While removing class parameters for DoctrineBundle 2.0 (see https://github.com/doctrine/DoctrineBundle/issues/630), I noticed that the DoctrineExtension still requires them. This PR adds a new method that keeps legacy behaviour, but will dropped in Symfony 5. Extending classes (mainly DoctrineBundle and DoctrineMongoDBBundle) must implement this method themselves to return the appropriate class names instead of declaring them as class parameters in their service configuration. I'll create a separate for the master branch to make this method abstract in 5.0.
The cache driver class names are not being replaced in this PR, as we're dropping support for `doctrine/cache` in DoctrineBundle 2.0. A separate PR will be created to handle those deprecations and to clean up the code.
Commits
-------
b53d8ccfc1 [DoctrineBridge] Allow configuring class names through methods instead of class parameters
* 4.4:
bumped Symfony version to 4.3.5
Sort components on CI
fix parameter type declaration and make fabbot happy
Upgraded CI Composer
updated VERSION for 4.3.4
updated CHANGELOG for 4.3.4
bumped Symfony version to 3.4.32
updated VERSION for 3.4.31
update CONTRIBUTORS for 3.4.31
updated CHANGELOG for 3.4.31
* 4.3:
bumped Symfony version to 4.3.5
Sort components on CI
fix parameter type declaration and make fabbot happy
Upgraded CI Composer
updated VERSION for 4.3.4
updated CHANGELOG for 4.3.4
bumped Symfony version to 3.4.32
updated VERSION for 3.4.31
update CONTRIBUTORS for 3.4.31
updated CHANGELOG for 3.4.31
* 3.4:
Sort components on CI
fix parameter type declaration and make fabbot happy
Upgraded CI Composer
bumped Symfony version to 3.4.32
updated VERSION for 3.4.31
update CONTRIBUTORS for 3.4.31
updated CHANGELOG for 3.4.31
This PR was squashed before being merged into the 3.4 branch (closes#33335).
Discussion
----------
[DependencyInjection] Fixed the `getServiceIds` implementation to always return aliases
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | maybe
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #33307
| License | MIT
| Doc PR | -
Changed the getServiceIds implementation in the Container base class to include aliases. Modified existing tests. Added test which uses the PhpDumper.
Fixes https://github.com/symfony/symfony/issues/33307
Without this patch the implementations of the container are inconsistent in whether or not they return aliases (see issue). Fixing this could be considered a BC break for the affected Container class.
As an alternative to keep the behaviour in Container unchanged, the dumped container could be patched instead. And then only apply this version of the patch to master. This however keeps the inconsistency between Container and ContainerBuilder.
Commits
-------
834d5cbce2 [DependencyInjection] Fixed the `getServiceIds` implementation to always return aliases
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] Stop worker when it should stop
| Q | A
| ------------- | ---
| Branch? | 4.3 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | NA <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | NA <!-- 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/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.
-->
There are 2 things about this PR:
* This PR fix the bug when using `limit`, `memory-limit`, `time-limit` options with command `messenger:consume`, these options does not work if the receiver return multiple messages
* This PR is the continue work of https://github.com/symfony/symfony/pull/32783
Commits
-------
5c1f3a2414 [Messenger] Stop worker when it should stop
* 4.4:
Add return-types with help from DebugClassLoader in the CI
do not mock removed getPublicDir() method
[Bridge/Doctrine] fix review
[ErrorHandler] make DebugClassLoader able to add return type declarations
This PR was merged into the 4.4 branch.
Discussion
----------
Add return-types with help from DebugClassLoader in the CI
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #33228
| License | MIT
| Doc PR | -
I've spent a great deal of time on this PR, experimenting with adding return types to the codebase.
TL;DR: my conclusion is that we cannot make it for 5.0.
There are two reasons for this:
1. The burden this will put on the community is immense, especially when considering that third party libs must also be updated for any apps to work at all on a return-typed 5.0. Symfony must add them last, not first.
2. We need return type covariance, yet this won't be available before PHP 7.4, while 5.0 supports 7.2.
What's attached?
- ~a draft patching logic in `DebugClassLoader` to add return-type where it discovers this should be done~
- return types added automatically thanks to #33283
- ~manual fixes for situations not handled (yet, if possible at all) by that logic in `DebugClassLoader`~ #33332
What's achieved? Tests are green \o/
At this stage, I think we have to acknowledge we won't add return-types in 5.0 but prepare a serious plan to add them in 6.0.
This plan could be:
- [x] make DebugClassLoader able to automate adding return types.
- [x] in 4.4: add all possible return types that don't break BC, e.g. in `Tests` and in generated code
- [x] spot and fix places where annotations aren't accurate, add more annotations where possible.
- [x] ensure `DebugClassLoader` triggers the best possible deprecations that encourage ppl to add return-types in their libs/apps. This means we could decide to disable the current ones (see #33235) and to re-enable them in 5.1. This will also give us the time to fine-tune the tooling (item 1. on this list)
Ideally, we could reach a point where we could test branch 4.4 *with* return-types: we'd use the tooling to add them automatically in the CI job, then we'd run tests and they should be green. Let's do this?
Help Wanted, here is how:
*With PHP 7.4*, run `php .github/patch-types.php`. This will add return types everywhere possible.
Then run tests, e.g. `./phpunit src/Symfony/Component/HttpFoundation --exclude-group legacy,issue-32995`
Here are the components that fail with return types added, please help me check them all with a PR on [my fork](https://github.com/nicolas-grekas/symfony/tree/eh-return-types):
- [x] src/Symfony/Bridge/Doctrine
- [x] src/Symfony/Bridge/Monolog
- [x] src/Symfony/Bridge/PhpUnit
- [x] src/Symfony/Bridge/ProxyManager
- [x] src/Symfony/Bridge/Twig
- [x] src/Symfony/Bundle/DebugBundle
- [x] src/Symfony/Bundle/FrameworkBundle
- [x] src/Symfony/Bundle/SecurityBundle
- [x] src/Symfony/Bundle/TwigBundle
- [x] src/Symfony/Bundle/WebProfilerBundle
- [x] src/Symfony/Bundle/WebServerBundle
- [x] src/Symfony/Component/Asset
- [x] src/Symfony/Component/BrowserKit
- [x] src/Symfony/Component/Cache
- [x] https://github.com/nicolas-grekas/symfony/pull/28 src/Symfony/Component/Config
- [x] src/Symfony/Component/Console
- [x] src/Symfony/Component/CssSelector
- [x] src/Symfony/Component/Debug
- [x] https://github.com/nicolas-grekas/symfony/pull/28 src/Symfony/Component/DependencyInjection
- [x] src/Symfony/Component/DomCrawler
- [x] src/Symfony/Component/Dotenv
- [x] src/Symfony/Component/ErrorHandler
- [x] src/Symfony/Component/ErrorRenderer
- [x] https://github.com/nicolas-grekas/symfony/pull/24 src/Symfony/Component/EventDispatcher
- [x] src/Symfony/Component/ExpressionLanguage
- [x] src/Symfony/Component/Filesystem
- [x] src/Symfony/Component/Finder
- [x] src/Symfony/Component/Form
- [x] src/Symfony/Component/HttpClient
- [x] src/Symfony/Component/HttpFoundation
- [x] src/Symfony/Component/HttpKernel
- [x] src/Symfony/Component/Inflector
- [x] src/Symfony/Component/Intl
- [x] src/Symfony/Component/Ldap
- [x] src/Symfony/Component/Lock
- [x] src/Symfony/Component/Mailer
- [x] src/Symfony/Component/Messenger
- [x] src/Symfony/Component/Mime
- [x] src/Symfony/Component/OptionsResolver
- [x] src/Symfony/Component/Process
- [x] src/Symfony/Component/PropertyAccess
- [x] src/Symfony/Component/PropertyInfo
- [x] https://github.com/nicolas-grekas/symfony/pull/25 src/Symfony/Component/Routing
- [x] https://github.com/nicolas-grekas/symfony/pull/26 src/Symfony/Component/Security
- [x] src/Symfony/Component/Security/Core
- [x] src/Symfony/Component/Security/Guard
- [x] src/Symfony/Component/Security/Http
- [x] https://github.com/nicolas-grekas/symfony/pull/29 src/Symfony/Component/Serializer
- [x] src/Symfony/Component/Security/Csrf
- [x] src/Symfony/Component/Stopwatch
- [x] src/Symfony/Component/Templating
- [x] https://github.com/nicolas-grekas/symfony/pull/27 src/Symfony/Component/Translation
- [x] src/Symfony/Component/Validator
- [x] src/Symfony/Component/VarDumper
- [x] src/Symfony/Component/VarExporter
- [x] src/Symfony/Component/WebLink
- [x] src/Symfony/Component/Workflow
- [x] src/Symfony/Component/Yaml
- [x] src/Symfony/Contracts
Commits
-------
11149a1fbb Add return-types with help from DebugClassLoader in the CI
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpKernel] do not mock removed getPublicDir() method
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
54cb471 do not mock removed getPublicDir() method
This PR was merged into the 4.4 branch.
Discussion
----------
[ErrorHandler] make DebugClassLoader able to add return type declarations
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #33236
| License | MIT
| Doc PR | -
This is the current state of the patching logic I'm using in `DebugClassLoader`.
I run it after a `composer i -o` with the excluded classes emptied.
It's not perfect, it requires manual changes/review, but it did the job so far.
Patching is enabled with the `SYMFONY_PATCH_TYPE_DECLARATIONS` env var.
The value of the env var is an URL-encoded array, with the following parameters as of now:
- `force=0/1/docblock`:
- `0` adds return types only to non-BC breaking places: internal/final/test methods;
- `1` adds return types everywhere possible, potentially breaking BC with child classes that didn't declare the return types before;
- `docblock` adds `@return` annotations to opt-out from deprecation notices that `DebugClassLoader` trigger otherwise - the annotation meaning: "I know a return type should be used here instead of an annotation, but I can't add it for BC reasons for now".
- `php71-compat=0/1`: to prevent using the `object` type when the code must be compatible with PHP 7.1
Commits
-------
72f6a970fc [ErrorHandler] make DebugClassLoader able to add return type declarations
This PR was merged into the 4.4 branch.
Discussion
----------
[SecurityGuard] Deprecate returning non-boolean values from checkCredentials()
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | prepares #33228
| License | MIT
| Doc PR | TODO
This PR suggests to deprecate implementations of `Symfony\Component\Security\Guard\AuthenticatorInterface::checkCredentials()` that return non-boolean values. This will allow us to add `bool` as return type declaration in the future.
https://github.com/nicolas-grekas/symfony/pull/26#discussion_r317084918
/cc @nicolas-grekas @weaverryan
Commits
-------
a0ca3afeca Deprecate returning non-boolean values from checkCredentials().
This PR was merged into the 4.4 branch.
Discussion
----------
[PhpUnitBridge] Bump SYMFONY_PHPUNIT_VERSION
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
👋 here we are again :)
i was wondering... cant we just install the latest minor by default, thus `SYMFONY_PHPUNIT_VERSION=8`? There should be no BC breaks, and would reduce the maintenance to one major bump, once a year ... isnt it? 🤔
Commits
-------
9cbd0e8809 [PhpUnitBridge] Bump SYMFONY_PHPUNIT_VERSION
This PR was merged into the 4.4 branch.
Discussion
----------
Add missing return annotations on magic methods
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
My script had a bug, spotted by reviewing #33267
These annotations express our intention to add real return types in a future major release (likely v6)
Commits
-------
10983fcb17 Add missing return annotations on magic methods
* 4.4:
Revert "bug #31620 [FrameworkBundle] Inform the user when save_path will be ignored (gnat42)"
[Form][PropertyPathMapper] Avoid extra call to get config
[HttpKernel] remove unused fixtures
* 4.3:
Revert "bug #31620 [FrameworkBundle] Inform the user when save_path will be ignored (gnat42)"
[Form][PropertyPathMapper] Avoid extra call to get config
[HttpKernel] remove unused fixtures
* 3.4:
Revert "bug #31620 [FrameworkBundle] Inform the user when save_path will be ignored (gnat42)"
[Form][PropertyPathMapper] Avoid extra call to get config
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpKernel] remove unused fixtures
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR |
those are remnants of bundle inheritance that has been removed in sf 4
Commits
-------
5ffec16396 [HttpKernel] remove unused fixtures
This PR was merged into the 3.4 branch.
Discussion
----------
[Form][PropertyPathMapper] Avoid extra call to get config
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
3e2aada2d8 [Form][PropertyPathMapper] Avoid extra call to get config
This PR was merged into the 4.4 branch.
Discussion
----------
Add return types to internal & magic methods when possible
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #33236#33228
| License | MIT
| Doc PR | -
Commits
-------
962dcfeed0 Add return types to internal & magic methods when possible
This PR was merged into the 4.4 branch.
Discussion
----------
[Mime] Add Address::fromString
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #33086
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/12128
This will allow to create a Address from a string such as 'Name <name@example.com>'
Example:
```php
$address = Address::fromString("Name <name@example.com>");
```
Commits
-------
75ea8d0d67 Add Address::fromString
This PR was merged into the 5.0-dev branch.
Discussion
----------
Parameter type leftovers
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #32179
| License | MIT
| Doc PR | N/A
Commits
-------
34eda04866 Added more parameter type declarations.
This PR was merged into the 4.4 branch.
Discussion
----------
Mark all dispatched event classes as final
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License | MIT
| Doc PR |
I think we should mark all our Event classes as final. There is no point in people extending them as the libraries that use the event, will only dispatch this event. So extending events in user-land achieves nothing as the subclasses won't be dispatched.
I'm not talking about the base events that are meant to be extended like KernelEvent, but the leaf events like ExceptionEvent, ResponseEvent etc.
Then we can also make them real final in 5.0 as the events are value objects that should not be mocked.
Commits
-------
4bb38eec89 Mark all dispatched event classes as final
* 4.4:
Do not extend the new SF 4.3 ControllerEvent so we can make it final
Backported return type violation bugfixes.
fix deprecated call to setLocale with null
[FrameworkBundle] Fix BrowserKit assertions to make them compatible with Panther
[HttpKernel] deprecate global dir to load resources from
This PR was merged into the 4.4 branch.
Discussion
----------
fix deprecated call to setLocale with null
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR |
Fix a potentially invalid call since #33272
Commits
-------
26f9afe8d1 fix deprecated call to setLocale with null
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpKernel] deprecate global dir to load resources from
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #31915 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR |
Replaces #31958
Here two example deprecations by adding files in the deprecated locations:
```
Overwriting the resource "@AcmeBundle/Resources/config/routing.yaml" with "/vagrant/src/Resources/AcmeBundle/config/routing.yaml" is deprecated since Symfony 4.4 and will be removed in 5.0.
Loading the file "foobar.yaml" from the global resource directory "/vagrant/src" is deprecated since Symfony 4.4 and will be removed in 5.0.
```
Commits
-------
aa82566f76 [HttpKernel] deprecate global dir to load resources from
* 4.3:
Do not extend the new SF 4.3 ControllerEvent so we can make it final
Backported return type violation bugfixes.
[FrameworkBundle] Fix BrowserKit assertions to make them compatible with Panther
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpKernel] Do not extend the new SF 4.3 ControllerEvent so we can make it final
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks? | unlikely
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License | MIT
| Doc PR |
See https://github.com/symfony/symfony/pull/33152#discussion_r313846346
Remember the ControllerEvent is new in SF 4.3 so we just go back to what it was before 4.3
Commits
-------
00140b6a7c Do not extend the new SF 4.3 ControllerEvent so we can make it final
* 4.4:
Removed calls to Twig\Environment::loadTemplate().
[Intl] make polyfill classes abstract, fix edge case
[Mime] Trim and remove line breaks from NamedAddress name arg
deprecate support for null locales
[TwigBridge] Mark all classes extending twig as @final
[Mime] Remove NamedAddress
[Messenger] remove patch release BC layer of durable and expiring delay
This PR was merged into the 4.4 branch.
Discussion
----------
Removed calls to Twig\Environment::loadTemplate()
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
This PR prepares #33039. Twig 3 does not have the `loadTemplate()` anymore, so this PR replaces calls to that method.
Commits
-------
ea9e375b0b Removed calls to Twig\Environment::loadTemplate().
This PR was merged into the 4.4 branch.
Discussion
----------
[Intl] make polyfill classes abstract, fix edge case
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
While working on return types, I keep stumbling on those classes that are `@internal`, but for which we must not add return types, because they're polyfills and are extended by stubs found in the `Resources` folder of the component.
Making the polyfills abstract fixes the linting issue.
This made me discover we have a glitch in the `getPattern()` implementation, that makes our version diverge from intl's. Fixed here too.
On 4.4 because let's not disrupt 3.4.
Commits
-------
c757b95aed [Intl] make polyfill classes abstract, fix edge case
This PR was merged into the 4.4 branch.
Discussion
----------
[Translation] deprecate support for null locales
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
e6b6a9d33a deprecate support for null locales
This PR was squashed before being merged into the 4.3 branch (closes#33216).
Discussion
----------
[Mime] Trim and remove line breaks from NamedAddress name arg
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | YES
| New feature? | NO
| BC breaks? | NO <!-- see https://symfony.com/bc -->
| Deprecations? | NO <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | YES <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
This patch trims the name argument of named address in order to avoid some cases where the name is a non-empty input consisting of whitespace and line breaks which would lead to forming of addresses such as `" " <mail@example.org>` <sup>1</sup>
---
In a large Symfony codebase that deals with sending large volumes of email we encountered an issue after the Mailer was changed from PHPMailer to the Symfony Mailer component.
The issue: Some emails would not render correctly as either plaintext or html but instead the original email source with headers and quoted-printable content would render in clients such as MS Outlook 2003, later versions of Outlook and other clients do not seem affected.
After some investigation we found that the error came from a line that looked like this: `$message->addTo(new NamedAddress($contact->getEmailCanonical(), $contact->getFullName()))`.
The `getFullName` method simply concated the first/last name with a space in between. For contacts without either, this resulted in representation 1. This causes MS Outlook 2003 (potentially Outlook 2000 as well but this was not tested) to malfunction and completely fail to render the email.
This patch aims to fix the aforementioned issue.
Commits
-------
e491e3a594 [Mime] Trim and remove line breaks from NamedAddress name arg
This PR was merged into the 4.4 branch.
Discussion
----------
[TwigBridge] Mark all classes extending twig as @final
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes-ish
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets | refs #33039
| License | MIT
| Doc PR | n/a
Classes defining extensions/nodes/node visitors/token parsers should not be changed. They should be final.
That would also help with Twig 3.0 which introduces type hints (including return types).
Commits
-------
d657459a5f [TwigBridge] Mark all classes extending twig as @final
This PR was merged into the 4.4 branch.
Discussion
----------
[Messenger] remove patch release BC layer of durable and expiring delay
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no <!-- 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 <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License | MIT
| Doc PR |
Removes the small BC layer of #33127 from 4.3 in 4.4
Commits
-------
d5aaf44529 [Messenger] remove patch release BC layer of durable and expiring delay
This PR was merged into the 4.4 branch.
Discussion
----------
[4.4] Add return types on internal|final|private methods (bis)
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Found while working on #33259
`: self` is used for final methods only. I'd have preferred using `: object` but that's not possible on PHP 7.1
Commits
-------
23faee406f [4.4] Add return types on internal|final|private methods (bis)
This PR was merged into the 4.4 branch.
Discussion
----------
Add types to routing and DI configuration traits.
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | I don't think so.
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #32179, #33228
| License | MIT
| Doc PR | N/A
This PR backports the type declarations added to the configurator traits of the Routing and DI components. These traits expose only final methods, so it should be pretty safe to add return types to them.
The only scenario I could make up where this change will break something is if a trait is used to override a method: https://3v4l.org/EAsk8 But I doubt that those traits are used that way.
On master, we've used the `object` return type for the fluent methods. That type is not available on 4.4 where we have to support php 7.1. I'm using `self` instead. Since the methods are final and thus cannot be overridden, I believe that we shouldn't run into covariance issues here, so `self` should be safe.
Commits
-------
1ca30c97e6 Add types to roting and DI configuration traits.