* 4.3:
add back possibility to use form themes without translations
[HttpClient] fix Psr18Client handling of non-200 response codes
[WebProfilerBundle] fix FC with HttpFoundation v5
[OptionsResolver] fix adding $triggerDeprecation to Options::offsetGet()
[Form] test case is not legacy
Fix reporting unsilenced deprecations from insulated tests
fix handling nested embeddables
Added FormInterface to @return Form::getClickedButton docblock
* 4.2:
[WebProfilerBundle] fix FC with HttpFoundation v5
[OptionsResolver] fix adding $triggerDeprecation to Options::offsetGet()
[Form] test case is not legacy
Fix reporting unsilenced deprecations from insulated tests
Added FormInterface to @return Form::getClickedButton docblock
* 3.4:
[WebProfilerBundle] fix FC with HttpFoundation v5
[Form] test case is not legacy
Fix reporting unsilenced deprecations from insulated tests
Added FormInterface to @return Form::getClickedButton docblock
This PR was merged into the 4.3 branch.
Discussion
----------
[TwigBridge] add back possibility to use form themes without translations
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31968
| License | MIT
| Doc PR |
Commits
-------
87c1d19e72 add back possibility to use form themes without translations
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] make Psr18Client implement relevant PSR-17 factories
| 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 | -
This should help use the component with libs that consume only PSR-18.
Commits
-------
1c0baf689d [HttpClient] make Psr18Client implement relevant PSR-17 factories
This PR was merged into the 4.4 branch.
Discussion
----------
[WebProfilerBundle] Select default theme based on user preferences
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| 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 | (not needed)
This is the same we recently added to symfony.com website. It works on latest versions of Firefox and Safari only (Chrome will add support soon).
Commits
-------
0fc0a348b8 [WebProfilerBundle] Select default theme based on user preferences
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] test case is not legacy
| 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 | -
At least it's green.
/cc @xabbuh @HeahDude
Commits
-------
9ad324ba29 [Form] test case is not legacy
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Allow dots in translation domains
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #31400 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | tbd. <!-- required for new features -->
### Description
With this fix it is now possible to have `.` in translation domains like `app.security.en.yaml`.
### Todo
- [x] add a test case
Commits
-------
4b593b08d1 [FrameworkBundle] Allow dots in translation domains
This PR was squashed before being merged into the 4.4 branch (closes#31321).
Discussion
----------
[DI] deprecates tag !tagged in favor of !tagged_iterator
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #31289
| License | MIT
| Doc PR | tbd.
### Todo
- [x] fix tests
Commits
-------
ab8fb1868f [DI] deprecates tag !tagged in favor of !tagged_iterator
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] Add Button type back to Form::getClickedButton docblock
| 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 |
In commit 56429a6f08 the `Button` type was removed from the return doc block.
I suspect this was an oversight because, AFAIK, the [recommended way](https://symfony.com/doc/current/form/multiple_buttons.html) to check the name of a clicked button would require a return type of `Button` or `SubmitButton`.
The effect is that our static analysis checks are failing.
```
Call to an undefined method
Symfony\Component\Form\ClickableInterface::getName().
```
Commits
-------
b71d589071 Added FormInterface to @return Form::getClickedButton docblock
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] fix FC with HttpKernel v5
| 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 | -
This class is deprecated and is thus not enough a reason to conflict with http-kernel v5
Should unlock #31918
Commits
-------
6c109c71a9 [FrameworkBundle] fix FC with HttpKernel v5
This PR was merged into the 4.3 branch.
Discussion
----------
[TwigBundle] fix tests
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Should make master back to green.
Commits
-------
5b29918043 [TwigBundle] fix tests
* 4.3:
[Serializer] Fix DataUriNormalizer deprecation (MIME type guesser is optional)
[DependencyInjection] fix the ValidateEnvPlaceHolderPassTest that was using a deprecated path for TreeBuilder
avoid service id conflicts with Swiftmailer
[Form] fix usage of legacy TranslatorInterface
[Serializer] Fix DataUriNormalizer docblock & composer suggest section
This PR was merged into the 4.2 branch.
Discussion
----------
[DependencyInjection] fix the ValidateEnvPlaceHolderPassTest that was using a deprecated path for TreeBuilder
| Q | A
| ------------- | ---
| Branch? | 4.2
| 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 | none <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | none <!-- 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.
-->
This should be fixed in 4.2 because the deprecation has been introduced in 4.2 as said by @stof in https://github.com/symfony/symfony/pull/31932/files#r291600094
Commits
-------
caabd92f89 [DependencyInjection] fix the ValidateEnvPlaceHolderPassTest that was using a deprecated path for TreeBuilder
This PR was merged into the 4.3 branch.
Discussion
----------
[FrameworkBundle] avoid service id conflicts with Swiftmailer
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31906
| License | MIT
| Doc PR |
Commits
-------
5ce0edeb12 avoid service id conflicts with Swiftmailer
* 4.3:
[Validator] fix deprecation layer of ValidatorBuilder
[HttpKernel] Fix missing use for request and response classes
bumped Symfony version to 4.3.2
updated VERSION for 4.3.1
updated CHANGELOG for 4.3.1
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] Fix wrong DateTime on outdated ICU library
| Q | A |
| --- | --- |
| Branch? | 3.4 |
| Bug fix? | Yes |
| New feature? | No |
| BC breaks? | No |
| Deprecations? | No |
| Tests pass? | Yes |
| Fixed tickets | --- |
| License | MIT |
There is a problem, when server uses outdated version of ICU (php-intl).
It throws no exeption or debug message on unexisting Timezone. So sometimes you can get wrong DateTime in Forms, because Intl uses 'Etc/Unknown' (UTC+0) instead correct Timezone. And it happens very unobvious.
I added `\IntlExeption` for that cases.
Commits
-------
a6025ab5ee Change IntlTimeZone to DateTimeZone
* 4.3:
[HttpKernel] fix link to source generation
[Doctrine Bridge] Check field type before adding Length constraint
[FrameworkBundle] fix BC-breaking property in WebTestAssertionsTrait
[Cache] Pass arg to get callback everywhere
Fix DoctrineBridge upgrade 5.0
[FramworkBundle][HttpKernel] fix KernelBrowser BC layer
Add a missing quote in getValue() DocBlock
[Messenger] Add runtime check for ext redis version
[HttpFoundation] Fixed case-sensitive handling of cache-control header in RedirectResponse constructor.
minor: ChoiceType callable deprecation after/before seems wrong
This PR was merged into the 4.3 branch.
Discussion
----------
[FrameworkBundle] fix BC-breaking property in WebTestAssertionsTrait
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31653
| License | MIT
| Doc PR | -
No properties should be exposed.
Commits
-------
625392669a [FrameworkBundle] fix BC-breaking property in WebTestAssertionsTrait
This PR was merged into the 4.3 branch.
Discussion
----------
[FramworkBundle][HttpKernel] fix KernelBrowser BC layer
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31762
| License | MIT
| Doc PR | -
Swap the order of inheritance to preserve BC with legacy `Client` type hints.
From #30541
Commits
-------
1a4c2548d5 [FramworkBundle][HttpKernel] fix KernelBrowser BC layer
This PR was merged into the 4.2 branch.
Discussion
----------
[Cache] Pass arg to get callback everywhere
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Some adapters does not pass an useless "save" bool arg. However, that makes a `CallbackInterface` callable unusable with them since the arg is required in the interface.
Commits
-------
d03eb033bb [Cache] Pass arg to get callback everywhere
This PR was squashed before being merged into the 4.3 branch (closes#31874).
Discussion
----------
[Doctrine Bridge] Check field type before adding Length constraint
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31855
| License | MIT
| Doc PR |
Validator\DoctrineLoader now add a Length constraint only on field of type string, text and guid; for any other type the mapping length is just ignored
Commits
-------
35e6df6bac [Doctrine Bridge] Check field type before adding Length constraint
* 4.3:
[Cache] Fixed undefined variable in ArrayTrait
[HttpClient] revert bad logic around JSON_THROW_ON_ERROR
[HttpKernel] Fix handling non-catchable fatal errors
Fix json-encoding when JSON_THROW_ON_ERROR is used
[HttpFoundation] work around PHP 7.3 bug related to json_encode()
[HttpClient] add $response->cancel()
[Security] added support for updated \"distinguished name\" format in x509 authentication
This PR was squashed before being merged into the 4.3 branch (closes#31864).
Discussion
----------
[Cache] Fixed undefined variable in ArrayTrait
| 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 |
So once again (see https://github.com/symfony/symfony/pull/29591) my test suite managed to find an error in ArrayTrait in cache. This time it was this PR: https://github.com/symfony/symfony/pull/31395 later improved by https://github.com/symfony/symfony/pull/31590 that introduced `$id` to logging, which I guess should be `$key`? So this PR changes it to `$key`, ~but my tests **still fail** as there is no `$this->namespace` in `ArrayAdapter` (is this the only class that uses this ArrayTrait?). But I don't know what to do about it. Maybe @nicolas-grekas has some answers?~
Commits
-------
8568923491 [Cache] Fixed undefined variable in ArrayTrait
* 4.2:
[HttpKernel] Fix handling non-catchable fatal errors
Fix json-encoding when JSON_THROW_ON_ERROR is used
[HttpFoundation] work around PHP 7.3 bug related to json_encode()
[Security] added support for updated \"distinguished name\" format in x509 authentication
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpFoundation] Fixed case-sensitive handling of cache-control header in RedirectResponse constructor
…r in RedirectResponse constructor.
| 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 | #31862 <!-- #-prefixed issue number(s), if any -->
| License | MIT
Perform a case-insensitive check on `$headers` in \Symfony\Component\HttpFoundation\RedirectResponse::__construct()
Commits
-------
b5e6c99a3b [HttpFoundation] Fixed case-sensitive handling of cache-control header in RedirectResponse constructor.
* 3.4:
Fix json-encoding when JSON_THROW_ON_ERROR is used
[HttpFoundation] work around PHP 7.3 bug related to json_encode()
[Security] added support for updated \"distinguished name\" format in x509 authentication
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] add $response->cancel()
| 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 | https://github.com/symfony/symfony-docs/pull/11668
An alternative to #31845 and #31842.
Same as #31831 but considered as a bug fix (at the Contracts level), thus for 4.3.
I think we're early enough since 4.3/1.1 to do it.
That will save us some headaches in the short term.
Commits
-------
c402418723 [HttpClient] add $response->cancel()
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] revert bad logic around JSON_THROW_ON_ERROR
| 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 | -
Same as #31869, reverts #31861
Commits
-------
846116edab [HttpClient] revert bad logic around JSON_THROW_ON_ERROR
we still need to implement Serializable as long as we support PHP < 7.4. otherwise serialized data in php 7.2 would not work anymore when people upgrade to php 7.4
* 4.3:
[Console] Add check for Konsole/Yakuake to disable hyperlinks
[HttpClient] work around PHP 7.3 bug related to json_encode()
[VarDumper] fix dumping the cloner itself
Rename the Symfony Mailer service config to avoid conflict with SwitMailer
Set default crypto method - Fix#31105
[Form] add missing symfony/service-contracts dependency
[HttpClient] Don't throw InvalidArgumentException on bad Location header
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] Don't throw InvalidArgumentException on bad Location header
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31776
| License | MIT
| Doc PR | -
Instead, just stop following redirections and throw a `RedirectionExceptionInterface` as usual when throwing is not disabled.
Commits
-------
4acca42330 [HttpClient] Don't throw InvalidArgumentException on bad Location header
This PR was merged into the 4.3 branch.
Discussion
----------
[Mailer] Set default crypto method
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31105
| License | MIT
| Doc PR | -
This PR fixes#31105 by providing `STREAM_CRYPTO_METHOD_TLS_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT` as default crypto method when none is defined in user options and TLS is enabled.
Commits
-------
4f0ad25fab Set default crypto method - Fix#31105
This PR was squashed before being merged into the 4.3 branch (closes#31849).
Discussion
----------
[Console] Add check for Konsole/Yakuake to disable hyperlinks
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31809
| License | MIT
| Doc PR |
Added check for environment variable set by Konsole and other relateds terminal emulators.
A ticket has been opened to Konsole team to support this feature someday: https://bugs.kde.org/show_bug.cgi?id=408288
Commits
-------
14b27b7d02 [Console] Add check for Konsole/Yakuake to disable hyperlinks
This PR was merged into the 4.3 branch.
Discussion
----------
Rename the Symfony Mailer service implementation to avoid conflict with SwitMailer
| 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 | -
When you install Symfony Mailer as well as SwitMailer and try to typehint MailerInterface, the autowiring alias is aliased to the "mailer" service which is overriden by SwitMailer, thus making the injection fail.
Commits
-------
e7c96d3b43 Rename the Symfony Mailer service config to avoid conflict with SwitMailer
This PR was merged into the 4.3 branch.
Discussion
----------
[VarDumper] fix dumping the cloner itself
| 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 | -
Having PHP references inside the cloner badly breaks it when it finds itself in the dumped graph.
Let's remove this optimization, and skip dumping cloners by default as a bonus.
Commits
-------
3cd56cb018 [VarDumper] fix dumping the cloner itself
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] work around PHP 7.3 bug related to json_encode()
| 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 is the remaining of ##31860 for upper branches.
Commits
-------
42904e34e6 [HttpClient] work around PHP 7.3 bug related to json_encode()
This PR was squashed before being merged into the 4.4 branch (closes#31658).
Discussion
----------
[HTTP Foundation] Deprecate passing argument to method Request::isMethodSafe()
| Q | A
| ------------- | ---
| Branch? | 4.2
| 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 | #31323 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | <!-- required for new features -->
Passing argument to `Request::isMethodSafe()` should have been deprecated in 4.1. As mentionned there: https://github.com/symfony/http-foundation/blob/master/Request.php#L1435-L1452
We also remove Exceptions throwed when you call `Request::isMethodSafe()` or `Request::isMethodSafe(true)`
Commits
-------
59fa1bd127 [HTTP Foundation] Deprecate passing argument to method Request::isMethodSafe()
This PR was merged into the 4.3 branch.
Discussion
----------
[Form] add missing symfony/service-contracts dependency
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31844
| License | MIT
| Doc PR | -
`ResetInterface` is needed by `CachingFactoryDecorator`, which is used in `CoreExtension`, so this is a mandatory dep.
Commits
-------
8639bcca3d [Form] add missing symfony/service-contracts dependency
* 4.3:
Fix inconsistency in json format regarding DST value
changed type hints
do not process private properties from parent class
[HttpClient] fix unregistering the debug buffer when using curl
don't add embedded properties to wrapping class metadata
[Messenger] set amqp content_type based on serialization format
[Mailer] fixed the possibility to set a From header from MessageListener
The `$expected` template seems not to be consistent.
It will change when the DST value is 0 (it'll not have `dst_savings` for
example)
This patch takes care of the issue, by adding proper condition.
Sponsored-by: Platform.sh
This PR was merged into the 4.3 branch.
Discussion
----------
[DoctrineBridge] do not process private properties from parent class
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31715, #31752
| License | MIT
| Doc PR |
Commits
-------
adfa1ef3ce do not process private properties from parent class
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] set amqp content_type based on serialization format
| 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 | #31736
| License | MIT
| Doc PR |
Commits
-------
dee077016d [Messenger] set amqp content_type based on serialization format
This PR was merged into the 4.4 branch.
Discussion
----------
[Security] add MigratingPasswordEncoder
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Split from #31153: the proposed `MigratingPasswordEncoder` is able to validate password using a chain of encoders, and encodes new them using the best-provided algorithm.
This chained encoder is used when the "auto" algorithm is configured. This is seamless for 4.3 app.
Commits
-------
765f14c80e [Security] add MigratingPasswordEncoder
This PR was merged into the 4.4 branch.
Discussion
----------
[Validator] Improve TypeValidator to handle array of types
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31330
| License | MIT
| Doc PR | tbd.
The `@Type` constraint is now able to handle multiple types:
```php
/**
* @var string|array
* @Assert\Type(type={"string", "array"})
*/
private $name;
```
and will pass when `$name` is either of type `string` or `array`.
Commits
-------
c8100f34f8 [Validator] Improve TypeValidator to handle array of types
This PR was merged into the 4.4 branch.
Discussion
----------
[Validator] Add compared value path to violation parameters
| 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 | N/A <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
While it's not really useful to use as a placeholder in the violation message template (compared to hard-coding it into the message. Nor it is really user-friendly),
it becomes handy in conjunction with #29130 for any mapping logic on client-side.
Commits
-------
2da226a57f [Validator] Add compared value path to violation parameters
This PR was merged into the 4.4 branch.
Discussion
----------
Add exception as HTML comment to beginning and end of `exception_full.html.twig`
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Tests pass? | yes
| License | MIT
## Description
Every now and then you are confronted with an exception in Symfony's debug mode. Sometimes, you will see this in your browser console or terminal. To make it easier to easily see what's going on, this change adds a HTML comment on 2 locations:
- between the `<html>` and `<head>` tag;
- between the `</body>` and `</html>` tag.
This way, you don't have to scan the very verbose HTML that Symfony generates. You can quickly glance at the end or the beginning.
## How does it look?
```html
<!-- Notice: Undefined index: payouts in /Volumes/CS/www/src/Generated/GraphQL/Query/TransactionList/Data.php line 33 (500 Internal Server Error) -->
<html>
<head>
<meta charset="UTF-8">
<meta name="robots" content="noindex,nofollow">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title> Notice: Undefined index: payouts in /Volumes/CS/www/src/Generated/GraphQL/Query/TransactionList/Data.php line 33 (500 Internal Server Error)
</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAgCAYAAAABtRhCAAADVUlEQVRIx82XX0jTURTHLYPyqZdefQx66CEo80+aYpoIkqzUikz6Z5klQoWUWYRIJYEUGpQ+lIr9U5dOTLdCtkmWZis3rbnC5fw/neYW002307mX/cZvP3/7o1PwwOdh95x7vnf39zvnd29AgBer2xO6DclAXiMqZAqxIiNIN/IYSUS2BPhjmGATchUxI+ADWiRhpWK7HKuHFVBFdmU5YvnI4grFGCaReF/EBH4KsZlGgj2JBTuCYBWRIYF8YoEOJ6wBt/gEs7mBbyOjQXruPLSdOgPCiEiPSUUHDoL8Ug5IUo9B/d5wrt+G7OAKNrODPuVdB6vRCIzN6SdBlpW9RIgk/1FeAXabzRlrUPVCS/JhbmwudztnGeeH9AyXBIwtmM3wLinZJZHifjHw2V+NBoRh+9ixQrbgbnaSIcl7cGea6hoXQbNe7za241oeO5Z0p42M4BV2EqP2D50wo+6HzvwC6C4sApNOR8cmOrtcnhtj2kYRyC9eBvXzKrBZrXSs72kFd1t3MoKVbMekQkEnSNKOO8fac3LpmK6l1TlGtsxmsdKFsecPYgwxst0cwROMYDXboSotg0WLBRqjY51jLYcENElXwW2XJKPydvoI2GN9T8rBtrAArYIUruBJXkFheCQYlCpQP6uk5dAQFQNaUROMSGVQFxLmkoQsxDJrhLbTZ+nvVsERME9MgPJRKV/58AsyomTSzE813WLFvWK++qI0xSfQl8k8Pg46sYRuv5t6dS+4RqxDwaa4BGjYH+NTQvKScIp9+YL/hoZh3jDtLRHtt2C3g6bmhX+CpsFBWg7ilDSPgj0lD2ncr5ev/BP8VvyAJhqVyZeUhPOrEhEFxgEtjft846Z/guQTNT89Q5P9flMLoth4F7808wKtWWKzAwNQHxrh/1vaid2F+XpYTSbQf1XA2McOmOpROnvpvMEA4tSjq1cW0sws2gCYxswY6TKkvzYnJq1NHZLnRU4BX+4U0uburvusu8Kv8iHY7qefkM4IFngJHEOUXmLEPgiGsI8YnlZILit3vSSLRTQe/MPIZva5pshNIEmyFQlCvruJKXPkCEfmePzkphXHdzZNQdoRI9KPlBAxlj/I8U97ERPS5bjGbWDFbEdqHVe5caTBeZZx2H/IMvzeN15yoQAAAABJRU5ErkJggg==%0A">
<!-- ... clip ... -->
Sfjs.addEventListener(document, 'DOMContentLoaded', function() {
Sfjs.createTabs();
Sfjs.createToggles();
Sfjs.createFilters();
});
/*]]>*/</script>
</body>
</html>
<!-- Notice: Undefined index: payouts in /Volumes/CS/www/src/Generated/GraphQL/Query/TransactionList/Data.php line 33 (500 Internal Server Error) -->
```
Commits
-------
11c8b4531f Add exception as HTML comment to beginning and end of `exception_full.html.twig`
This PR was merged into the 4.3 branch.
Discussion
----------
[Mailer] Fix the possibility to set a From header from MessageListener
| 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 | #31733
| 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
-------
f4254e6f5e [Mailer] fixed the possibility to set a From header from MessageListener
This PR was squashed before being merged into the 4.4 branch (closes#31661).
Discussion
----------
[Translation] refactor ArrayLoader::flatten
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Commits
-------
5b0544691e [Translation] refactor ArrayLoader::flatten
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Add missing BC layer for deprecated ControllerNameParser injections
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Allows removing the `ControllerNameParser` class and corresponding `controller_name_converter` service in 5.0.
Should have been done in 4.1, better late than never.
Commits
-------
1f37275a72 [FrameworkBundle] Add missing BC layer for deprecated ControllerNameParser injections
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] add $response->cancel()
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
(BC break allowed by the `@experimental` annotation)
Canceling a response is already possible but requires registering a progress function and throwing an exception from it. This new method aims at making this much simpler.
/cc @jderusse as we discussed this on Slack.
Commits
-------
549930e820 [HttpClient] add $response->cancel()
This PR was merged into the 4.4 branch.
Discussion
----------
[Form][DX] Improved error message on create a form builder with invalid options
| 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 | -
**before**
> The required option "class" is missing.
**after**
> An error has occurred resolving the options of the form "App\Form\MyEntityType": The required option "class" is missing.
Commits
-------
37c7a2bf09 Improved error message on create a form builder with invalid options
This PR was merged into the 4.4 branch.
Discussion
----------
[Messenger] Add clear Entity Manager middleware
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29662
| License | MIT
| Doc PR | TBD
General purpose of this middleware:
* avoid memory leaks during messages handling
* prevent unexpected side effects when entities that already stored in identity map not refreshed between messages
Commits
-------
6e690a6078 Add clear Entity Manager middleware (closes#29662)
This PR was merged into the 4.4 branch.
Discussion
----------
[TwigBundle] mark TemplateIterator as internal
| 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 | symfony/symfony-docs#... <!-- required for new features -->
This class is an implementation detail and should not be relied on as an extension point. This is also why TemplateCacheWarmer does not typhint this class but iterable. By making it internal we can remove the rootDir argument in #31823
Commits
-------
9b46c17911 [TwigBundle] mark TemplateIterator as internal
* 4.3:
[Translation] Fixed case sensitivity of lint:xliff command
fix type hint for salt in PasswordEncoderInterface
Simplify code - catch \Throwable capture all exceptions
Collect locale details earlier in the process in TranslationDataCollector
fix typo in PR #31802
update italian validator translation
Add missing translations
[TwigBridge] suggest Translation Component when TranslationExtension is used
* 4.2:
[Translation] Fixed case sensitivity of lint:xliff command
fix type hint for salt in PasswordEncoderInterface
Simplify code - catch \Throwable capture all exceptions
fix typo in PR #31802
update italian validator translation
Add missing translations
This PR was squashed before being merged into the 4.2 branch (closes#31786).
Discussion
----------
[Translation] Fixed case sensitivity of lint:xliff command
| Q | A
| ------------- | ---
| Branch? | 4.2
| 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 | -
| License | MIT
| Doc PR | (not needed)
I was checking some errors of `lint:xliff` (https://travis-ci.org/EasyCorp/EasyAdminBundle/jobs/540053551#L657) and saw this:
```
ERROR in src/Resources/translations/EasyAdminBundle.sr_RS.xlf
* There is a mismatch between the language included in the file name ("EasyAdminBundle.sr_RS.xlf") and the "sr-rs" value used in the "target-language" attribute of the file.
ERROR in src/Resources/translations/EasyAdminBundle.zh_CN.xlf
* There is a mismatch between the language included in the file name ("EasyAdminBundle.zh_CN.xlf") and the "zh-cn" value used in the "target-language" attribute of the file.
```
This was suspicious, so I checked the XLIFF standard and it says (http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#target-language):
```
target-language:
Unlike the other XLIFF attributes, the values are not case-sensitive.
```
So, it's valid that `zh-cn` is the target language and `zh-CN` is the file extension. This PR fixes that.
Commits
-------
ec690b2145 [Translation] Fixed case sensitivity of lint:xliff command
This PR was merged into the 4.3 branch.
Discussion
----------
[Translator] Collect locale details earlier in the process
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31600
| License | MIT
| Doc PR | N/A
The [LocaleAwareListener](https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php) class reverts the locale back to the default locale when the request has finished. But the `TranslationDataCollector` only collects the locale in `lateCollect`, which only happens when the kernel terminates. This means the locale is reverted back to the default by the time the collector runs.
The PR moves the `locale` and `fallback_locales` from `lateCollect` to `collect`, so that the information can be captured earlier, before the `LocaleAwareListener` is run.
Commits
-------
5c394eeb79 Collect locale details earlier in the process in TranslationDataCollector
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle][TwigBundle] Add missing deprecations for PHP templating layer
| 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 | -
As part of https://github.com/symfony/symfony/pull/21035 and 7169f4d3e2
Commits
-------
61613d0bf0 Add missing deprecations for PHP templating layer
This PR was merged into the 4.4 branch.
Discussion
----------
[Monolog] Setup the LoggerProcessor after all other processor
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27426
| License | MIT
| Doc PR |
---
This is a bit strange but [`Monolog\Processor::pushProcessor()`](ebb804e432/src/Monolog/Logger.php (L224-L229)) **prepend** the processor to the stack.
Since the Compiler Pass has a low priority, the `DebugProcessor` is always
the last one to be added to the stack, so the first one in it.
Commits
-------
429307d7cf [Monolog] Setup the LoggerProcessor after all other processor
This PR was merged into the 4.3 branch.
Discussion
----------
[TwigBridge] suggest Translation Component when TranslationExtension is used
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31754
| License | MIT
| Doc PR | -
Commits
-------
d4a9e7e639 [TwigBridge] suggest Translation Component when TranslationExtension is used
* 4.3:
[Security\Core] Make SodiumPasswordEncoder validate BCrypt-ed passwords
[Validator] Fix TimezoneValidator default option
[Messenger] Inject RoutableMessageBus instead of bus locator
[DomCrawler] Fix type error with null Form::$currentUri
[Contracts] Fixed typos
do not enable validator auto mapping by default
[HttpClient] remove unused argument
This PR was squashed before being merged into the 4.3 branch (closes#31744).
Discussion
----------
[Validator] Fix TimezoneValidator default option
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| 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 -->
<!--
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
-------
ee71cdbae4 [Validator] Fix TimezoneValidator default option
This PR was merged into the 4.3 branch.
Discussion
----------
[DoctrineBridge][Validator] do not enable validator auto mapping by default
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | part of #31715, #31752
| License | MIT
| Doc PR |
Commits
-------
a3555fc49c do not enable validator auto mapping by default
* 4.3:
Add missed use class for Symfony\Bundle\FrameworkBundle\Test\WebTestCase::$client
[HttpClient] Minor fix in an error message
Fix parameter documentation for Inflector::pluralize() method
Use a more appropriate group when deprecating mode
bumped Symfony version to 4.3.1
updated VERSION for 4.3.0
updated CHANGELOG for 4.3.0
[FrameworkBundle] fix test fixture using deprecated controller and add missing deprecation
[FrameworkBundle] Add a validation on the messenger section
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpKernel] Make DebugHandlersListener internal
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Required to remove the legacy `Event` argument type declaration from its `configure()` method in 5.0.
Unlocks #31689
Commits
-------
1a8db293c6 [HttpKernel] Make DebugHandlersListener internal
This PR was squashed before being merged into the 4.3 branch (closes#31719).
Discussion
----------
Add missed use class for Symfony\Bundle\FrameworkBundle\Test\WebTestCase::$client
| 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 -->
In `Symfony\Bundle\FrameworkBundle\Test\WebTestCase::$client` property exists phpdoc about property class, but no `use` declaration added.
As `Symfony\Bundle\FrameworkBundle\Client` deprecated, and actually this will be `Symfony\Bundle\FrameworkBundle\KernelBrowser` instance, we can put `KernelBrowser` instead `Client` (not sure about BC)
<!--
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 the master branch.
-->
Commits
-------
6982025e3a Add missed use class for Symfony\Bundle\FrameworkBundle\Test\WebTestCase::$client
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] Minor fix in an error message
| 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 | -
| License | MIT
| Doc PR | -
Fixes this:
![image](https://user-images.githubusercontent.com/73419/58624608-e9de9e00-82d0-11e9-9558-3f52388f1531.png)
Commits
-------
2da9e3f717 [HttpClient] Minor fix in an error message
This PR was merged into the 4.4 branch.
Discussion
----------
Marked several components as incompatible with EventDispatcher 5
| 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
Quite a few components still use the old event class that is to be removed in Symfony 5. This PR ensures that they are only installed with EventDispatcher 4.
Follow up to #31709
Commits
-------
e6a4526fa3 Marked several components as incompatible with EventDispatcher 5.
The deprecation comes from a vendor: the phpunit bridge itself, so it's
either the direct or the indirect group. And since only the end user is
supposed to set the group, then this is supposed to be a direct
deprecation.
This PR was merged into the 4.4 branch.
Discussion
----------
[TwigBridge] Swapped $rootDir and $fileLinkFormatter arguments in DebugCommand
| 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 | -
This is necessary to remove the `$rootDir` in 5.0, see https://github.com/symfony/symfony/pull/31667
Commits
-------
beca8642ca exchanged $rootDir and $fileLinkFormatter arguments in DebugCommand
This PR was merged into the 4.3 branch.
Discussion
----------
[FrameworkBundle] Add a validation on the messenger section
| 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
| Tests pass? | yes
| Fixed tickets | #31624 <!-- #-prefixed issue number(s), if any -->
| 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 the master branch.
-->
Commits
-------
36f16e8461 [FrameworkBundle] Add a validation on the messenger section
* 4.3:
[Intl] Improve the error message when country code is wrong
Fix tests
[Intl][4.3] Cleanup internal api
[HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping
bumped Symfony version to 4.2.10
updated VERSION for 4.2.9
updated CHANGELOG for 4.2.9
Use AsserEquals for floating-point values
* 4.2:
[HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping
bumped Symfony version to 4.2.10
updated VERSION for 4.2.9
updated CHANGELOG for 4.2.9
Use AsserEquals for floating-point values
This PR was merged into the 4.3 branch.
Discussion
----------
Fix tests
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| 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 | #31638
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Commits
-------
733f017904 Fix tests
* 4.3:
bumped Symfony version to 4.3.0
updated VERSION for 4.3.0-RC1
updated CHANGELOG for 4.3.0-RC1
Create an abstract HTTP transport and extend it in all HTTP transports
Updated "experimental" annotations for 4.3
Currently BinaryFileResponse, when configured with X-Accel-Redirect sendfile type,
will only substitute file paths specified in X-Accel-Mapping. But if the provided
file path does not have a defined prefix, then the resulting header will include
the absolute path. Nginx expects a valid URI, therefore this will result in an
issue that is very hard to detect and debug as it will not show up in error logs
and instead the request would just hang for some time and then be re-served
without query parameters(?).
This PR was merged into the 4.3 branch.
Discussion
----------
Create an abstract HTTP transport and extend it in all HTTP transports
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | no
| License | MIT
| Doc PR | no
Right now when you try to use an HTTP transport e.g. Mailgun w/o HTTP client installed - the error message is:
> Attempted to load class "HttpClient" from namespace "Symfony\Component\HttpClient".
Did you forget a "use" statement for "Http\Client\HttpClient"?
Not clear enough about what to do. After this PR the error message will be:
> You cannot use "Symfony\Component\Mailer\Bridge\Mailgun\Http\MailgunTransport" as the HttpClient component is not installed. Try running "composer require symfony/http-client".
Actually, we already have a similar check for API:
2c9a1960a1/src/Symfony/Component/Mailer/Transport/Http/Api/AbstractApiTransport.php (L37-L44)
Commits
-------
3c8d63ca82 Create an abstract HTTP transport and extend it in all HTTP transports
Use AssertEquals for these two specific case will do a better job,
since it'll convert both '0.1' and result of `getContent()` into PHP's
internal representation of floating-point and compares them and it should be fine.
Using `AssertSame` for this tests brings floating-point serialization
into consideration which of course will be php.ini specific.
In order not missing the type assertion point that `AssertSame` does,
we also perform `assertInternalType('string'...`
Sponsored-by: Platform.sh
* 4.3:
[HttpClient] make $response->getInfo('debug') return extended logs about the HTTP transaction
fix typo
Fixes a small doc blocks syntax error
Small grammar mistake in documentation
[Messenger] Use real memory usage for --memory-limit
[Workflow] Do not trigger extra guard
* 4.2:
fix typo
Fixes a small doc blocks syntax error
Small grammar mistake in documentation
[Messenger] Use real memory usage for --memory-limit
[Workflow] Do not trigger extra guard
This PR was merged into the 3.4 branch.
Discussion
----------
FragmentListener - fix typo in annotation
| 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 |
Just a small typo I've found in fragment listener :)
Commits
-------
b6ff836a49 fix typo
* 4.3:
[Messenger] Disable the SchemaAssetsFilter when setup the transport
[Messenger] Fix missing auto_setup for RedisTransport
[Contracts] split in one package per sub-contracts
This PR was merged into the 4.3 branch.
Discussion
----------
[Contracts] split in one package per sub-contracts
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31567
| License | MIT
| Doc PR | -
Commits
-------
f410691842 [Contracts] split in one package per sub-contracts
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] Disable the SchemaAssetsFilter when setup the transport
| 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 | #31623
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Commits
-------
8cbb8f89ad [Messenger] Disable the SchemaAssetsFilter when setup the transport
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] Fix missing auto_setup for RedisTransport
| 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
Should be my last PR for messenger 4.3's Redis transport :)
Not having it makes it inconsistent with other transports and is especially annoying in tests.
Commits
-------
d27bc2a87d [Messenger] Fix missing auto_setup for RedisTransport
This PR was merged into the 3.4 branch.
Discussion
----------
[Workflow] Do not trigger extra guards
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31582
| License | MIT
| Doc PR |
---
With this patch, guards are executed only on wanted transitions
**Note for merger**: This is already fixed (in a different manner) in 4.2, So this patch should not be included in 4.2, instead take: #31585 or discard changes of Workflow class but keep tests
Commits
-------
ad0619748e [Workflow] Do not trigger extra guard
* 4.3:
[github] Implement the new security policy.
[Finder] fix wrong method call casing
Make tempfile path unique
minor: fix phpdocs in the ldap component
[Process] Fix infinite waiting for stopped process
Use absolute URL for when the profiler's domain differs from the controller's domain which initialises the profiler.
fix phpdoc
[DI] fix using bindings with locators of service subscribers
* 4.2:
[github] Implement the new security policy.
[Finder] fix wrong method call casing
Make tempfile path unique
minor: fix phpdocs in the ldap component
[Process] Fix infinite waiting for stopped process
Use absolute URL for when the profiler's domain differs from the controller's domain which initialises the profiler.
fix phpdoc
[DI] fix using bindings with locators of service subscribers
* 3.4:
[github] Implement the new security policy.
[Finder] fix wrong method call casing
Make tempfile path unique
minor: fix phpdocs in the ldap component
[Process] Fix infinite waiting for stopped process
Use absolute URL for when the profiler's domain differs from the controller's domain which initialises the profiler.
fix phpdoc
[DI] fix using bindings with locators of service subscribers
* 4.3: (22 commits)
[Messenger] Fix incorrect error when symfony/serializer is missing
Allow WrappedListener to describe uncallable listeners.
[HttpClient] fix handling exceptions thrown before first mock chunk
[Filesystem] fix wrong method call casing
[HttpClient] fix test
[Translation] Fixed issue with new vs old TranslatorInterface in TranslationDataCollector
Don't reference symfony/security
[HttpClient] display proper error message on TransportException when curl is used
[FrameworkBundle] fix named autowiring aliases for TagAwareCacheInterface
[Cache] improve logged messages
[FrameworkBundle] improve cs
[Mime][HttpFoundation] Added mime type audio/x-hx-aac-adts
bumped Symfony version to 4.3.0
updated VERSION for 4.3.0-BETA2
updated CHANGELOG for 4.3.0-BETA2
[HttpClient] Only use CURLMOPT_MAX_HOST_CONNECTIONS & CURL_VERSION_HTTP2 if defined
[Security] fixed a fatal error when upgrading from 4.2
[HttpClient] Allow arrays as query parameters
Throws UnrecoverableMessageHandlingException when passed invalid entity manager name for Doctrine middlewares
[Messenger] Make redis Connection::get() non blocking by default
...
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] fix handling exceptions thrown before first mock chunk
| 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 | -
Discovered while fixing a 60s timeout on a test case, which this fixes too.
Commits
-------
812b0172f4 [HttpClient] fix handling exceptions thrown before first mock chunk
This PR was merged into the 4.3 branch.
Discussion
----------
Allow WrappedListener to describe uncallable listeners
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31493
| License | MIT
| Doc PR | N/A
This is a follow-up to #31493. The previous PR did not fix the problem completely. We also need to make sure that a listener that is not callable is not passed to `Closure::fromCallable()`.
Note: It would probably be a good idea to give the developer a hint about uncallable listeners. Currently, such a listener causes an exception at the worst possible point of time: when collecting the profile information. This breaks the toolbar without any helpful feedback, as I've described [here](https://github.com/symfony/symfony/pull/31493#issuecomment-492921480).
This PR allows the `WrappedListener` class to describe a listener for the profiler even if the listener is not callable, which was the behavior in Symfony 4.2.
Commits
-------
bc3f598bfe Allow WrappedListener to describe uncallable listeners.
Every now and then you are confronted with an exception in Symfony's debug mode. Sometimes, you will see this in your browser console or terminal. To make it easier to easily see what's going on, this change adds a HTML comment on 2 locations:
- before the `<html>` tag;
- after the `</html>` tag.
This way, you don't have to scan the very verbose HTML that Symfony generates. You can quickly glance at the end or the beginning.
The temp-file that the test currently creates is `/tmp/log`.
This may exist on many platforms already (including `platform.sh` app containers).
With the proposed patch way the collision will be less likely.
Sponsored-by: Platform.sh
This PR was merged into the 4.3 branch.
Discussion
----------
[FrameworkBundle] fix named autowiring aliases for TagAwareCacheInterface
| 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 | -
Doing a demo today, I realized that named autowiring aliases are missing for `TagAwareCacheInterface`, and that existing ones point to the wrong service. Here is the fix.
Commits
-------
d9082c2ae4 [FrameworkBundle] fix named autowiring aliases for TagAwareCacheInterface
This PR was merged into the 4.3 branch.
Discussion
----------
[Cache] improve logged messages
| 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 was improved already in #31395, but the patch was incomplete.
This PR fixes this.
Commits
-------
257f3f176e [Cache] improve logged messages
This PR was merged into the 3.4 branch.
Discussion
----------
[WebProfilerBundle] Use absolute URL for profiler links
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | n/a
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Generate absolute URL's so you can have a different (sub)domain for the profiler and the controller that uses it.
Also uses the link which the controller generated instead of always generating a new link in Twig. The changes shouldn't inpact normal behavior.
Commits
-------
13ee1fa2b7 Use absolute URL for when the profiler's domain differs from the controller's domain which initialises the profiler.
This PR was squashed before being merged into the 4.4-dev branch (closes#31437).
Discussion
----------
[Cache] Add Redis Sentinel support
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | symfony/symfony-docs#11545
This change adds support for Redis Sentinel clusters to the Cache component Redis adapter.
The DSN format is syntactically equivalent to cluster support, but adds a new parameter `redis_sentinel` that should be set to the sentinel service name.
This support requires the use of predis as the underlying connection library. The redis extension does not support sentinel at this time.
Commits
-------
80e8b21525 [Cache] Add Redis Sentinel support
This PR was merged into the 3.4 branch.
Discussion
----------
[DI] fix using bindings with locators of service subscribers
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Spotted during the workshop in Sao Paulo, with @tsantos84, @andreia and others :)
Commits
-------
7146b95303 [DI] fix using bindings with locators of service subscribers
This PR was squashed before being merged into the 3.4 branch (closes#31568).
Discussion
----------
[Process] Fix infinite waiting for stopped process
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31548
| License | MIT
### Description
Add a regression test `Symfony\Component\Process\Tests\ProcessTest:testWaitStoppedDeadProcess` to reproduce the related bug #31548 . It consists of one file `ErrorProcessInitiator.php`, which executes as another process because otherwise if `Process::wait()` goes in an infinite loop (which is test checks) it will be impossible to handle it and stop test correctly.
The second commit contains bug fix, which is only `$this->checkTimeout();` call, that prevents infinite loop.
Commits
-------
6b9ee1e1c5 [Process] Fix infinite waiting for stopped process
This PR was merged into the 4.4-dev branch.
Discussion
----------
[DI] deprecate short callables in yaml
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/11589
This deprecates defining factories as `foo:method` instead of `['@foo', 'method']` in yaml.
This is confusing syntax and misses the opportunity to raise an error when one does a typo and uses a single colon instead of two.
This basically reverts #19190
Commits
-------
f8a04fdda6 [DI] deprecate short callables in yaml
- CURLMOPT_MAX_HOST_CONNECTIONS is available since PHP 7.0.7 and cURL 7.30.0
- CURL_VERSION_HTTP2 is available since PHP 5.5.24 and 5.6.8 and cURL 7.33.0
This PR was merged into the 4.3 branch.
Discussion
----------
[Ldap] add a test on parsing the rdn
| 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 | none <!-- #-prefixed issue number(s), 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):
- 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 the master branch.
-->
One more test on the rdn directly.
- [x] When #31552 has been merged this one needs to be rebased.
Commits
-------
0abe32b085 [Ldap] add a test on parsing the rdn
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger][DoctrineBridge] Throws UnrecoverableMessageHandlingException when passed invalid entity manager name
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | not sure
| Deprecations? | no
| Tests pass? | Waiting for Travis
| Fixed tickets | -
| License | MIT
| Doc PR | -
1. Throws `UnrecoverableMessageHandlingException` and do not retry messages if middlewares missconfigured
2. `getManager()` doesn't return null. Actually [it throws](https://github.com/doctrine/persistence/blob/master/lib/Doctrine/Persistence/AbstractManagerRegistry.php#L144-L160) `\InvalidArgumentException` in requested entity manager not exists.
Not sure, should this changes considered as BC-break.
Also I can extract abstract Doctrine middleware but not sure what branch should I use for it? Master or 4.3?
Commits
-------
c4eca27149 Throws UnrecoverableMessageHandlingException when passed invalid entity manager name for Doctrine middlewares
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] Add "non sendable" stamps
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31460
| License | MIT
| Doc PR | not needed
Fixes a bug where Symfony serialization of the AmqpReceivedStamp sometimes caused problems.
It's still a mystery why the `AmqpReceivedStamp` caused a segfault *sometimes* when going through the Symfony serializer or the `VarDumper`. But, that stamp really didn't need to be sent on redelivery anyways.
I don't love making the removal the responsibility of the serializers, but it didn't work well anywhere else.
Cheers!
Commits
-------
34e7781c5c Adding a new NonSendableStampInterface to avoid sending certain stamps
* 4.3: (23 commits)
minor: add some test in the ldap component
[Workflow] Update MethodMarkingStore
[Bridge\ProxyManager] isProxyCandidate() does not take into account interfaces
adding experimental note
[HttpClient] add missing argument check
[Messenger] Fix undefined index on read timeout
[Workflow] use method marking store
[Routing][AnnotationClassLoader] fix utf-8 encoding in default route name
fixed a phpdoc
[Debug] Wrap call to require_once in a try/catch
[EventDispatcher] Removed "callable" type hint from WrappedListener constructor
prevent deprecation when filesize matches error code
[PropertyInfo] Add missing documentation link in Readme
Use the current working dir as default first arg in 'link' binary
Respect parent class contract in ContainerAwareDoctrineEventManager
[WebProfilerBundle][Form] The form data collector return serialized object when profiler bundle attends object
[Validator] Add the missing translations for the Danish ("da") locale
[PropertyAccess] Add missing property to PropertyAccessor
[Cache] fix saving unrelated keys in recursive callback calls
[Serializer] Fix denormalization of object with variadic constructor typed argument
...
* 4.2:
minor: add some test in the ldap component
[Bridge\ProxyManager] isProxyCandidate() does not take into account interfaces
[Routing][AnnotationClassLoader] fix utf-8 encoding in default route name
fixed a phpdoc
[Debug] Wrap call to require_once in a try/catch
prevent deprecation when filesize matches error code
[PropertyInfo] Add missing documentation link in Readme
Use the current working dir as default first arg in 'link' binary
Respect parent class contract in ContainerAwareDoctrineEventManager
[Validator] Add the missing translations for the Danish ("da") locale
[PropertyAccess] Add missing property to PropertyAccessor
[Cache] fix saving unrelated keys in recursive callback calls
[Serializer] Fix denormalization of object with variadic constructor typed argument
Allow set 'None' on samesite cookie flag
Making cache rebuild correctly with MessageSubscriberInterface return values
Fix finding parent definition
* 3.4:
minor: add some test in the ldap component
[Bridge\ProxyManager] isProxyCandidate() does not take into account interfaces
[Routing][AnnotationClassLoader] fix utf-8 encoding in default route name
fixed a phpdoc
[Debug] Wrap call to require_once in a try/catch
[PropertyInfo] Add missing documentation link in Readme
Use the current working dir as default first arg in 'link' binary
Respect parent class contract in ContainerAwareDoctrineEventManager
[Validator] Add the missing translations for the Danish ("da") locale
[Serializer] Fix denormalization of object with variadic constructor typed argument
Allow set 'None' on samesite cookie flag
This PR was merged into the 3.4 branch.
Discussion
----------
[Ldap] add a test to getResources and binding
| Q | A
| ------------- | ---
| Branch? | 3.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 | none <!-- #-prefixed issue number(s), 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):
- 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 the master branch.
-->
We could add more unit tests, but this is a beginning.
Commits
-------
d08f195502 minor: add some test in the ldap component
This PR was squashed before being merged into the 4.3 branch (closes#31536).
Discussion
----------
[Workflow] Update MethodMarkingStore
| Q | A
| ------------- | ---
| Branch? | 4.3 (related to deprecation of single/multiple marking store)
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | .
| License | MIT
| Doc PR | already documented
Minor fix
Commits
-------
c8636523d3 [Workflow] Update MethodMarkingStore
This PR was merged into the 4.3 branch.
Discussion
----------
[Workflow] use method marking store
| Q | A
| ------------- | ---
| Branch? | 4.3 (related to deprecation of single/multiple marking store)
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | .
| License | MIT
| Doc PR | already documented
I think the deprecation of old marking store, the single one in the statemachine, was not patched here
Or did i miss something?
Thank you
Cc @lyrixx
Commits
-------
a2191678b7 [Workflow] use method marking store
This PR was merged into the 4.3 branch.
Discussion
----------
[Mailer] adding experimental disclaimer in readme
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Mailer Component is marked as experimental in code, but not in readme.
got confused while checking the readme files of the new components
Commits
-------
5175f6fffc adding experimental note
When using factories it's common best practice to use interface as class name, especially in cases
where you know impl can differ. Before this fix ProxyManager did not allow these to be lazy.
In our case this has lead several to hard to debug issues on classes we need to mark as lazyi
and often a need to add lazy on decorators if there are any or other workarounds.
As we have had this issue, and still have on both 2.8 and 3.4 this is opened against 2.8.
This PR was merged into the 3.4 branch.
Discussion
----------
[Doctrine] Respect parent class contract in ContainerAwareEventManager
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes, failures looks unrelated
| Fixed tickets | #31051
| License | MIT
| Doc PR | -
According to method signature of [original EventManager](https://github.com/doctrine/event-manager/blob/master/lib/Doctrine/Common/EventManager.php#L50) `getListeners` method should return array of initialized objects but now it returns array of strings of listener service names.
Commits
-------
42d62721fd Respect parent class contract in ContainerAwareDoctrineEventManager
This PR was squashed before being merged into the 3.4 branch (closes#31421).
Discussion
----------
[Routing][AnnotationClassLoader] fix utf-8 encoding in default route name
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
If controller, or one of its methods, contain a unicode character and you run:
```
./bin/console debug:router
```
you get this:
![Zrzut ekranu 2019-05-8 o 14 00 48](https://user-images.githubusercontent.com/35422131/57374545-71863080-719b-11e9-999e-fe0a5051c089.png)
This PR fixes it into this:
![Zrzut ekranu 2019-05-8 o 14 00 59](https://user-images.githubusercontent.com/35422131/57374616-92e71c80-719b-11e9-9d13-5370213c22f7.png)
Commits
-------
7ab52d3c36 [Routing][AnnotationClassLoader] fix utf-8 encoding in default route name
This PR was merged into the 4.3 branch.
Discussion
----------
[EventDispatcher] Removed "callable" type hint from WrappedListener constructor
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
### The problem
```php
public function __construct(callable $listener, ?string $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
```
The *callable* type hint will cause the following exception if you register a listener class with a method, which could not be auto-guessed by the Symfony:
`Argument 1 passed to Symfony\Component\EventDispatcher\Debug\WrappedListener::__construct() must be callable, array given`
The debug toolbar will not be displayed in this case.
This is because PHP is checking the array first before making a decision if this is a valid callable or not. So if the second array element does not represent an existing method in object from the first element - PHP will treat this as a common array, not callable. Use `is_callable` method if you need a proof.
### How to reproduce
1. Register some listener with a method, which could not be auto-guessed by Symfony
2. Do not create the `__invoke` method in the listener
3. Skip the `method` attribute in the listener configuration
Example:
```php
class SomeListener
{
public function myListenerMethod(SomeEvent $event)
{
// ...
}
}
```
```yaml
App\EventListener\SomeListener:
tags:
-
name: kernel.event_listener
# Symfony will look for "onSomeEvent" method which does not exists.
event: 'some.event'
#method: 'myListenerMethod' # Skip this.
```
### Solution:
Removing the type hint will cause the \Closure::fromCallable() method to throw a proper exception, for example:
`Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Failed to create closure from callable: class 'App\EventListener\SomeListener' does not have a method 'onSomeEvent'`
Commits
-------
20c587fc23 [EventDispatcher] Removed "callable" type hint from WrappedListener constructor
This PR was merged into the 4.3 branch.
Discussion
----------
[WebProfilerBundle][Form] The form data collector return serialized data
| 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 | #31476 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | not needed <!-- 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 the master branch.
-->
This bug occurs because at some point the FormDataCollector was returning serialized data, this has been changed in the upcoming branches but it seems that the bug occurs when using different version of the form component and the WebProfilerBundle.
This bugfix add a conflict param on the WebProfilerBundle to avoid using version of the form component who still serialize the data.
Commits
-------
70fdafd79f [WebProfilerBundle][Form] The form data collector return serialized object when profiler bundle attends object
If the included file contains an error, it hides the real error. This
makes debugging harder.
How to reproduce:
```
composer create-project symfony/skeleton symfony-3.4 3.4
cd symfony-3.4
composer req monolog
```
Add to `monolog.yaml`:
```yaml
elasticsearch:
type: "elasticsearch"
elasticsearch:
host: 'elasticsearch'
port: '9200'
index: 'ep_php_logs_dev'
level: 'debug'
tags: 'monolog.logger'
channels: ['!event']
```
This will fail because the the \Elastica\Client class does not exist.
But this error will be hidden by the `ClassNotFoundFatalErrorHandler`
because it will try to load the `Symfony\Component\Kernel\Client` and
this class extends `Symfony\Component\BrowserKit\Client`. The last one
is a soft dependency...
---
Before
```
Fatal error: Uncaught Error: Class 'Symfony\Component\BrowserKit\Client' not found in /tmp/symfony-3.4/vendor/symfony/http-kernel/Client.php:31
```
After:
```
Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "Client" from namespace "Elastica".
Did you forget a "use" statement for another namespace? in /tmp/symfony-es/var/cache/dev/ContainerWXN4mS9/srcApp_KernelDevDebugContainer.php:303
```
* origin/4.3:
deprecate calling createChildContext without the format parameter
[EventDispatcher] Fix interface name used in error messages
[FrameworkBundle] Add cache configuration for PropertyInfo
Update dependencies in the main component
Drop useless executable bit
[Doctrine][PropertyInfo] Detect if the ID is writeable
Add transport in subscriber's phpdoc
[Validator] Autovalidation: skip readonly props
[DI] default to service id - *not* FQCN - when building tagged locators
[Cache] Log a more readable error message when saving into cache fails
Update WorkflowEvents.php
[Messenger] On failure retry, make message appear received from original sender
[Messenger] remove send_and_handle option which can be achieved with SyncTransport
Fixing tests - passing pdo is not wrapped for some reason in dbal
Changing how RoutableMessageBus fallback bus works
[Serializer] Fix BC break: DEPTH_KEY_PATTERN must be public
[FrameworkBundle] Fixed issue when a parameter container a '%'
Fix the interface incompatibility of EventDispatchers
[TwigBundle] fixed Mailer integration in Twig
[Form] Add intl/choice_translation_locale option to TimezoneType
This PR was merged into the 4.3 branch.
Discussion
----------
Fix the interface incompatibility of EventDispatchers
The `LegacyEventDispatcherProxy` now implements the full
`EventDispatcherInterface` from the `EventDispatcherBundle`.
Before it just implemented the Interface from the `Contracts` Bundle,
that made it incompatible with the `WrappedListener`.
This fixes#31457.
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31457
| License | MIT
| Doc PR | /
Commits
-------
bdeeae1510 Fix the interface incompatibility of EventDispatchers
This PR was merged into the 4.3 branch.
Discussion
----------
[DI] default to service id - *not* FQCN - when building tagged locators
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
While reviewing #30926 I realized that defaulting to the FQCN is a shortcut that isn't useful enough.
Defaulting to the service id provides the same experience in practice because service ids are FQCN by default.
But when they aren't, the service id is the proper index to default to when building the locator.
Commits
-------
52e827c9cf [DI] default to service id - *not* FQCN - when building tagged locators
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] Add `from_transport` in subscriber's phpdoc
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | ø
| BC breaks? | ø
| Deprecations? | ø
| Tests pass? | yes
| Fixed tickets | #30958
| License | MIT
| Doc PR | ø
Add the `from_transport` to the subscriber's phpdoc as it was missed from the original PR.
Commits
-------
6a542cd738 Add transport in subscriber's phpdoc
This PR was merged into the 4.3 branch.
Discussion
----------
[Form] Add intl/choice_translation_locale option to TimezoneType
| Q | A
| ------------- | ---
| Branch? | master
| 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 | #28836
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/issues/11503
final step :)
for now i think any form of grouping is a user concern (i.e. by GMT offset or area name); see #31293 + #31295
having a special built in `group_by' => 'gmt_offset'` util would be nice, and can be done in the future.
includes #31434
Commits
-------
001b930611 [Form] Add intl/choice_translation_locale option to TimezoneType
This PR was squashed before being merged into the 4.3 branch (closes#31452).
Discussion
----------
[FrameworkBundle] Add cache configuration for PropertyInfo
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? |
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
The PropertyInfoExtractor was not cached by default but the class to do it was surprisingly here, unused.
I've added the configuration to enable it by default when it's not the development environment.
I haven't added the warmup part because there are too much arguments for the methods (class, property, context).
It will be a big boost for the performance! For this code:
```php
$book = $this->serializer->deserialize('{"id":3,"reviews":[{"id": 7, "body": "This book is fantastic!", "rating": 9, "letter": "A", "publicationDate": "2019"}],"isbn":"978-0-5533-9243-2","title":"Fool\'s Assassin","description":"A famous saga","author":"Robin Hobb","publicationDate":"2014"}', Book::class, 'json');
$this->serializer->serialize($book, 'json');
```
We obtain this:
![image](https://user-images.githubusercontent.com/10920253/57487994-2874d000-72b2-11e9-92a2-28b14a038194.png)
The Blackfire comparison is here: https://blackfire.io/profiles/compare/2c746d26-320a-4aab-80ef-7276c2e92b96/graph
Commits
-------
17f6225d0f [FrameworkBundle] Add cache configuration for PropertyInfo
This PR was merged into the 4.3 branch.
Discussion
----------
[Doctrine][PropertyInfo] Detect if the ID is writeable
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes/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
Companion of #31481. Allows to detect that ids with a generated value aren't writable (because the DBMS will generate the ID by itself). It could be considered as a bug fix or as a new feature. I prefer to not merge in in 3.4. However, it becomes necessary for autovalidation to work with such entities, so it should be in 4.3:
```php
/**
* @Entity
*/
class Foo
{
/**
* @Id
* @GeneratedValue(strategy="AUTO")
* @Column(type="integer")
*/
public $id;
}
```
Commits
-------
4598235192 [Doctrine][PropertyInfo] Detect if the ID is writeable
This PR was merged into the 4.3 branch.
Discussion
----------
[Validator] Autovalidation: skip readonly props
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| 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 | n/a
| License | MIT
| Doc PR | n/a
Read-only properties (such as an autogenerated ID) must be skipped during the validation (it makes no sense to validate a RO property anyway).
This is an allowed BC break because this feature will be introduced in 4.3.
Commits
-------
e7dc5e1045 [Validator] Autovalidation: skip readonly props
This PR was merged into the 4.3 branch.
Discussion
----------
[FrameworkBundle] Fixed issue when a parameter contains a '%'
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31431
| License | MIT
| Doc PR |
---
On my computer:
```
dump(get_cfg_var('xdebug.file_link_format'));
"subl://%f:%l"
```
When I ran `bin/console debug:config framework` I got this exception:
```
In ParameterBag.php line 100:
[Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
The parameter "templating.helper.code.file_link_format" has a
dependency on a non-existent parameter "f:".
Exception trace:
() at
/home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:100
...
```
This issue was introduced [here](https://github.com/symfony/symfony/pull/27684/files#diff-b3847149480405e1de881530b4c75ab5L212) / cc @ro0NL
This PR does not really fix the issue: I'm able to debug the config, The
the `debug:container --env-vars` does not work anymore. How could we fix
both issue? cc @nicolas-grekas
Commits
-------
7bcd714381 [FrameworkBundle] Fixed issue when a parameter container a '%'
This PR was merged into the 4.3 branch.
Discussion
----------
[Cache] Log a more readable message when trying to cache an unsupported type
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #29710 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR |
Improved the warning risen when trying to save something that has a non-supported type in the Simple cache.
For instance, let's say the following code:
```php
class TestCommand extends Command
{
private $cache;
public function __construct(CacheInterface $cache)
{
parent::__construct();
$this->cache = $cache;
}
// ...
protected function execute(InputInterface $input, OutputInterface $output)
{
$n = $this->cache->get('n', function () {
return function () {
return rand(0,10);
};
});
dump($n());
}
}
```
Running this code will give the following:
```
14:32:03 WARNING [cache] Could not save key "n" in cache: the Closure type is not supported.
0
```
Commits
-------
21ba3c07a0 [Cache] Log a more readable error message when saving into cache fails
This PR was squashed before being merged into the 3.4 branch (closes#31438).
Discussion
----------
[Serializer] Fix denormalization of object with variadic constructor typed argument
| Q | A
| ------------- | ---
| Branch? | 3.4 up to 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31436
| License | MIT
This PR adds a test to demonstrate the bug, and a fix to squash it.
Commits
-------
c8c3c56cc8 [Serializer] Fix denormalization of object with variadic constructor typed argument
This PR was merged into the 4.2 branch.
Discussion
----------
[Messenger] Making cache rebuild correctly when message subscribers change
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31409
| License | MIT
| Doc PR | not needed
An edge-case that's identical to `EventSubscriberInterface`: when the return value of `getHandledMessages()` changes, the container needs to be rebuilt.
If you're wondering why these checks aren't in their own resource class, see #25984 - it's something we probably should do, but haven't done yet.
Commits
-------
d88446be07 Making cache rebuild correctly with MessageSubscriberInterface return values
This PR was merged into the 4.2 branch.
Discussion
----------
[Validator] Fix finding translator parent definition in compiler pass
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Method `ChildDefintion::getParent()` returns a string, but here it is expected to return an object of class `Definition` in order to call `getClass` on it in the loop.
Commits
-------
d261bb5dd1 Fix finding parent definition
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] remove send_and_handle which can be achieved with SyncTransport
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | yes/no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks? | yes <!-- 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 | https://github.com/symfony/symfony-docs/issues/11236
The send_and_handle option is pretty awkward and we don't need it anymore because the same thing can be achieved with the SyncTransport from #30759
So the following example from the doc in https://symfony.com/doc/current/messenger.html#routing
```yaml
framework:
messenger:
routing:
'My\Message\ThatIsGoingToBeSentAndHandledLocally':
senders: [amqp]
send_and_handle: true
```
is the same as
```yaml
framework:
messenger:
routing:
'My\Message\ThatIsGoingToBeSentAndHandledLocally':
senders: [amqp, sync]
```
https://github.com/symfony/symfony/pull/31401#pullrequestreview-235396370
Commits
-------
4552b7f5b2 [Messenger] remove send_and_handle option which can be achieved with SyncTransport
This PR was squashed before being merged into the 4.3 branch (closes#31425).
Discussion
----------
[Messenger] On failure retry, make message appear received from original sender
| Q | A
| ------------- | ---
| Branch? | master (4.3)
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31413
| License | MIT
| Doc PR | symfony/symfony-docs#11236
Fixes a bug when using the transport-based handler config from #30958. This also adds a pretty robust integration test that dispatches a complex message with transport-based handler config, failures, failure transport, etc - and verifies the correct behavior.
Cheers!
Commits
-------
80b5df270f [Messenger] On failure retry, make message appear received from original sender
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] Fix routable message bus default bus
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | not needed
In #31288, we gave the `RoutableMessageBus` a "default" bus. We did that by using the `MessageBusInterface` service in the locator. But, no such service exists - I think that was just a huge oversight (and maybe @dirk39 named a bus this in the project he was testing on?). The services in the locator are very simply the keys under `framework.messenger.buses` or the default, which is a single `messenger.bus.default` id. There is an alias in the container for `MessageBusInterface`, but this is not added to the locator (and adding it would be a bit awkward, as `MessengerPass` is in the component and the interface alias is entirely a framework thing).
Cheers!
Commits
-------
42e0536d8f Changing how RoutableMessageBus fallback bus works
On my computer:
```
dump(get_cfg_var('xdebug.file_link_format'));
"subl://%f:%l"
```
When I ran `bin/console debug:config framework` I got this exception:
```
In ParameterBag.php line 100:
[Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
The parameter "templating.helper.code.file_link_format" has a
dependency on a non-existent parameter "f:".
Exception trace:
() at
/home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:100
...
```
This issue was introduced
[here](https://github.com/symfony/symfony/pull/27684/files#diff-b3847149480405e1de881530b4c75ab5L212)
The `LegacyEventDispatcherProxy` now implements the full
`EventDispatcherInterface` from the `EventDispatcherBundle`.
Before it just implemented the Interface from the `Contracts` Bundle,
that made it incompatible with the `WrappedListener`.
This fixes#31457.
This PR was merged into the 4.3 branch.
Discussion
----------
[TwigBundle] Fix Mailer integration in Twig
| 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 | #31449
| 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 the master branch.
-->
Commits
-------
53b68afec4 [TwigBundle] fixed Mailer integration in Twig
This PR was merged into the 4.3 branch.
Discussion
----------
[DomCrawler] fix HTML5 parser integration
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Spotted while reviewing #30892
The current logic is context-dependent: by changing the order of calls, you can get different behaviors.
Commits
-------
ba83bdadb1 [DomCrawler] fix HTML5 parser integration
This PR was merged into the 4.3 branch.
Discussion
----------
[Intl] Revise timezone name generation
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes (inlcluding intl-data group)
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
This is the final polishing needed for #31294 :)
I've realized it's much easier to de-duplicate by processing fallback locales separate, and then only keep the diff compared to a specific locale. More or less the same approach `LocaleDataGenerator` already follows. I was trying to be clever and filter based on inheritance in a single process; bad idea.
Includes https://github.com/ro0NL/symfony/commit/31591d0 (ref #31432)
Commits
-------
bfdb4ed492 [Intl] Revise timezone name generation
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] Simplifying SyncTransport and fixing bug with handlers transport
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | not needed
This is still a WIP, because it's not quite working and tests are a TODO. However, the basic idea is there. This makes SyncTransport less "weird". It acts more like a real transport... except that it "receives" and re-dispatches its message immediately.
The bug I'm trying to fix is related to the transport-based handling config that @sroze introduced. It doesn't currently play nice with the sync transport due to the unnatural way that I made it originally.
Cheers!
Commits
-------
8a49eb8660 Simplifying SyncTransport and fixing bug with handlers transport
* 4.3:
[Routing] Fixed unexpected 404 NoConfigurationException
[DI] Removes number of elements information in debug mode
[Contracts] Simplify implementation declarations
Update PR template for 4.3
[Intl] Add FallbackTrait for data generation
[Console] Commands with an alias should not be recognized as ambiguous
clarify the possible class/interface of the cache
* 4.2:
[Routing] Fixed unexpected 404 NoConfigurationException
[DI] Removes number of elements information in debug mode
[Contracts] Simplify implementation declarations
Update PR template for 4.3
[Intl] Add FallbackTrait for data generation
[Console] Commands with an alias should not be recognized as ambiguous
clarify the possible class/interface of the cache
* 3.4:
[DI] Removes number of elements information in debug mode
Update PR template for 4.3
[Intl] Add FallbackTrait for data generation
[Console] Commands with an alias should not be recognized as ambiguous
clarify the possible class/interface of the cache
This PR was merged into the 4.2 branch.
Discussion
----------
[Routing] Fixed unexpected 404 NoConfigurationException
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31199
| License | MIT
This is the patch for 4.2+
We need a different patch for 3.4 that is more complex, I think.
Commits
-------
aa71a42a49 [Routing] Fixed unexpected 404 NoConfigurationException
This PR was merged into the 3.4 branch.
Discussion
----------
[Console] Commands with an alias should not be recognized as ambiguous when using register
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #25355
| License | MIT
| Doc PR |
I think when passing an alias, it should not be treated as a ambiguous command since it's configured to response to it.
I've [pushed a commit](2f5209a687) that reproduce the bug and with this patch it does work.
Commits
-------
ae7ee46465 [Console] Commands with an alias should not be recognized as ambiguous
This PR was squashed before being merged into the 3.4 branch (closes#31371).
Discussion
----------
[DI] Removes number of elements information in debug mode
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31340
| License | MIT
| Doc PR | -
With this services config:
```yaml
my_service:
class: stdClass
arguments: [!tagged my_tag]
my_tagged_service_1:
class: stdClass
tags: [my_tag]
my_tagged_service_2:
class: stdClass
tags: [my_tag]
```
Executing `./bin/console debug:container my_service --show-arguments --env=dev` resulted in
```bash
Information for Service "my_service"
====================================
---------------- -------------------------
Option Value
---------------- -------------------------
Service ID my_service
Class stdClass
Tags -
Public no
Synthetic no
Lazy no
Shared yes
Abstract no
Autowired yes
Autoconfigured yes
Arguments Iterator (0 element(s))
---------------- -------------------------
```
With this fix the output changed to:
```bash
Information for Service "my_service"
====================================
---------------- ------------
Option Value
---------------- ------------
Service ID my_service
Class stdClass
Tags -
Public no
Synthetic no
Lazy no
Shared yes
Abstract no
Autowired yes
Autoconfigured yes
Arguments Tagged Iterator for "my_tag"
---------------- ------------
```
and with `./bin/console debug:container my_service --show-arguments --env=prod`
```bash
Information for Service "my_service_tagged_iterator"
====================================================
---------------- ---------------------------------------------
Option Value
---------------- ---------------------------------------------
Service ID my_service
Class stdClass
Tags -
Public no
Synthetic no
Lazy no
Shared yes
Abstract no
Autowired yes
Autoconfigured yes
Arguments Tagged Iterator for "my_tag" (2 element(s))
---------------- ---------------------------------------------
```
Commits
-------
0da4b83197 [DI] Removes number of elements information in debug mode
This PR was merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle] clarify the possible class/interface of the cache
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
When the fallback cache pool is returned (on PHP 5.6, HHVM, or when
Opcache is disabled), the configured service can be any implementation
of the CacheItemPoolInterface.
Commits
-------
40273745ce clarify the possible class/interface of the cache
This PR was merged into the 3.4 branch.
Discussion
----------
[Intl] Add FallbackTrait for data generation
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| 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 -->
This is the last architectural change for the Intl data compilation. Promised.
It fixes de-duplicating a locale from its fallback locale. The problem is it uses a while-loop, comparing the locale to each fallback locale.
Given
- `root` (val=A)
- `ur` (val=B)
- `ur_IN` (val=A)
We have an edge case where a locale (ur_IN) override its fallback locale (ur), setting/restoring the value back to the root locale. This happens for the GMT format in the timezone bundle i know of ... in this case the `ur_IN` locale needs to write its own value.
The current approach is a while-loop comparing each fallback locale (ur, root) to the current locale (ur_IN). Eventually comparing `ur_IN <> root`, which causes a wrong diff, as such `ur_IN` falls back to `ur` providing the wrong value (val=B, where val=A is expected).
The new approach uses recursion so we only compare `ur <> ur_IN`, where `ur_IN` on itself is compared to `root`.
4.2) https://github.com/ro0NL/symfony/commit/e24d8e6
4.3) https://github.com/ro0NL/symfony/commit/31591d0
Commits
-------
36ddfd58b9 [Intl] Add FallbackTrait for data generation
This PR was merged into the 4.3-dev branch.
Discussion
----------
Fix compat with older versions of PHP
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
<!--
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.
-->
Commits
-------
07b9af2eff fixed compat with older versions of PHP
When the fallback cache pool is returned (on PHP 5.6, HHVM, or when
Opcache is disabled), the configured service can be any implementation
of the CacheItemPoolInterface.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Fixing missed tests from #31355
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | not needed
Tests I missed from #31355 - sorry about that!
Commits
-------
ab3744961d Fixing missed tests from #31355
This PR was squashed before being merged into the 4.3-dev branch (closes#31249).
Discussion
----------
[Translator] Set sources when extracting strings from php files
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Set metadata about filenames and line numbers when extracting translatable strings from php files. This PR complements #30909 and #31248, as those PRs implement support for dumping the filenames and line numbers to Po and Qt file formats.
Commits
-------
f05d4e41be [Translator] Set sources when extracting strings from php files
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Adding final routing key to delay queue name
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31241
| License | MIT
| Doc PR | n/a
Fixes#31241.
When we delay, we create a queue whose `x-message-ttl` matches the delay length and `x-dead-letter-routing-key` matches the original routing key used for the message. However, before this PR, the original routing key was not part of that queue's name. The result is that if two messages were delayed by the same length, but with different routing keys, the second would try to "redeclare" the existing delay queue with a new `x-dead-letter-routing-key`, resulting in an error similar to:
> Server channel error: 406, message: PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-routing-key' for queue 'delay_queue_1000'
Integration test was improved to catch this.
Cheers!
Commits
-------
9940e71ae1 fixing a bug where the delay queue name did not contain the final routing key
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Dotenv] Test do not use putenv
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
The related pull request is https://github.com/symfony/symfony/pull/31062.
If the `$usePutenv` flag is set to `false`, `putenv` won't be executed. I just add a small test for this situation.
Commits
-------
6d1a76e998 Test do not use putenv
This PR was squashed before being merged into the 4.3-dev branch (closes#31403).
Discussion
----------
[Intl][4.3] Apply localeDisplayPattern and fix locale generation
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| 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 -->
Follow up of #31337 & #31402 for 4.3 / master
Commits
-------
ed04f242d2 recompile
504db27860 re-apply api changes for TimezoneDataGenerator
c443e78dde re-apply translator parents.json generation
bf50b61f2a [Intl] Apply localeDisplayPattern and fix locale generation
* 4.2:
[Console] Fix auto-complete for ChoiceQuestion (multi-select answers)
Translated form, security, validators resources into Belarusian (be)
[WebProfilerBundle] Don't filter submitted IP values
[Intl] Cleanup
bumped Symfony version to 4.2.9
updated VERSION for 4.2.8
updated CHANGELOG for 4.2.8
bumped Symfony version to 3.4.28
updated VERSION for 3.4.27
update CONTRIBUTORS for 3.4.27
updated CHANGELOG for 3.4.27
This PR was merged into the 3.4 branch.
Discussion
----------
[Intl] Cleanup
| 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 -->
cleanup of #31365 for 3.4 + some other stuff to keep in sync across branches
Commits
-------
70a941ec0c [Intl] Cleanup
This PR was squashed before being merged into the 4.3-dev branch (closes#31060).
Discussion
----------
[Validator] Make API endpoint for NotCompromisedPasswordValidator configurable
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes, but acceptable [1]
| Deprecations? | no [1]
| Tests pass? | yes
| Fixed tickets | #30871, #31054
| License | MIT
| Doc PR | symfony/symfony-docs#... (TODO)
Makes the API endpoint for the `NotCompromisedPasswordValidator` configurable. The endpoint includes the placeholder which will be replaced with the first digits of the password hash for k-anonymity.
The endpoint can either be set via constructor injection of the validator if the component is used standalone, or via the framework configuration of symfony/framework-bundle.
[1] As discussed in #31054, the validator is not in a stable release yet, therefore the BC break is considered acceptable. No deprecation / BC layer is necessary.
Commits
-------
f6a80c214d [Validator] Make API endpoint for NotCompromisedPasswordValidator configurable
* 3.4:
[Console] Fix auto-complete for ChoiceQuestion (multi-select answers)
Translated form, security, validators resources into Belarusian (be)
[WebProfilerBundle] Don't filter submitted IP values
bumped Symfony version to 3.4.28
updated VERSION for 3.4.27
update CONTRIBUTORS for 3.4.27
updated CHANGELOG for 3.4.27
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Fix Redis Connection::get() after reject()
| 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
If a message is rejected, another consumer cannot read from the stream because the first subsequent call to `\Redis::xreadgroup()` returns false for some reason.
Reproducer: https://github.com/chalasr/redis-transport-bug
ping @alexander-schranz
Commits
-------
c05273f793 [Messenger] Fix Redis Connection::get() after reject()
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] fix wrong use of generator returns
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 |
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
I've seen this problem many times: Mixing `yield` with `return []`.
Unfortunately it cannot be forbidden at the compiler level because it's actually a feature: https://www.php.net/manual/de/generator.getreturn.php
But usually not intended that way.
Also added some other minor cleanups I've found.
Commits
-------
e8a09e9d85 [Messenger] fix wrong use of generator returns
This PR was merged into the 4.3-dev branch.
Discussion
----------
Make the exception messages consistent across the board
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
<!--
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.
-->
Commits
-------
84c67193bc made the esception messages consistent across the board
This PR was squashed before being merged into the 4.3-dev branch (closes#31354).
Discussion
----------
[Intl][Validator] Handle alias locales/timezones
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes (including intl-data group)
| Fixed tickets | #31022
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
both timezones and locales have aliases (either thru deprecation/migration/etc.)
for locales we compile a mapping, for timezones we dont. yet we can benefit partial alias support thru DateTimeZone, which knows about most timezone IDs already.
both the timezone + locale validator already support aliases. Connsequently, we should support aliases in `Timezones::exists()` + `Locales::exists()` as well IMHO.
so far so good; the catch is; with this PR `Locales::getName()` supports aliases, whereas `Timezones::getName()` doesnt. I think it's reasonable for now, until we compile the timezone mapping so we can widen the timezone ID conversion here.
Commits
-------
0a9be0df6e [Intl][Validator] Handle alias locales/timezones
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] Show injected services for iterator and array arguments
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? |no
| New feature? | yes<!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? |no <!-- 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 | #31340 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | tbd.
When I have the following service configuration:
```yaml
App\Word\Checker\StaticWordChecker:
tags: [app.checker]
App\Word\Checker\BannedWorldListChecker:
tags: [app.checker]
App\Word\WordCheckerTaggedIterator:
arguments: [!tagged app.checker]
App\Word\WordCheckerArray:
arguments:
- App\Word\Checker\StaticWordChecker: ~
App\Word\Checker\BannedWorldListChecker: ~
```
and I run:
`./bin/console debug:container App\Word\WordCheckerArray --show-arguments`
```bash
Information for Service "App\Word\WordCheckerArray"
===================================================
---------------- -------------------------------------------
Option Value
---------------- -------------------------------------------
Service ID App\Word\WordCheckerArray
Class App\Word\WordCheckerArray
Tags -
Public no
Synthetic no
Lazy no
Shared yes
Abstract no
Autowired yes
Autoconfigured yes
Arguments Array (2 element(s))
- App\Word\Checker\StaticWordChecker
- App\Word\Checker\BannedWorldListChecker
---------------- -------------------------------------------
```
or
`./bin/console debug:container App\Word\WordCheckerTaggedIterator --show-arguments`
```bash
Information for Service "App\Word\WordCheckerTaggedIterator"
============================================================
---------------- -------------------------------------------
Option Value
---------------- -------------------------------------------
Service ID App\Word\WordCheckerTaggedIterator
Class App\Word\WordCheckerTaggedIterator
Tags -
Public no
Synthetic no
Lazy no
Shared yes
Abstract no
Autowired yes
Autoconfigured yes
Arguments Iterator (2 element(s))
- App\Word\Checker\BannedWorldListChecker
- App\Word\Checker\StaticWordChecker
---------------- -------------------------------------------
```
I can now see the the objects injected into the iterator and array arguments.
Commits
-------
db5fb200ce [FrameworkBundle] Show injected services for Iterator and Array
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Intl] Rename Regions to Countries
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes (including intl-data group)
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Because that's what the current region data is about; country codes.
This makes things consistent across the board; i.e. CountryType, CountryValidator
This allows a possible other region subset (e.g "continents") to distinct. Thus having `Countries::class` + `Continents::class` both reading from the `region` data. By then data should be compiled under different keys.
Current class is master only, so now or never :)
The alternative approach would be `Regions::getCountryNames [,getContinentNames, etc.]`, which is harder to scale, and should also be decided for 4.3 ideally.
Commits
-------
49aee67f46 [Intl] Rename Regions to Countries
This PR was squashed before being merged into the 3.4 branch (closes#31377).
Discussion
----------
[Console] Fix auto-complete for ChoiceQuestion (multi-select answers)
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/24072
| License | MIT
| Doc PR | -
Previously, a bug existed whereby for multi-select questions, the auto-complete would only work for the first answer supplied by the user. On all subsequent answers, the auto-complete would not appear.
Now it works as expected:
![screenshot](https://user-images.githubusercontent.com/2110222/57158657-8c147e80-6e16-11e9-94f7-a9bc95506545.png)
Commits
-------
59321fe031 [Console] Fix auto-complete for ChoiceQuestion (multi-select answers)
The change allow `simple-phpunit` to be included without
`#!/usr/bin/env php` string outputted.
Also it's the first step to fix#27035 (the second one is to change
phpunit bridge recipe).
This PR was merged into the 3.4 branch.
Discussion
----------
[WebProfilerBundle] Don't filter submitted IP values
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #31378 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | -
I don't think we need to filter the value submitted by users in this case.
Commits
-------
29bd2ad3f2 [WebProfilerBundle] Don't filter submitted IP values
This PR was merged into the 4.3-dev branch.
Discussion
----------
[PhpunitBridge] Fix not unserialized logs after DeprecationErrorHandler refacto
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
During the refactoring for #29211 , it seems a little bug was introduced. When using runInSeparateProcess, deprecation message isn't unserialized anymore.
Commits
-------
f522729527 [PhpunitBridge] Fix not unserialized logs after DeprecationErrorHandler refactoring
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] Remove SendFailedMessageToFailureTransportListener if no failure transport
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | n/a
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
When there is no failure transport configured and `messenger:consume` hits a failing message:
> Argument 2 passed to Symfony\Component\Messenger\EventListener\SendFailedMessageToFailureTransportListener::__construct() must be of the type string, null given
/cc @weaverryan
Commits
-------
bdf4e913be [FrameworkBundle] Remove SendFailedMessageToFailureTransportListener definition if no failure transport
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] Keep preferred choices order in ChoiceType
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #5136
| License | MIT
| Doc PR | todo
#EUFOSSA
Commits
-------
340a2fb3f8 Keep preferred_choices order
This PR was merged into the 3.4 branch.
Discussion
----------
Reword VarDumper description
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
It is hard to understand what "Built on top" refers to, and even when
knowing, the sentence looks weird.
![Untitled](https://user-images.githubusercontent.com/657779/57011659-15ebfe00-6c03-11e9-9b85-5c00cfc15026.png)
The description of [the Github repository](https://github.com/symfony/var-dumper) has the same issue and should be changed.
Commits
-------
6024e16ea1 Reword VarDumper description
* 4.2:
Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)"
[Workflow] Fixed dumping when many transition with same name exist
relax assertions in tests
fix ConsoleFormatter - call to a member function format() on string
Made `debug:container` and `debug:autowiring` ignore starting backslash in service id
[Validator] Translate messages into Japanese
Fix Thai translation in validators.th.xlf
[FramworkBundle] mark any env vars found in the ide setting as used
* 3.4:
Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)"
[Workflow] Fixed dumping when many transition with same name exist
fix ConsoleFormatter - call to a member function format() on string
This PR was merged into the 3.4 branch.
Discussion
----------
Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)"
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This reverts commit 029fb2e7e3, reversing
changes made to 9dad29d61c.
Reverts #30620
Replaces #31215
We don't need to solve this in 3.4
Making the session resettable should be done on master, by implementing `ResetInterface`.
On 3.4 apps, one should write a dedicated `SessionResetter` that would implement the reverted logic.
Commits
-------
4177331915 Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)"
This PR was squashed before being merged into the 4.3-dev branch (closes#31288).
Discussion
----------
[Messenger] RoutableMessageBus route to default bus
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31200
| License | MIT
| Doc PR | Not needed
Hi! I modified the behaviour of RoutableMessageBus to route message without BusNameStamp to default bus instead of raise an exception.
Made with ❤️ by [![Open Source Saturday](https://img.shields.io/badge/%E2%9D%A4%EF%B8%8F-open%20source%20saturday-F64060.svg)](https://www.meetup.com/it-IT/Open-Source-Saturday-Milano/)
Commits
-------
c4e5e83b56 [Messenger] RoutableMessageBus route to default bus
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Validator] Allow intl timezones
| Q | A
| ------------- | ---
| Branch? | master
| 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 | ref #28836
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/issues/11502
This PR considers the ICU timezones (#28831) as valid, as well as the PHP ones.
Both can be used in `DateTimeZone`, but expired timezones cannot be used with `IntlTimeZone`. The `intlCompatibility` option ensures compatibility between both.
Practically this allows for both `UTC` and `Etc/UTC`, where the latter should be preferred. I.e. currently `Etc/UTC` is considered an invalid timezone ... which it's not.
Commits
-------
7294b59c65 [Validator] Allow intl timezones
This PR was merged into the 4.2 branch.
Discussion
----------
Made `debug:container` and `debug:autowiring` ignore starting backslash in service id
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
When you copy a reference to a class from PHPStorm it always start the FQCN with a backslash.
When you now try to search the container for this class using `bin/console debug:container "\My\Class"` it cannot find it.
This PR always removes the starting backslash before searching the container to avoid this issue.
Commits
-------
0945f27e81 Made `debug:container` and `debug:autowiring` ignore starting backslash in service id
This PR was merged into the 3.4 branch.
Discussion
----------
fix ConsoleFormatter - call to a member function format() on string
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | maybe
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
The ConsoleFormatter crashes when there is not a DateTime object in `$record['datetime']`. As this parameter is not documented anywhere (i.e. `FormatterInterface` does not say it must be a DateTime object), I think the proper fix is to check if there is DateTimeInterface object and only call the `format` method then.
We use a custom LogProcessor (https://symfony.com/doc/current/logging/processors.html) to add some extra data and format the DateTime in the `$record['datetime']`. We need to format the DateTime in the processor, because we use `JsonFormatter` in prod environment and it does not support changing the date format. We use `ConsoleFormatter` only in dev environment and as the processor is called before the formatter, we get the crash.
There were no tests whatsoever for `ConsoleFormatter`, so I've added a basic one, that passes before and after, and another one that tests the crash (failed before, passed after).
There is a theoretical BC break, as someone could have sent an object with a `format` method to the formatter and it would have worked, but I'm not sure if it's considered BC break by Symfony, please let me know, if it is.
Commits
-------
648832823f fix ConsoleFormatter - call to a member function format() on string
This PR was merged into the 3.4 branch.
Discussion
----------
[Workflow] Fixed dumping when many transition with same name exist
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no>
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
---
With this configuration:
```yaml
framework:
workflows:
foobar:
type: workflow
supports:
- stdClass
initial_place: a
places:
- a
- b
- c
- cancelled
transitions:
- name: a-b
from: a
to: b
- name: b-c
from: b
to: c
- name: cancel
from: a
to: cancelled
- name: cancel
from: b
to: cancelled
- name: cancel
from: c
to: cancelled
```
before:
![workflow-broken](https://user-images.githubusercontent.com/408368/56969037-a0315500-6b64-11e9-917e-4c45820938cc.png)
After:
![workflow-fixed](https://user-images.githubusercontent.com/408368/56969047-a4f60900-6b64-11e9-8f07-30e701a4978f.png)
Commits
-------
312a456e04 [Workflow] Fixed dumping when many transition with same name exist
This PR was squashed before being merged into the 4.3-dev branch (closes#30970).
Discussion
----------
[Messenger] Adding failure transport support
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31231
| License | MIT
| Doc PR | symfony/symfony-docs#11236
This adds "failure" transport support for messenger, so that messages that fail on *all* their retries can be collected in one spot and retried later if wanted:
```yml
framework:
messenger:
failure_transport: failed
transports:
async:
dsn: 'amqp://'
failed:
dsn: 'doctrine://default?queue_name=failed'
routing:
'App\Message\SmsNotification': async
```
In this setup, `SmsNotification` would be retried 3 times on the `async` transport (current behavior) and then finally sent to the `failed` transport. The `failed` transport can be consumed like a normal transport, but should usually be handled & consumed by one of the new commands:
**> bin/console messenger:failed:show**
<img width="861" alt="Screen Shot 2019-04-10 at 3 15 45 PM" src="https://user-images.githubusercontent.com/121003/55917329-ddc54280-5ba3-11e9-878c-af3c653643de.png">
**> bin/console messenger:failed:show 217**
<img width="804" alt="Screen Shot 2019-04-10 at 3 15 55 PM" src="https://user-images.githubusercontent.com/121003/55917360-f33a6c80-5ba3-11e9-9f12-a8c57a9a7a4b.png">
**> bin/console messenger:failed:purge 217**
<img width="835" alt="Screen Shot 2019-04-10 at 3 16 07 PM" src="https://user-images.githubusercontent.com/121003/55917383-ff262e80-5ba3-11e9-9720-e24176b834f7.png">
**> bin/console messenger:failed:retry 217**
<img width="737" alt="Screen Shot 2019-04-10 at 3 16 29 PM" src="https://user-images.githubusercontent.com/121003/55917396-09482d00-5ba4-11e9-8d51-0bbe2b4ffc14.png">
**> bin/console messenger:failed:retry 218 -vv**
<img width="1011" alt="Screen Shot 2019-04-10 at 3 20 39 PM" src="https://user-images.githubusercontent.com/121003/55917503-6512b600-5ba4-11e9-9365-4ac87d858541.png">
**Note** (This screenshot is ugly - need to make the dump of the message and the exception more attractive)
Or you can run `bin/console messenger:failed:retry` without any argument, and it will consume the failed messages one-by-one and ask you if you want to retry/handle each. By passing
Cheers!
Commits
-------
36487e5f44 [Messenger] Adding failure transport support
This PR was squashed before being merged into the 4.3-dev branch (closes#31332).
Discussion
----------
[Intl] Add phpdoc
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| 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 | https://github.com/symfony/symfony/pull/31325#discussion_r279843099
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Commits
-------
22a6f7b1bd [Intl] Add phpdoc
* 3.4:
relax assertions in tests
[Validator] Translate messages into Japanese
Fix Thai translation in validators.th.xlf
[FramworkBundle] mark any env vars found in the ide setting as used
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Intl] Extra timezone tests
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes (including intl-data group)
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Guarantees timezone data integrity. Ideally to go before #31292 :)
Commits
-------
a3cac2b4c9 [Intl] Extra timezone tests
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Intl] Compile localized timezone offset name
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes-ish
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes (including intl-data group)
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
A tiny follow up of #31295
Commits
-------
7a40d207b7 [Intl] Compile localized timezone offset name
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Translator] Add sources when dumping qt files
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
This PR implements similar functionality as #30909, but for Qt files. Currently, only the Qt element `location` is supported, so only `sources` metadata is included in the dump.
Commits
-------
ff7577d650 Add sources when dumping qt files
This PR was squashed before being merged into the 4.3-dev branch (closes#31306).
Discussion
----------
[DI] Improve exception message on missing $ of named argument
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | -
| New feature? | -
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #31265 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | not related
<!--
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.
-->
### Description
As described in #31265, missing the prefix `$` in an argument name:
```
App\Word\WordChecker:
arguments:
checkers:
- '@App\Word\Checker\StaticWordChecker'
- '@App\Word\Checker\BannedWorldListChecker'
```
led to the following error:
`Invalid service "App\Word\WordChecker": the value of argument "checkers" of method "__construct()" must be null, an instance of Symfony\Component\DependencyInjection\Reference or an instance of Symfony\Component\DependencyInjection\Definition, array given.`
As this error message is quite confusing I changed it to:
`Invalid service "App\Word\WordChecker": Did you forget to add the "$" prefix to argument checkers`
### Todo
- [x] add a unit test
Commits
-------
d0e44996f9 [DI] Improve exception message on missing $ of named argument
This PR was squashed before being merged into the 4.3-dev branch (closes#31280).
Discussion
----------
[WebServerBundle] Change the default pidfile location to cache directory
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no <!-- 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 | #29160 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | tbd.
<!--
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.
-->
Commits
-------
2e14b6e891 [WebServerBundle] Change the default pidfile location to cache directory
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Serializer] [DX] NotNormalizableValueException should note which attribute failed to denormalize when possible
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #29230 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR
<!--
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.
-->
This is the idea of a fix discussed with @stof about the improvment of serializer error message. Now we can try a implementation lis this one. This is linked to EUFOSSA even if this has been done not in the hackathon.
Commits
-------
59942b40d1 [Serializer] [DX] NotNormalizableValueException should note which attribute failed to denormalize when possible
This PR was merged into the 3.4 branch.
Discussion
----------
[FramworkBundle] mark any env vars found in the ide setting as used
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31119
| License | MIT
| Doc PR | -
Commits
-------
e461d36ec4 [FramworkBundle] mark any env vars found in the ide setting as used
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Security] Change the phrasing of the deauthenticated event
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | none <!-- #-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.
-->
Fixing @fabpot's review.
Commits
-------
fa92272dc1 [Security] Change the phrasing of the deauthenticated event
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Intl] Fix LocaleDataGenerator
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| 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 -->
Forgotten in #28846
The `getName()` method for scripts/regions/languages is stilled needed during locale generation.
Commits
-------
137ce3f6d2 [Intl] Fix LocaleDataGenerator
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] fix skipping h2push test case
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30975
| License | MIT
| Doc PR | -
Commits
-------
3aaa742d40 [HttpClient] fix skipping h2push test case
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Allows to register handlers on a specific transport
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30110
| License | MIT
| Doc PR | symfony/symfony-docs#11236
With the #30008 pull-request in, we can now do the following:
```yaml
framework:
messenger:
transports:
events:
dsn: amqp://guest:guest@127.0.0.1/%2f/events
options:
queues:
3rdparty:
binding_keys: [ 3rdparty ]
projection:
binding_keys: [ projection ]
events_3rdparty: amqp://guest:guest@127.0.0.1/%2f/events?queues[3rdparty]
events_projection: amqp://guest:guest@127.0.0.1/%2f/events?queues[projection]
routing:
'App\Message\RegisterBet': events
```
This will bind two queues to the `events` exchange, fantastic:
<img width="325" alt="Screenshot 2019-04-07 at 10 26 27" src="https://user-images.githubusercontent.com/804625/55680861-af373580-591f-11e9-8f1e-2d3b6ddba2fd.png">
---
Now, in this setup, the message will be duplicated within the `3rdparty` & `projection` queues. If you just run the consumer for each transport, it will consume the message and call all the handlers. You can't do different things based on which queue you have consumed the message. **This pull-request adds the following feature:**
```php
class RegisterBetHandler implements MessageSubscriberInterface
{
public function __invoke(RegisterBet $message)
{
// Do something only when the message comes from the `events_projection` transport...
}
/**
* {@inheritdoc}
*/
public static function getHandledMessages(): iterable
{
yield RegisterBet::class => [
'from_transport' => 'events_projection',
];
}
}
```
---
In the debugger, it looks like this:
<img width="649" alt="Screenshot 2019-04-07 at 10 29 55" src="https://user-images.githubusercontent.com/804625/55680892-1d7bf800-5920-11e9-80f7-853f0201c6d8.png">
Commits
-------
f0b2acd67d Allows to register handlers on a specific transport (and get rid of this handler alias)
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Ensure that a TransportException is thrown on redis error
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
<!--
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.
-->
Commits
-------
1857395137 [Messenger] Ensure that a TransportException is thrown on redis error
This PR was squashed before being merged into the 4.3-dev branch (closes#31061).
Discussion
----------
[BridgeDoctrineMessenger] Doctrine ping connection middleware
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
- Check and reconnect if mysql has gone away:
<service id="messenger.middleware.doctrine_ping_connection" class="Symfony\Bridge\Doctrine\Messenger\DoctrinePingConnectionMiddleware" public="false">
<argument type="service" id="doctrine" />
</service>
- Close and save opened connections (not active worker):
<service id="messenger.middleware.doctrine_close_connection" class="Symfony\Bridge\Doctrine\Messenger\DoctrineCloseConnectionMiddleware" public="false">
<argument type="service" id="doctrine" />
</service>
Commits
-------
6fd9f6a859 [BridgeDoctrineMessenger] Doctrine ping connection middleware
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Add WorkerStoppedEvent
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
In 4.2, one was able to decorate a transport and hook into `TransportInterface::stop()` to perform some business tasks when the `messenger:consume` process gets killed.
In 4.3 the `stop()` logic has been moved to `Worker` which cannot be decorated when used via `messenger:consume`.
This PR adds a marker event dispatched when the worker is stopped to provide the same capability.
Briefly discussed with @weaverryan.
My use case:
I have a temporary CSV file locally which grows while consuming jobs.
This file is uploaded to AWS S3 and squashed once a while (every 5minutes). It is also uploaded when the `messenger:consume` process gets stopped (to store the remaining lines).
For the former (time-based upload), I can listen on `WorkflowMessageHandledEvent` to make the upload happens in case the 5 minutes delay is elapsed. This solves the latter.
Commits
-------
0e7898b622 [Messenger] Add WorkerStoppedEvent
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Security] Dispatch an event when "logout user on change" steps in
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #26902 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/11450 <!-- 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.
-->
This adds a new event when the user has been changed and has been log out from the apps, it allow someone to register to this event and do something with either to token or the refreshedUser.
Commits
-------
40e42183b8 [Security] Dispatch an event when "logout user on change" steps in
* 4.2:
[TwigBridge] Require twig ^1.40|^2.9
[Serializer] Fix tests
Use the apply tag instead of the filter tag
Updated some translation files
[Translator] Preserve default domain when extracting strings from php files
* 3.4:
[TwigBridge] Require twig ^1.40|^2.9
[Serializer] Fix tests
Use the apply tag instead of the filter tag
Updated some translation files
[Translator] Preserve default domain when extracting strings from php files
This PR was merged into the 3.4 branch.
Discussion
----------
[Serializer] Fix tests
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | n/a
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
#30888 added some tests on master which fail when `property-info <3.4.13` is installed.
This bumps the constraint on 3.4 which will fix the low-deps build once merged up to master.
Commits
-------
d25f650005 [Serializer] Fix tests
This PR was merged into the 3.4 branch.
Discussion
----------
[TwigBundle] Use the apply tag instead of the filter tag
The filter has been deprecated in favor of the apply tag since Twig 2.9,
see https://twig.symfony.com/doc/2.x/tags/filter.html (apply does not
seem to have its own documentation page yet).
| 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
⚠ Note: don't merge until Twig 2.9 and 1.40 are released, or this will block symfony releases ⚠
Commits
-------
9c11b98d0a Use the apply tag instead of the filter tag
This PR was squashed before being merged into the 4.3-dev branch (closes#31242).
Discussion
----------
Update LoggingTranslator to log the change of a locale
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
I would like to see inside my logs that the translator changed the locale. I've had a case that I spent significant amount of time trying to debug it.
Commits
-------
20380f9afe Update LoggingTranslator to log the change of a locale
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Add a redis stream transport
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | Yes
| Fixed tickets | #28681
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/11341
As discussed in #28681 this will refractor @soyuka implementation of redis using the redis stream features so we don't need to handle parking the messages ourself and redis is doing it for us.
Some interesting links about streams:
- https://redis.io/topics/streams-intro
- https://brandur.org/redis-streams
```
+-----------R
| GET | -> XREADGROUP
+-----------+
|
| handleMessage
V
+-----------+ No
| failed? |---------------------------+
+-----------+ |
| |
| Yes |
V |
+-----------+ No |
| retry? |---------------------------+
+-----------+ |
| |
| Yes |
V V
+-----------R +-----------R
| REJECT | -> XDEL | ACK | -> XACK
+-----------+ +-----------+
```
**GET**: Will use `XREADGROUP` to read the one message from the stream
**REJECT**: Reject will just remove the message with `XDEL` from the stream as adding it back to the stream is handled by symfony worker itself
**ACK**: Will use the `XACK` Method to ack the message for the specific group
The sender will still be simple by calling the `XADD` redis function.
#EU-FOSSA
Commits
-------
ff0b8554ea Refractor redis transport using redis streams
7162d2ec1d Implement redis transport
This PR was merged into the 4.3-dev branch.
Discussion
----------
Make error message more clear
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
When you get the following error message `No transport supports the given DSN "...".`, you might think that this relates to a mailer transport or a messenger transport. Let's make this real clear.
<!--
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.
-->
Commits
-------
cdcb6c9969 made error message more clear
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] fix typo
| Q | A
| ------------- | ---
| Branch? | 3.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? | no <!-- 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 | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- 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.
-->
Commits
-------
c5819f444d [HttpClient] fix typo
This PR was squashed before being merged into the 4.3-dev branch (closes#30888).
Discussion
----------
[serializer] extract normalizer tests to traits
eufossa
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | Relates to #30818
| License | MIT
| Doc PR | -
As discussed with @joelwurtz, extract normalizer functionality tests into traits to ensure consistent behaviour of all normalizers.
* [x] Rebase when #30977, #30950 and #30907 are merged to master **blocker**
* [x] Clean up order of trait inclusion and methods in the tests
* [x] Clean up fixture classes of the traits. I started having one class named the same as the trait, where possible
Stuff that we should do eventually, but can also do in separate pull requests, after this one has been merged:
* [ ] Extract all features that we can (the existing normalizer tests should more or less only have the legacy tests in them, all functionality should be in trait)
* [ ] Run test coverage and increase coverage so that we cover all important features and all relevant error cases.
Commits
-------
2b6ebea73c [serializer] extract normalizer tests to traits
This PR was squashed before being merged into the 3.4 branch (closes#31275).
Discussion
----------
[Translator] Preserve default domain when extracting strings from php files
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Use default domain when extracting translation strings with `null` as domain.
Commits
-------
ca77d9a33e [Translator] Preserve default domain when extracting strings from php files
This PR was merged into the 4.3-dev branch.
Discussion
----------
Make the email validator a hard requirement of mailer
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes-ish
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
I think it makes sense to have the email address validator as a hard requirement of Mailer... as I don't see how you can send emails without an email address :)
Commits
-------
5ad2cb1b5a made the email validator a hard requirement of mailer
This PR was squashed before being merged into the 4.3-dev branch (closes#31195).
Discussion
----------
[Form] Add intltimezone input to TimezoneType
| Q | A
| ------------- | ---
| Branch? | master
| 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 | #22302 (ref #28836)
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/issues/11463
cc @rvanlaak
Commits
-------
e169dfb968 [Form] Add intltimezone input to TimezoneType
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Routing] do not encode comma in query and fragment
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #27266
| License | MIT
| Doc PR |
Commits
-------
76f6c97416 [Routing] allow comma and other reserved chars without special meaing to not be encoded in the query and fragment
* 4.2:
Fix url matcher edge cases with trailing slash
[Form] Fix author tag + exception messages
[TwigBridge] Fix deprecation on twig 2.9
Fix left-associative ternary deprecation warnings for PHP 7.4
[Validator] Fixed imprecise translations
[Validator] Add Dutch translations
[Security] Cleanup "Digest nonce has expired." translation
Intercept redirections only for HTML format
[PhpUnitBridge] fix reading phpunit.xml on bootstrap
resolve class name parameters
Fix name and phpdoc of ContainerBuilder::removeBindings
[Intl] Update the ICU data to 64.2
* 3.4:
[Form] Fix author tag + exception messages
[TwigBridge] Fix deprecation on twig 2.9
[Validator] Fixed imprecise translations
[Validator] Add Dutch translations
Intercept redirections only for HTML format
Fix name and phpdoc of ContainerBuilder::removeBindings
[Intl] Update the ICU data to 64.2
This PR was squashed before being merged into the 4.2 branch (closes#31240).
Discussion
----------
Fix url matcher edge cases with trailing slash
| Q | A
| ------------- | ---
| Branch? | master / 4.2 (not sure whether this should've been against 4.2)
| Bug fix? | yes
| New feature? | no
| BC breaks? | no (I think... if so, in obscure route configurations like the ones that broke in 4.2.7 ;) )
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30721
| License | MIT
As stated in #30721 the "redirecting" (compiled) UrlMatcher ignored host-requirements when doing a 'matched url except for trailing slash difference'-redirect.
With routes like this, you'd get 404's rather than 200's on the second routes.
```yaml
host1.withTrail:
path: /foo/ # host2/foo would become host2/foo/ due to this partial path-match
host: host1
host2.withoutTrail: # A request for host2/foo should match this route
path: /foo # host2/foo/ does not match this path
host: host2
```
This was caused by too eagerly testing whether a route could've worked with an additional trailing slash.
If it could be, that would result in an attempt to redirect _before_ testing the host.
The original url would get the additional slash and prior to actually redirecting, it'd be retested against the available routes. _That new url_ would actually match no routes, since now the host check for the first routes would actually be executed and fail the match for those routes. The adjusted path in the route does not match the second sets of routes...
This PR moves the trailing-slash check to after the host checks. I've added several tests with variants on these edge cases.
*Note:* This is a bug in 4.2 (and 4.3).
I fixed it against master. It appears 4.2's PhpMatcherTrait was renamed to CompiledUrlMatcherTrait in 4.3. But that made it loose its history.
So I'm not sure how to proceed from here. I can rebase it on 4.2 and do the change in PhpMatcherTrait, but that would probably fail to merge in master? I'm not nearly proficient enough in Symfony PR's to know how to solve all this ;)
@nicolas-grekas also asked for these or similar tests to be added to 3.4 as 'proof' those routes worked in that version as well. I have not (yet) done so.
The tests did work on the non-redirecting UrlMatcher without change (i.e. just running UrlMatcherTest), which implies - to me at least - the routes where properly defined and should not result in 404's simply because a RedirectableUrlMatcherInterface _can_ do redirects.
Actually, since I needed to change UrlMatcher as well, I'm not convinced these bugs where totally absent in 3.4. They didn't occur with the compiled version, since the host check was the very first if-statement in that humongous if-tree it generated.
PS, the branch name is a bit dramatic ;)
Commits
-------
4fcfa9d85c Fix url matcher edge cases with trailing slash
This PR was merged into the 3.4 branch.
Discussion
----------
[TwigBridge] Fix deprecation on twig 2.9
| 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
should make travis green
Commits
-------
ac8256ba9c [TwigBridge] Fix deprecation on twig 2.9
This PR was merged into the 3.4 branch.
Discussion
----------
Fix name and phpdoc of ContainerBuilder::removeBindings
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/29944#discussion_r276718323
| License | MIT
| Doc PR | N/A
<!--
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.
-->
Commits
-------
c93194d1db Fix name and phpdoc of ContainerBuilder::removeBindings
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] ease testing and allow forking the middleware stack
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31179
| License | MIT
| Doc PR | -
A less radical alternative than #31185 that preserves laziness and addresses the linked issue.
Commits
-------
3bdf4b0e0f [Messenger] ease testing and allow forking the middleware stack
This PR was merged into the 4.2 branch.
Discussion
----------
[Form] resolve class name parameters
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31052
| License | MIT
| Doc PR |
Commits
-------
5235be4aa3 resolve class name parameters
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Cache] Add optimized FileSystem & Redis TagAware Adapters
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes _TODO: src/**/CHANGELOG.md_
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28250
| License | MIT
| Doc PR | symfony/symfony-docs#... TODO
Reduces cache lookups by 50% when using TagAware, by changing logic of how tag information is stored to avoid having to look it up on getItem(s) calls.
For Filesystem symlinks are used, for Redis "Set" datatype is used.
Commits
-------
3278cb1c7e [Cache] Add optimized FileSystem & Redis TagAware Adapters
Reduces cache lookups by 50% by changing logic of how tag information is
stored to avoid having to look it up on getItem(s) calls.
For Filesystem symlinks are used, for Redis "Set" datatype is used.
This PR was squashed before being merged into the 4.2 branch (closes#31023).
Discussion
----------
[Routing] Fix route URL generation in CLI context
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30996
| License | MIT
| Doc PR | -
This fixes#30996 and makes URL generation in the CLI context behave the same as it does in the web context where the `LocaleListener` sets the default locale (to the router context).
The Travis CI failure is related to the fact that the constraint for `symfony/routing` should be bumped to `^4.2.6` in the composer.json of the FrameworkBundle (when it gets tagged).
Commits
-------
4a1ad4a5d6 [Routing] Fix route URL generation in CLI context
This PR was squashed before being merged into the 4.3-dev branch (closes#31085).
Discussion
----------
[DoctrineBridge] Unique mapping setting is optional
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
```sh
Executed script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! // Clearing the cache for the dev environment with debug
!! // true
!!
!!
In DoctrineLoader.php line 71:
[ErrorException]
Notice: Undefined index: unique
Exception trace:
() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/doctrine-bridge/Validator/DoctrineLoader.php:71
Symfony\Bridge\Doctrine\Validator\DoctrineLoader->loadClassMetadata() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/validator/Mapping/Loader/LoaderChain.php:54
Symfony\Component\Validator\Mapping\Loader\LoaderChain->loadClassMetadata() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php:105
Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory->getMetadataFor() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/framework-bundle/CacheWarmer/ValidatorCacheWarmer.php:63
Symfony\Bundle\FrameworkBundle\CacheWarmer\ValidatorCacheWarmer->doWarmUp() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/framework-bundle/CacheWarmer/AbstractPhpFileCacheWarmer.php:51
Symfony\Bundle\FrameworkBundle\CacheWarmer\AbstractPhpFileCacheWarmer->warmUp() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php:96
Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:194
Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->warmup() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:129
Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->execute() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/console/Application.php:930
Symfony\Component\Console\Application->doRunCommand() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/framework-bundle/Console/Application.php:87
Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/console/Application.php:273
Symfony\Component\Console\Application->doRun() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/framework-bundle/Console/Application.php:73
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/console/Application.php:149
Symfony\Component\Console\Application->run() at /home/ksaveras/Projects/mokytojas.local/bin/console:40
cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
./bin/console ca:cl
```
Commits
-------
fde4dc9922 [DoctrineBridge] Unique mapping setting is optional
This PR was merged into the 3.4 branch.
Discussion
----------
[Intl] Update the ICU data to 64.2
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? |no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes, including intl-data group
| Fixed tickets | -
| License | MIT
| Doc PR | -
It didn't take long for the ICU team to release a new version.
From their [changelog](http://site.icu-project.org/download/64#TOC-ICU4C-Download), 64.2 provides bug fixes and:
* Draft Unicode 12.1 data integration
* Updated locale data imported from CLDR 35.1
* Support for the new Japanese era "Reiwa" (令和).
Commits
-------
9aa2349ac6 [Intl] Update the ICU data to 64.2
* 4.2:
[HttpFoundation] fix tests
[Routing] fix trailing slash matching with empty-matching trailing vars
[Routing] fix matching trailing vars with defaults
[Validator] fix LegacyTranslatorProxy
call method with Translator component only
bumped Symfony version to 4.2.8
updated VERSION for 4.2.7
updated CHANGELOG for 4.2.7
bumped Symfony version to 3.4.27
updated VERSION for 3.4.26
updated CHANGELOG for 3.4.26
This PR was merged into the 4.2 branch.
Discussion
----------
[Routing] fix trailing slash matching with empty-matching trailing vars
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Reported by @bmack in https://github.com/symfony/symfony/pull/31107#issuecomment-484681404
This highlights a small inconsistency that exists for a long time (checked on 2.7 at least):
`new Route('/en-en/{b}', ['b' => 'bbb'], ['b' => '.*'])` matches `/en-en/`
`new Route('/en-en/{b}', ['b' => 'bbb'], ['b' => '.+'])` doesn't match it
(while both match `/en-en` and `/en-en/foo`)
This PR ensures the former behavior is preserved, while #31167 redirects the later to `/en-en`.
Commits
-------
d6da21ac19 [Routing] fix trailing slash matching with empty-matching trailing vars
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Security] deprecate BCryptPasswordEncoder in favor of NativePasswordEncoder
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Follow up of #31140
Commits
-------
e197398d2f [Security] deprecate BCryptPasswordEncoder in favor of NativePasswordEncoder
An undefined SYMFONY_DEPRECATION_HELPER environment variable translates
to false, and that was previously interpreted as 0, which means strict
mode.
This restores backwards compatibility with the previous behavior, which
got broken in 1c73f9cfed .
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Security] Add NativePasswordEncoder
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR adds a new `NativePasswordEncoder` that defaults to the best available hashing algo to `password_hash()`. Best is determined by "us" or "php", the goal being that this will change in the future as new algos are published.
This provides a native encoder that we should recommend using by default.
Commits
-------
28f7961c55 [Security] Add NativePasswordEncoder
* 4.2:
Revert "bug #30423 [Security] Rework firewall's access denied rule (dimabory)"
[FrameworkBundle] minor: remove a typo from changelog
[VarDumper] fix tests with ICU 64.1
[VarDumper][Ldap] relax some locally failing tests
[Validator] #30192 Added the missing translations for the Tagalog ("tl") locale.
Make MimeTypeExtensionGuesser case insensitive
Fix get session when the request stack is empty
[Routing] fix trailing slash redirection with non-greedy trailing vars
[FrameworkBundle] decorate the ValidatorBuilder's translator with LegacyTranslatorProxy
This PR was merged into the 4.2 branch.
Discussion
----------
[Routing] fix trailing slash redirection with non-greedy trailing vars
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30863, #31066
| License | MIT
| Doc PR | -
Fixes redirecting `/123/` to `/123` when the route is defined as `/{foo<\d+>}`
Commits
-------
d88833d27a [Routing] fix trailing slash redirection with non-greedy trailing vars
This PR was merged into the 4.2 branch.
Discussion
----------
[FrameworkBundle] decorate the ValidatorBuilder's translator with LegacyTranslatorProxy
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31092, #31025
| License | MIT
| Doc PR | -
This allows defining a translator that implements only the new interface and use it with ValidatorBuilder.
ping @dvdknaap, @snebes since you were affected.
Commits
-------
a12656eaad [FrameworkBundle] decorate the ValidatorBuilder's translator with LegacyTranslatorProxy
This PR was merged into the 4.2 branch.
Discussion
----------
[HttpKernel] Fix get session when the request stack is empty
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
This bug happen behind an exception on a kernel response event, when one collector (e.g. `RequestDataCollector`) is trying to get the request session and the request stack is currently empty.
**Reproducer**
https://github.com/yceruto/get-session-bug (`GET /`)
See logs on terminal:
```bash
Apr 15 20:29:03 |ERROR| PHP 2019-04-15T20:29:03-04:00 Call to a member function isSecure() on null
Apr 15 20:29:03 |ERROR| PHP PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function isSecure() on null in /home/yceruto/demos/getsession/vendor/symfony/http-kernel/EventListener/SessionListener.php:43
Apr 15 20:29:03 |DEBUG| PHP Stack trace:
Apr 15 20:29:03 |DEBUG| PHP #0 /home/yceruto/demos/getsession/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php(59): Symfony\Component\HttpKernel\EventListener\SessionListener->getSession()
Apr 15 20:29:03 |DEBUG| PHP #1 /home/yceruto/demos/getsession/vendor/symfony/http-foundation/Request.php(707): Symfony\Component\HttpKernel\EventListener\AbstractSessionListener->Symfony\Component\HttpKernel\EventListener\{closure}()
Apr 15 20:29:03 |DEBUG| PHP #2 /home/yceruto/demos/getsession/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php(65): Symfony\Component\HttpFoundation\Request->getSession()
Apr 15 20:29:03 |DEBUG| PHP #3 /home/yceruto/demos/getsession/vendor/symfony/http-kernel/Profiler/Profiler.php(167): Symfony\Component\HttpKernel\DataCollector\RequestDataCollector->collect(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Respo in /home/yceruto/demos/getsession/vendor/symfony/http-kernel/EventListener/SessionListener.php on line 43
```
Friendly ping @nicolas-grekas as author of the previous PR https://github.com/symfony/symfony/pull/28244
Commits
-------
d62ca37ab6 Fix get session when the request stack is empty
* 3.4:
Revert "bug #30423 [Security] Rework firewall's access denied rule (dimabory)"
[FrameworkBundle] minor: remove a typo from changelog
[VarDumper][Ldap] relax some locally failing tests
[Validator] #30192 Added the missing translations for the Tagalog ("tl") locale.
Make MimeTypeExtensionGuesser case insensitive
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Added the missing translations for the Tagalog ("tl") locale
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | No
| New feature? | No
| BC breaks? | No
| Deprecations? | No
| Tests pass? | Yes
| Fixed tickets | #30192
| License | MIT
| Doc PR |
[Validator] This pull request will add the missing translations for the Tagalog ("tl") locale.
Commits
-------
6ab574b7c9 [Validator] #30192 Added the missing translations for the Tagalog ("tl") locale.
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpFoundation] Make MimeTypeExtensionGuesser case insensitive
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Some mime types have a camelCase word in them.
The Apache HTTPD project list items are all lower case.
So I suggest making the $mimeType string lowercase while checking the array key.
That way, we can keep the list in sync.
Example: xlsm file mime type is `application/vnd.ms-excel.sheet.macroEnabled.12`
The key that matches the xlsm extension in the `$defaultExtensions` array is `application/vnd.ms-excel.sheet.macroenabled.12`
Example xlsm file:
https://github.com/vermeirentony/xlsm-example
Commits
-------
e294ee6b9a Make MimeTypeExtensionGuesser case insensitive
This PR was merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle][Form] Fix XSS issues in the form theme of the PHP templating engine
Based on #88
Commits
-------
ab4d05358c Fix XSS issues in the form theme of the PHP templating engine
This PR was merged into the 3.4 branch.
Discussion
----------
[Security] Add a separator in the remember me cookie hash
Based on #89
Commits
-------
a29ce2817c [Security] Add a separator in the remember me cookie hash
* 4.2:
bumped Symfony version to 4.2.7
updated VERSION for 4.2.6
updated CHANGELOG for 4.2.6
bumped Symfony version to 3.4.26
updated VERSION for 3.4.25
update CONTRIBUTORS for 3.4.25
updated CHANGELOG for 3.4.25
Workaround for \DateInterval::createFromDateString()
[DoctrineBridge] [DX] Update exception text in ManagerRegistry::resetService to avoid confusion.
Missing Lithuanian translations added to validator component.
* 3.4:
bumped Symfony version to 3.4.26
updated VERSION for 3.4.25
update CONTRIBUTORS for 3.4.25
updated CHANGELOG for 3.4.25
Workaround for \DateInterval::createFromDateString()
Missing Lithuanian translations added to validator component.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Remove base64_encode & use addslashes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | already covered by existing issue
In #30814, we base64_encoded messages because some transports (specifically DoctrineTransport + Postgresql & SQS) do not allow binary data.
The downside is that the messages become unreadable, which makes it much less convenient to debug your messages with 3rd party monitoring tools, for example.
This PR replaces base64_encode with addslashes. Another alternative (that I first tried in this PR) was to use a blob type, which Drupal does in its code (https://www.drupal.org/project/drupal/issues/690746). But, it still meant that binary data could cause problems with other transports, like SQS.
I also put all the serializer config under a nice, neat `serializer` key under messenger.
Best seen with `?w=1`.
Cheers!
Commits
-------
70b448d120 Reorganizing messenger serializer config and replacing base64_encode with addslashes
This PR was squashed before being merged into the 4.3-dev branch (closes#31040).
Discussion
----------
[BrowserKit] Fixed BC-break introduced by rename of Client to Browser
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/31039
| License | MIT
| Doc PR |
Since #30541 the inheritance hierarchy of `\Symfony\Component\BrowserKit\Client` has changed. Notably the test.client no longer is an instance of `\Symfony\Component\BrowserKit\Client`.
This PR uses `class_alias` to fix the class hierarchy similarly as has been done in Twig. In this case I copied the approach of `Twig_TokenParser_AutoEscape` and `\Twig\TokenParser\AutoEscapeTokenParser`
Commits
-------
6a94dea5cd [BrowserKit] Fixed BC-break introduced by rename of Client to Browser
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Serializer] Use name converter when normalizing constraint violation list
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
When using name converter with serializer and the default ConstraintViolationListNormalizer, returned propertyPaths was not converted to the same format.
<!--
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.
-->
Commits
-------
dd93b707cc Use name converter when normalizing constraint violation list
This PR was squashed before being merged into the 4.3-dev branch (closes#28846).
Discussion
----------
[Intl] Simplify API
| Q | A
| ------------- | ---
| Branch? | master
| 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 | #18368
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/issues/11221
Simplifies the Intl API. It greatly reduces the no. of boilerplate classes in this component. Very over complicated, much wow :)
Solving (IMHO):
```php
class LanguageBundle extends LanguageDataProvider implements LanguageBundleInterface
```
Which seems very over complicated just to provide static data.
```php
// before
Intl::getLanguageBundle()->getLanguageName() // string | null
// after
Languages::getName() // string
Languages::exists() // bool
```
I left out Canonicalization on puropose, that's a new topic to me.
- [x] Languages
- [x] Locales
- [x] Currencies
- [x] Regions
- [x] Scripts
- [ ] Timezones (#28831)
- [x] Update constraints
- [x] Update form types
Thoughts?
Commits
-------
d6b67d469a [Intl] Simplify API
* 4.2:
Skip testing the phpunit-bridge on not-master branches when $deps is empty
more tests
[DI] Fixes: #28326 - Overriding services autowired by name under _defaults bind not working
[DI] fix removing non-shared definition while inlining them
* 3.4:
Skip testing the phpunit-bridge on not-master branches when $deps is empty
more tests
[DI] Fixes: #28326 - Overriding services autowired by name under _defaults bind not working
This PR was merged into the 4.2 branch.
Discussion
----------
[DI] fix removing non-shared definition while inlining them
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29628
| License | MIT
| Doc PR | -
I didn't manage to create a specific test case but this still has 100% coverage for the added lines and fixed the reproducer (and makes sense also :) )
Commits
-------
317e820694 [DI] fix removing non-shared definition while inlining them
This PR was merged into the 3.4 branch.
Discussion
----------
[DI] Overriding services autowired by name under _defaults bind not working
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28326
| License | MIT
This is an implementation of ideas and suggestions of @nicolas-grekas and @GuilhemN.
Commits
-------
7e805eae2b more tests
35a40ace6f [DI] Fixes: #28326 - Overriding services autowired by name under _defaults bind not working
This PR was merged into the 4.3-dev branch.
Discussion
----------
[PhpUnitBridge] Url encoded deprecations helper config
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #28048
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10701
First stab at implementing a new way of configuring the deprecation error handler. Includes a refactoring to keep things manageable.
Rework of #24867, blocked by #29718
TODO:
- [x] make the code 5.5 compatible 😢
- [x] add more tests
- [x] deprecate modes (using echo :P)
- [x] test this on real life projects and add some screenshots
- [x] docs PR
- [x] handle `strict`
- [x] adapt existing CI config
# Quiet configuration
![quiet](https://user-images.githubusercontent.com/657779/49341318-fa78c900-f64b-11e8-9504-a8a9eac4baf8.png)
# Default configuration
![verbose](https://user-images.githubusercontent.com/657779/49341322-10868980-f64c-11e8-9d90-dc3f6a18c335.png)
Commits
-------
1c73f9cfed [PhpUnitBridge] Url encoded deprecations helper config
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] Document the state object that is passed around by the HttpClient
| 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
In an attempt to make the code of the new HttpClient component more understandable, I've introduced internal classes that document the `$multi` object that is being passed around between *Client and *Response classes.
My goal is to make the code more accessible to potential contributors and static code analyzers.
Commits
-------
20f4eb3204 Document the state object that is passed around by the HttpClient.
This PR was merged into the 4.2 branch.
Discussion
----------
[FrameworkBundle] Fix for Controller DEPRECATED when using composer --optimized
| Q | A |
| --- | --- |
| Branch? | 4.2 |
| Bug fix? | Yes |
| New feature? | No |
| BC breaks? | No |
| Deprecations? | No |
| Tests pass? | Yes |
| Fixed tickets | --- |
| License | MIT |
Using `composer --optimize-autoload` causes `console cache:clear` (without warmup) to give DEPRECATED error, that stays in profiler.
I moved `@trigger_error` from beggining of the file to Controller __consctruct method.
Commits
-------
2ae2fd800d [FrameworkBundle] Fix Controller deprecated when using composer --optimized
Keep to use the same CS in all the Symfony code base.
Use:
```php
$resolver->setDefaults([
'compound' => false
]);
```
Instead of:
```php
$resolver->setDefaults(
[
'compound' => false,
]
);
```
Keep the double split when the method has two or more arguments.
I miss a PSR with this rule.
* 4.2:
Catch empty deprecation.log silently (fixes#31050)
minor: the meaning of the data breach was not correct
Optimize SVGs
property normalizer should also pass format and context to isAllowedAttribute
* 3.4:
minor: the meaning of the data breach was not correct
Optimize SVGs
property normalizer should also pass format and context to isAllowedAttribute
This PR was merged into the 3.4 branch.
Discussion
----------
Optimize SVGs
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | / <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | / <!-- required for new features -->
Used [svgo](https://github.com/svg/svgo) to optimize the svgs. I kept the `viewBox` attribute to keep the aspects when SVGs are rescaled.
I also added `insert_final_newline = false` to the `.editorconfig` file because the newlines are removed from the SVGs and there's only one line left.
Commits
-------
4614cea9d2 Optimize SVGs
This PR was squashed before being merged into the 4.3-dev branch (closes#31073).
Discussion
----------
#30998 Fix deprecated setCircularReferenceHandler call
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30998
| License | MIT
Instead of calling the `setCircularReferenceHandler()` method, it puts the handler in the default context.
Commits
-------
3a680402ce#30998 Fix deprecated setCircularReferenceHandler call
This PR was merged into the 3.4 branch.
Discussion
----------
property normalizer should also pass format and context to isAllowedAttribute
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | found while working on https://github.com/symfony/symfony/pull/30888
| License | MIT
| Doc PR | -
the context and format are optional parameters to `isAllowedAttribute`, but should be forwarded. due to this omission, the PropertyNormalizer was ignoring the 'attributes' context option (and does in version 4 also ignore the 'ignore_attributes' context option - that one is a property on the normalizer class in version 3 and therefore not ignored here)
Commits
-------
13e2fb735d property normalizer should also pass format and context to isAllowedAttribute
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Dotenv] Improve Dotenv messages
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | no
| License | MIT
| Doc PR | no
This PR improves a little bit of some messages from https://github.com/symfony/symfony/pull/31062
The first, passive sentences may be more suitable here because the value couldn't change by itself. It is changed by us - human.
The second, if we use **The default value of $usePutenv" argument of "%s\'s constructor**, we have to pass `__CLASS__` as the second parameter of `sprintf` function instead of `__METHOD__`. So, I suggest using **The default value of $usePutenv" argument of "%s"**.
Finally, the deprecation warning of `Dotenv::__construct()` is very long. Let's separate it into 2 pieces for readable reason.
Commits
-------
e871a6a83a Improve Dotenv messages
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Mailer] fixed roundrobin test one dead which should recover
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | WIP <!-- please add some, will be required by reviewers -->
| License | MIT
| Doc PR | n/a
The Test `testSendOneDeadButRecover` is not checking the recovery part of its job. I fixed that by adding more `send` calls and added another test so that both recoveries (within retry period and not within retry period) are covered.
The `RoundRobinTransport` had a bug where the transport is dead but not yet in the `retryPeriod`. In that case the transport would not have been added back to the stack and thus got lost. Fixed that but that required an additional check if all transports are dead to prevent an infinite loop.
Commits
-------
5d4d4e7a71 fixed roundrobin dead transport which should recover
ccbb171312 fixed roundrobin dead transport which should recover
* 4.2:
fixed bad merge
Show more accurate message in profiler when missing stopwatch
CS Fixes: Not double split with one array argument
[Serializer] Add default object class resolver
Remove redundant animation prefixes
Remove redundant `box-sizing` prefixes
[VarExporter] support PHP7.4 __serialize & __unserialize
Rework firewall access denied rule
MetadataAwareNameConverter: Do not assume that property names are strings
[VarExporter] fix exporting classes with private constructors
fixed CS
Fix missing $extraDirs when open_basedir returns
This PR was squashed before being merged into the 4.3-dev branch (closes#31062).
Discussion
----------
[Dotenv] Deprecate useage of "putenv"
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | n/a
From discussions on https://github.com/symfony/recipes/pull/571, I think it is a good idea to make people opt-in to using `putenv`.
In Symfony 5.0 we will just change the value of the constructor. As an alternative, we could decide we want to remove `putenv` in Symfony 5.0. If so, I would also deprecate `$usePutenv=true`.
Commits
-------
8e45fc043e [Dotenv] Deprecate useage of \"putenv\"
* 3.4:
Show more accurate message in profiler when missing stopwatch
CS Fixes: Not double split with one array argument
Remove redundant animation prefixes
Remove redundant `box-sizing` prefixes
Rework firewall access denied rule
fixed CS
Fix missing $extraDirs when open_basedir returns
This PR was merged into the 3.4 branch.
Discussion
----------
CS Fixes: Not double split with one array argument
| Q | A
| ------------- | ---
| Branch? | 3.4 (master from #31063)
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | None
| License | MIT
| Doc PR | None
Keep to use the same CS in all the Symfony code base.
Use:
```php
$resolver->setDefaults([
'compound' => false
]);
```
Instead of:
```php
$resolver->setDefaults(
[
'compound' => false,
]
);
```
Keep the double split when the method has two or more arguments.
I miss a PSR with this rule.
Commits
-------
a56bf552ad CS Fixes: Not double split with one array argument
This PR was squashed before being merged into the 3.4 branch (closes#31059).
Discussion
----------
Show more accurate message in profiler when missing stopwatch
| Q | A
| ------------- | ---
| Branch? | 3.4+
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31056
| License | MIT
| Doc PR | ~
This adds a message to the profiler if the stopwatch component is not installed, instead of suggesting to check if debug is enabled (even if it is enabled).
I had to add a method in the collector to expose the value collected, which in theory adds a feature. Is there perhaps a way to expose this collected data _without_ a "BC break"? I don't think it breaks anything, though it does make the dependencies on the http-kernel a bit strict. The other solution is to ignore if it's null and only act if it's a boolean (feature detection).
Commits
-------
326aa86d6a Show more accurate message in profiler when missing stopwatch
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Security][TokenInterface] Prepare for the new serialization mechanism
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Continuation of https://github.com/symfony/symfony/pull/30965
Commits
-------
e6455ea2d8 [Security][TokenInterface] Prepare for the new serialization mechanism
Keep to use the same CS in all the Symfony code base.
Use:
```php
$resolver->setDefaults([
'compound' => false
]);
```
Instead of:
```php
$resolver->setDefaults(
[
'compound' => false,
]
);
```
Keep the double split when the method has two or more arguments.
I miss a PSR with this rule.
This PR was squashed before being merged into the 4.3-dev branch (closes#31044).
Discussion
----------
[HttpClient] Do not allow setting both json and body
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30769
| License | MIT
| Doc PR | n/a
This will keep developers from using both the options `$options['body']` and `$options['json']`. Using both results in only json being the body of the request, which might lead to unexpected results.
Commits
-------
601adf5de7 [HttpClient] Do not allow setting both json and body
This PR was squashed before being merged into the 4.3-dev branch (closes#31021).
Discussion
----------
[Cache] Added command for list all available cache pools
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony-docs/issues/9782
| License | MIT
| Doc PR |
Commits
-------
5c210e6fd5 [Cache] Added command for list all available cache pools
This PR was squashed before being merged into the 4.2 branch (closes#31026).
Discussion
----------
[Serializer] Add default object class resolver
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
The commit 1d8b5af3f0 introduce a BC break because before that commit the `extractAttributes` the `$object` can be a string which contain the fully qualified name of an object.
To fix the BC break and preserve the new feature, I suggest to create a default object class resolver if it is not set by the developer.
Commits
-------
dd5b8f16f5 [Serializer] Add default object class resolver
This PR was merged into the 4.2 branch.
Discussion
----------
[Serializer] MetadataAwareNameConverter: Do not assume that property names are strings
| Q | A
| ------------- | ---
| Branch? | 4.2 (class introduced in v4.2.3)
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/api-platform/core/pull/2709
| License | MIT
| Doc PR | n/a
When this class was introduced, there was an assumption made about the type of `propertyNames` and therefore a `: ?string` return type was introduced in the fallbacks/normalization private methods. Because symfony doesn't use strict mode yet (compatibility issues with php IIRC), when using a non-string property name (for example the integer `0` which is a valid property name in an array), it will convert the integer to a string.
This is not good, especially if you have a name converter that returns the given property name (ie no transformation) you'll have it's type changed which isn't correct.
I've discovered this bug while working on adding this name converter in api platform (https://github.com/api-platform/core/pull/2709).
Commits
-------
af1e136ca0 MetadataAwareNameConverter: Do not assume that property names are strings
This PR was merged into the 3.4 branch.
Discussion
----------
[Security] Rework firewall's access denied rule
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ~~#30099~~, #28229
| License | MIT
| Doc PR |
Follow tickets provided above to reproduce bugs. (there are also some project examples)
~~In addition, I'm looking for someone who knows an answer to [this](https://github.com/symfony/symfony/issues/30099#issuecomment-468693492) regarding rework in this PR.~~
Commits
-------
5790859275 Rework firewall access denied rule
Test coverage added in #30997 did a good job of validating previous
behaviour, but didn't adequately cover the new callback logic. Added
coverage for new methods on the Question object.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Config] Deprecate TreeBuilder::root
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? |
| Fixed tickets | #29876
| License | MIT
| Doc PR | —
Alternative idea to #31015. Or is the `root` method still needed?
It would look like this:
![Screenshot 2019-04-09 01 15 04](https://user-images.githubusercontent.com/330436/55762865-fbd85900-5a64-11e9-9680-0870c85d1c09.png)
Commits
-------
ff6bc79eba Deprecate TreeBuilder::root
This PR was merged into the 4.3-dev branch.
Discussion
----------
fix tests
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
* use legacy group when using the deprecated `hinclude_default_template`
templating config option
* conflict with DependencyInjection 4.2 in the HttpKernel component to
be able to rely on five values being retrieved from the values of the
`BoundArgument` class
* let the TwigBundle conflict with versions of FrameworkBundle that do
not ship the `url_helper` service
Commits
-------
682855fa7d fix tests
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Console] Add callback support to Console\Question autocompleter
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | minor edge case, see below
| Deprecations? | no
| Tests pass? | yes (with expanded coverage)
| Fixed tickets | N/A
| License | MIT
| Doc PR | symfony/symfony-docs#11349
Autocompletion is a useful feature, but it's not always possible to anticipate every input the user could provide in advance. For instance, if we're allowing the user to input a path to a file, it's not practical to populate an array with every file and directory in the filesystem, but we can easily build a callback function that populates its suggestions based on the path already inputted.
This change replaces the autocomplete logic that accepts an array of suggestions with an architecture that uses a callback function to populate suggestions in real time as the user provides input.
The first commit adds a test class covering all methods of the `Question` object, while the second commit modifies the `Question` object to accept and store a callback function. The existing `[gs]etAutocompleterValues()` methods are preserved, but instead of being referenced directly from the `QuestionHelper`, they create and call their own callbacks to emulate the current behaviour.
There is one edge case that is changed, as documented in the test: when a `Traversable` object is passed to `setAutocompleterValues()`, the return value of `getAutocompleterValues()` will be the unpacked (array) form of that object rather than the object itself. The unpacking is done lazily and cached on the callback function.
Commits
-------
caad562c11 [Console] Add callback support to Console\Question autocompleter
In order to enable more dynamic use cases such as word-by-word
autocomplete and path-based autocomplete, update the autocomplete logic
of the Question object and its helper to accept a callback function.
This function is called on each keystroke and should return an array of
possibilities to present to the user.
The original logic only accepted an array, which required
implementations to anticipate in advance all possible input values.
This change is fully backwards-compatible, but reimplements the old
behaviour by initializing a "dumb" callback function that always returns
the same array regardless of input.
* use legacy group when using the deprecated `hinclude_default_template`
templating config option
* conflict with DependencyInjection 4.2 in the HttpKernel component to
be able to rely on five values being retrieved from the values of the
`BoundArgument` class
* let the TwigBundle conflict with versions of FrameworkBundle that do
not ship the `url_helper` service
This PR was squashed before being merged into the 4.3-dev branch (closes#30978).
Discussion
----------
[HttpClient] Allow the HTTP_PROXY environment variable lookup with phpdbg
| 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
`phpdbg` and `embed` are two other legit PHP SAPI's hence should be allowed.
Commits
-------
fbd439e0bd [HttpClient] Allow the HTTP_PROXY environment variable lookup with phpdbg
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] for Psr18HttpClient configuration
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
No need for autowiring actually here.
Commits
-------
bf89907dce [FrameworkBundle] for Psr18HttpClient configuration
This PR was merged into the 4.2 branch.
Discussion
----------
[Console] fix buildTableRows when Colspan is use with content too long
| Q | A
| ------------- | ---
| Branch? | 4.2 for bug fixes
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes ( new test added TableTest::testWithColspanAndMaxWith)
| Fixed tickets | https://github.com/symfony/symfony/issues/30701
| License | MIT
| Doc PR | no
<!-- fix for keeping ColumnMaxwith when Content is too long
Commits
-------
1cf9659b5f fix buildTableRows when Colspan is use with content too long
This PR was merged into the 4.2 branch.
Discussion
----------
[Serializer] take setIgnoredAttributes() deprecation into account
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
4134be127a take setIgnoredAttributes() deprecation into account
* 4.2:
[serializer] validate that the specified callbacks and max_depth_handler are actually callable
[Serializer] Respect ignored attributes in cache key of normalizer
fix resetting the COLUMN environment variable
Fix TestRunner compatibility to PhpUnit 8
Fix dark themed componnents
prevent mixup of the object to populate
This PR was squashed before being merged into the 4.3-dev branch (closes#30959).
Discussion
----------
[FrameworkBundle] [TwigBundle] Move the hinclude key away from templating
| Q | A
| ------------- | ---
| Branch? | master
| 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 | #30874 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | to do when pr is validated.
<!--
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.
-->
Maybe I shouldn't move directly the config key from templating to the other, but since the templating component has been deprecated we may change this directly without deprecating that key alone, WDYT ?
Commits
-------
4f39339fec [FrameworkBundle] [TwigBundle] Move the hinclude key away from templating
* 3.4:
[Serializer] Respect ignored attributes in cache key of normalizer
fix resetting the COLUMN environment variable
Fix TestRunner compatibility to PhpUnit 8
prevent mixup of the object to populate
This PR was squashed before being merged into the 3.4 branch (closes#30907).
Discussion
----------
[Serializer] Respect ignored attributes in cache key of normalizer
EUFOSSA
| Q | A
| ------------- | ---
| Branch | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Do not share the attributes cache in object normalizer when using a different setting for the ignoredAttributes setting.
In Symfony 4.2, the setter is deprecated in favor of the ignored_attibutes option in the $context. When merging this up, we will however still need to respect the field as well for BC, the cache key does not look at the default context (apart from the deprecated modifiers, the default context is immutable)
There might be performance regression for some use cases, but also could be a performance improvement when using 'attributes' in the context with lists of objects of the same class.
Commits
-------
926d228877 [Serializer] Respect ignored attributes in cache key of normalizer
This PR was squashed before being merged into the 4.3-dev branch (closes#30973).
Discussion
----------
[WebProfiler] Fix Javascript error when using custom stopwatch categories
Fixes#30745
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30745
| License | MIT
Made the getter do lazy creation so it can dynamically adapt to whatever it's given.
Commits
-------
e991472a76 [WebProfiler] Fix Javascript error when using custom stopwatch categories
This PR was squashed before being merged into the 3.4 branch (closes#30085).
Discussion
----------
Fix TestRunner compatibility to PhpUnit 8
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | related to: #30055
| License | MIT
| Doc PR | -
Modify the installed phpunit version to be compatibility with the symfony custom TestRunner. This is sure not the best way but maybe currently the fastest way to support PhpUnit 8. The hack should be removed as soon as there is another way to implement a custom Runner.
Commits
-------
a0c66a399d Fix TestRunner compatibility to PhpUnit 8
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Security] Add Argon2idPasswordEncoder
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #28093
| License | MIT
| Doc PR | TODO
Currently we have a `Argon2iPasswordEncoder` that may hash passwords using `argon2id` instead of `argon2i` (platform-dependent) which is not good.
This deprecates producing/validating `argon2id` hashed passwords using the `Argon2iPasswordEncoder`, and adds a `Argon2idPasswordEncoder` able to produce/validate `argon2id` hashed passwords only.
#EUFOSSA
Commits
-------
0c82173b24 [Security] Add Argon2idPasswordEncoder
This PR was merged into the 3.4 branch.
Discussion
----------
[serializer] prevent mixup in normalizer of the object to populate
EUFOSSA
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
OBJECT_TO_POPULATE is meant to specify the top level object. The implementation left the option in the context and it would be used whenever we have the first element that matches the class. #30607 (to master) introduces the feature to also keep the instances of attributes to deeply populate an existing object tree. In both cases, we do not want the mix up to happen with what the current OBJECT_TO_POPULATE is.
Commits
-------
fdb668e051 prevent mixup of the object to populate
This PR was merged into the 4.3-dev branch.
Discussion
----------
Prepare for the new serialization mechanism
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
#eufossa
Should I maybe split this component by component ?
https://wiki.php.net/rfc/custom_object_serialization has been accepted.
Best viewed in "split" mode.
This work is kind of required for https://github.com/symfony/symfony/issues/30304 so we don't trigger 30 deprecations from our own code base.
Commits
-------
d412e77a9c Prepare for the new serialization mechanism
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Mailer] allow user/pass on dsn while using failover/roundrobin
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
this PR provides two things:
1. It is possible now to user `username` and `password` in a failover or round robin transport when using smtp
2. Fixed a type problem with `username` and `password` for the smtp transport as `getUsername()` cannot return `null` because of its signature but if no `username` is provided then the property would have been `null`. Fixed with setting an empty string as default. Same for `password`. (This was discovered by adding a test - yeah!)
Commits
-------
4518ac56a1 allow user/pass on dns while using failover/roundrobin and type fix for username/password
This PR was merged into the 3.4 branch.
Discussion
----------
Make tests independent from each other
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | n/a
Environment variables set in a test need to be restored to their
previous values or unset if we want to be able to run tests
independently.
Credits to @ostrolucky for spotting this issue, I'm available for help when merging this in more recent branch (issues may appear then).
Created during the EU-FOSSA hackathon
Commits
-------
00883fc409 Make tests independent from each other
This PR was merged into the 4.3-dev branch.
Discussion
----------
Allow env processor to resolve `::`
| 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 | N/A
The env processor resolve to null when no fallback are provided. ie. `env(default::NOT_EXISTS)`
Issue is that the regexp does not allow such pattern. thus made the feature unusable.
Commits
-------
6b6c24c618 Allow env processor to resolve `::`
* 4.2:
fix tests
fix PHPUnit 4.8 compatibility
[Debug] Fixed error handling when an error is already handled when another error is already handled (5)
sync validator translations
* 3.4:
fix PHPUnit 4.8 compatibility
[Debug] Fixed error handling when an error is already handled when another error is already handled (5)
sync validator translations
This PR was merged into the 3.4 branch.
Discussion
----------
[Debug] Fixed error handling when an error is already handled when another error is already handled (5)
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
---
Please, don't ask how to reproduce it :)
Commits
-------
a36c7315f4 [Debug] Fixed error handling when an error is already handled when another error is already handled (5)
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DoctrineBridge] Deprecated using IdReader when optimization is not possible
| Q | A
| ------------- | ---
| Branch? | master
| 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 | ~
| License | MIT
| Doc PR | ~
Follow up of #30962. (Review only the second commit until #30962 is merged).
Commits
-------
a234c8913e [DoctrineBridge] Deprecated using IdReader when optimization is not possible
This PR was squashed before being merged into the 3.4 branch (closes#30979).
Discussion
----------
Fix the configurability of CoreExtension deps in standalone usage
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | not yet, but will allow fixing them
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
When using the Forms entrypoint to configure the component, there was no chance to configure dependencies of the CoreExtension, as the one registered without argument was first and would win.
The builder now delays the prepending of the CoreExtension to do it only if the CoreExtension is not registered explicitly.
We discovered that when trying to fix tests for the FileType, where we wanted to pass a Translator to it.
Commits
-------
934118b131 Fix the configurability of CoreExtension deps in standalone usage
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Serializer] Experimental for ObjectListExtractor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30904
| License | MIT
| Doc PR | -
Related to #30818
I want to mark this class as `@expiremental` until we have the full refactoring done of the Serializer, also this would allow change needed if some behavior was not correctly taken into care in 4.3
Mark also `final` for the default implementation as we don't want that to be extendable and user should use composition over inheritance.
Commits
-------
b0cdf45464 Set object list extractor as expiremental, and use final for default implementation
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Routing][ObjectRouteLoader] Allow invokable route loader services
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/11333
#eufossa
Fall back by default on the `__invoke` method when it is not configured.
Using a regex is easier to check that the format is valid, at least for the time we have to supports the single column notation.
TODO :
- [x] Changelog entry
- [x] Doc PR
Commits
-------
5bf7ad44e1 [Routing][ObjectRouteLoader] Allow invokable route loader services
This PR was merged into the 3.4 branch.
Discussion
----------
[Cache] fix using ProxyAdapter inside TagAwareAdapter
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30400
| License | MIT
| Doc PR | -
EUFOSSA
After some debugging this is my first attempt to fix this issue @nicolas-grekas 😊 Let's discuss it.
without the fix the test fails like this:
```
Testing Symfony\Component\Cache\Tests\Adapter\TagAwareAndProxyAdapterIntegrationTest
F 1 / 1 (100%)
Time: 28 ms, Memory: 4.00MB
There was 1 failure:
1) Symfony\Component\Cache\Tests\Adapter\TagAwareAndProxyAdapterIntegrationTest::testIntegration
Failed asserting that Array &0 (
'tag1' => 0
'tag2' => 0
) is identical to 'bar'.
/var/www/symfony/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAndProxyAdapterIntegrationTest.php:26
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
Commits
-------
98b9be9b6a [Cache] fix using ProxyAdapter inside TagAwareAdapter
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DIC] Add a `require` env var processor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | symfony/symfony-docs#11313
This adds a new `require` processor that will `require()` the PHP file given as input value and return the value `return`ed from that file. Leverages opcaching (yay!).
#EUFOSSA
Commits
-------
03da3a22b1 Add a `require` env var processor
This PR was squashed before being merged into the 4.3-dev branch (closes#30964).
Discussion
----------
[HttpKernel] Add a "short" trace header format, make header configurable
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | symfony/symfony-docs#11340
This pull requests adds the first usage of `array_key_first` to the Symfony code base. Additionally, it makes it possible to configure the `HttpCache` to also add a "trace" header in production.
The `HttpCache` is a convenient, low-barrier yet performant way of accelerating the application. By having the "trace" information returned as a header in production as well, you can write it to server log files. For example, with Apache you can use `%{X-Symfony-Cache}o` in the `LogFormat` directive to log response headers.
With the information in the log files, you can easily process it from logfile processing/system metrics tools to find out about cache performance, efficiency and the URLs that might need extra cache tweaking.
<img width="1040" alt="Bildschirmfoto 2019-04-07 um 11 43 23" src="https://user-images.githubusercontent.com/1202333/55681763-6e90e980-592a-11e9-900f-e096350531c2.png">
The "short" format will only output information for the main request to avoid leaking internal URLs for ESI subrequests. I also chose a concise format like `stale/valid/store` because that's much easier to parse out of logfiles (no whitespace, no need for quotes etc.).
If you're not comfortable with having `Symfony` in the header name that way, the header name can be changed through a configuration setting as well.
#FOSSHackathon
Commits
-------
9a2fcc9392 [HttpKernel] Add a \"short\" trace header format, make header configurable
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DI] Fix bad error message for unused bind under _defaults
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27828
| License | MIT
**Sidenote**: I originally included the fix in #29897, but I decided to close the previous PR and divide it into two separate PRs for clarity.
**Description:**
With this fix, the message regarding an unused bind will have a clear information about the type of the bind (defined under __defaults_, __instanceof_ or _per service_), as well as the name of the file, in which it was configurated. It's for, both, YAML and XML configurations.
For the core team, please note, that the fix assumes a possibility of definings binds under __instanceof_, which was introduced in #27806. But since fixes are merged into other branches, I thought that it might be necessary to inlude this possibility. If this case requires making separate fixes for different branches, I will gladly do it.
Commits
-------
35bf4203e8 [DI] Fix bad error message for unused bind under _defaults
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader
| Q | A
| ------------- | ---
| Branch? | master
| 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 | ~
| License | MIT
| Doc PR | ~
#EUFOSSA
Big thanks to @stof for the help with writing the test!
## Description
It happens that the `IdReader` is created by the `DoctrineType` and cached for each entity class case.
But the type already resolves whether or not it should use it, only when we can optimize query thanks to a single id field when defining the `choice_value` option: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php#L188.
This PR is a first step to optimize the choice loading process.
Commits
-------
287c39b9ea [DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader
* 4.2:
fix translating file validation error message
[Validator] Add missing Hungarian translations
Improving deprecation message of the Twig templates directory src/Resources/views
[3.4] [Validator] Add missing french validation translations.
[Validator] Only traverse arrays that are cascaded into
Handle case where no translations were found
[Validator] Translate unique collection message to Hungarian
fix tests
Run test in separate process
Use a class name that does not actually exist
[Profiler] Fix dark theme elements color
fix horizontal spacing of inlined Bootstrap forms
[Translator] Warm up the translations cache in dev
turn failed file uploads into form errors
* 3.4:
fix translating file validation error message
[Validator] Add missing Hungarian translations
[3.4] [Validator] Add missing french validation translations.
[Validator] Only traverse arrays that are cascaded into
Handle case where no translations were found
[Validator] Translate unique collection message to Hungarian
fix tests
Run test in separate process
Use a class name that does not actually exist
fix horizontal spacing of inlined Bootstrap forms
[Translator] Warm up the translations cache in dev
turn failed file uploads into form errors
This PR was merged into the 4.3-dev branch.
Discussion
----------
Fix Lock test suite
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | na
| License | MIT
| Doc PR | na
Commits
-------
1f66e7b2be Fix Lock test suite
This PR was squashed before being merged into the 4.3-dev branch (closes#30862).
Discussion
----------
[Routing] UrlHelper to get absolute URL for a path
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | todo
I noticed that I need to generate absolute urls quite often. For example when normalizing uploads in API. I found Twig's `absolute_url()` really helpful, but obviously `Symfony\Bridge\Twig\Extension\HttpFoundationExtension` cannot be used as a normalizer's argument service.
In this PR I propose to extract `HttpFoundationExtension::generateAbsoluteUrl` and `HttpFoundationExtension::generateRelativePath` to separate interfaces which could be used on their own. Although this could be just a final class helper, I thought that we might leave a possibility for decoration here. That's why I created interfaces.
- [x] Split `HttpFoundationExtension` into two interfaces
- [x] Deprecate `HttpFoundationExtension::generateAbsoluteUrl` and `HttpFoundationExtension::generateRelativePath`
- [x] Add service definitions
- [x] Fix tests
- [ ] Add docs
Commits
-------
388d8f548c [Routing] UrlHelper to get absolute URL for a path
This PR was squashed before being merged into the 4.3-dev branch (closes#30607).
Discussion
----------
[Serializer] Add Support of recursive denormalization on object_to_populate
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | Pending
| Fixed tickets | #21669
| License | MIT
| Doc PR | Pending
Currently the deserialization re-create new sub-object with object_to_populate.
This option permit to make object_to_populate recursive.
Commits
-------
5b723865b1 [Serializer] Add Support of recursive denormalization on object_to_populate
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] drop not needed "constant" type argument
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
#FOSSHackathons #EUFOSSA
Commits
-------
faf629386e drop not needed "constant" type argument
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Translate unique collection message to Hungarian
| 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 | -
<!--
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.
-->
Commits
-------
6a732dc031 [Validator] Translate unique collection message to Hungarian
This PR was merged into the 3.4 branch.
Discussion
----------
Handle case where no translations were found
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Right now, the program emits a warning when trying to use max() on an
empty array.
Commits
-------
79b1fb8333 Handle case where no translations were found
This PR was squashed before being merged into the 4.3-dev branch (closes#30429).
Discussion
----------
[Form] group_by as callback returns array
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30315
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Commits
-------
4c04601036 [Form] group_by as callback returns array
This PR was squashed before being merged into the 3.4 branch (closes#29800).
Discussion
----------
[Validator] Only traverse arrays that are cascaded into
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27090
| License | MIT
| Doc PR | -
Previously, array properties were traversed even if they were not annotated `Valid`.
Commits
-------
7db9200279 [Validator] Only traverse arrays that are cascaded into
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] fix search in debug autowiring
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #30493 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR |
<!--
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.
-->
Taking #30522 and finishing it with @nicolas-grekas comments.
Is the sentence ok ?
Commits
-------
fec4beaffc fix debug:autowiringcommand
This PR was merged into the 4.3-dev branch.
Discussion
----------
Use env variable to create anytype of lock store
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27555
| License | MIT
| Doc PR | NA
In lock configuration, at the moment, env variable are only able to resolve DNS which are able to create RedisStore and MemcachedStore.
This PR update the StoreFactory to be able to also create connection at runtime.
Commits
-------
6b57ea996c Use env variable to create anytype of lock store
This test calls code that defines some environment variables, which in
turn trigger the registration of a the deprecation error handler, which
causes unexpected issues when testing other components.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Serializer] add return type hints for ObjectPropertyListExtractorInterface
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
@nicolas-grekas as just discussed here the type-hint + phpdoc cleanup as follow-up for https://github.com/symfony/symfony/pull/30904😉
cc @joelwurtz
Commits
-------
7628972285 [Serializer] add return type hints for ObjectPropertyListExtractorInterface
Using "Foo", a class name that corresponds to no less than 22 fixture
classes, results in the first found "Foo" being loaded when one is
found by the ClassNotFoundFatalErrorHandler error handler, I am not sure
exactly why, but it is not really a big issue because this is a fatal
error handler and execution is not supposed to continue after that.
Except that is very much the case when running the whole test suite
sequentially with ./phpunit . Then we arrive to the DI component test
suite, and a failure happens because \\foo was not supposed to be defined:
> Failed asserting that exception message 'The definition for "\foo" has
> no class attribute, and appears to reference a class or interface in the
> global namespace. Leaving out the "class" attribute is only allowed for
> namespaced classes. Please specify the class attribute explicitly to get
> rid of this error.' contains 'The definition for "\foo" has no class.'.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Uses an `AmqpStamp` to provide flags and attributes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28885
| License | MIT
| Doc PR | ø
Using the `AmqpStamp` you can configure the flags and any attribute (such as `delivery_mode`).
Commits
-------
56fa574023 Uses an `AmqpStamp` to provide flags and attributes
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Mime][BrowserKit] Add FormUrlEncoded - Fix content-type in HttpBrowserPost
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30867
| License | MIT
| Doc PR | NA
This PR use the content-type `x-www-form-urlencoded` when posting a form with the HttpBrowser.
Commits
-------
aecca9778e Use FormUrlEncoded when posting non-binary data
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] Removed undefined variable
| 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 variable `$noProxy` is accessed here before it is defined.
`EU-FOSSA`
Commits
-------
69f0a0b3bf Removed undefined variable.
This PR was squashed before being merged into the 4.3-dev branch (closes#28937).
Discussion
----------
Improve Translator caching
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27600
| License | MIT
| Doc PR | N/A
Add DirectoryResources to MessageCatalogues when loaded.
So that when a file is added to one of the directories the cache for all MessageCatalogues will be invalidated.
All directories must be added to all MessageCatalogues because we can't predict for which locale files will be added to each individual directory.
Also, now that the translator keeps track of its own directories for caching the container no longer needs to it. This means that when a translation changes or is added the container no longer needs to be fully rebuilt, saving a considerable amount of time (compilation time went down from ~4 seconds to ~1 second on each translation change/add in our project).
Commits
-------
a5246589cf Improve Translator caching
This PR was squashed before being merged into the 4.3-dev branch (closes#30916).
Discussion
----------
[Profiler] Update ProfilerController.php
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- 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.
-->
Commits
-------
6e0785f8c5 [Profiler] Update ProfilerController.php
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Serializer] provide new ObjectPropertyListExtractorInterface
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | related to https://github.com/symfony/symfony/issues/30818
| License | MIT
| Doc PR | -
EUFOSSA Hackathon
As discussed with @joelwurtz this adds a new `ObjectPropertyListExtractorInterface` and a default implementation.
See https://github.com/symfony/symfony/issues/30818
> A new interface will be provided ObjectPropertyListExtractorInterface (name can change), that allow getting attributes based on an object. A default implementation will be provided that use the PropertyListExtractorInterface and a class resolver, as the latter one only rely on class name, it may be important to have this distinction (this will allow features that rely on a specific value of the object to get the current property list, like exclusion policy)
Commits
-------
997270f7ac [Serializer] provide new ObjectPropertyListExtractorInterface
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Workflow] The TransitionEvent is able to modify the context
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
EUFOSSA
ping @HeahDude
Commits
-------
62ab775154 [Workflow] The TransitionEvent is able to modify the context
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Workflow] Added workflow_transition_blockers twig function
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony-docs/pull/11268
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/11268
EUFOSSA
---
also related to https://github.com/symfony/symfony/issues/26689
I'm not a big fan of the current name. What should I pick?
cc @javiereguiluz
Commits
-------
a2f99757f1 [Workflow] Added workflow_transition_blockers twig function
This PR was merged into the 4.3-dev branch.
Discussion
----------
Add "input" option to NumberType
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #24793
| License | MIT
| Doc PR | TODO
This PR replaces #24793 in (partially) fixing how Doctrine's DECIMAL type is handled by the Form component.
Previously, DECIMAL was mapped to the regular NumberType. That confuses Doctrine's change detection, depending on the DB platform.
Examples:
| DB | DB value | Doctrine entity before submit | Form input | Doctrine entity after submit
| --- | --- | --- | --- | ---
| SQLite | 8.000 | '8' | 8 | 8
| SQLite | 8.123 | '8.123' | 8.123 | 8.123
| PostgreSQL | 8.000 | '8.000' | 8 | 8
| PostgreSQL | 8.123 | '8.123' | 8.123 | 8.123
The value in the Doctrine entity changes before and after submit. Hence Doctrine believes an update is necessary.
This PR introduces an `input` option to NumberType (similar to DateType), that can be set to `'number'` (default) or `'string'`. If set to `'string'`, the conversion is as follows:
| DB | DB value | Doctrine entity before submit | Form input | Doctrine entity after submit
| --- | --- | --- | --- | ---
| SQLite | 8.000 | **'8'** | 8 | **'8.000'**
| SQLite | 8.123 | '8.123' | 8.123 | '8.123'
| PostgreSQL | 8.000 | '8.000' | 8 | '8.000'
| PostgreSQL | 8.123 | '8.123' | 8.123 | '8.123'
You see that this does not completely solve this issue for SQLite. However, @Ocramius and I agree that this is something to be fixed by Doctrine, since Doctrine is providing the database abstraction.
That fix should be done in the SqlitePlatform object in Doctrine as part of another PR and should be backwards compatible with the current Doctrine version (i.e. opt in via configuration).
Compared to #24793, this PR does not introduce a new type but instead makes the NumberType more flexible. Also, this PR does not introduce the `force_full_scale` option since that should be solved by Doctrine as described above.
Commits
-------
3f25734647 Added new option "input" to NumberType
fb2b37a8f3 add force_full_scale option to handle all cases
40f25121c3 [DoctrineBridge] Add decimal form type
This PR was merged into the 4.3-dev branch.
Discussion
----------
Move doctrine/collections to an optional dep in doctrine-bridge
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR |
The EntityType does not need to convert the array to a collection if the project does not care about using doctrine/collections. So this can become an optional dependency.
The goal here is to reduce the dependencies of DoctrineBundle when using it in DBAL-only mode.
doctrine/persistence still brings a bunch of unwanted dependencies for a DBAL-only project, but this requires work on the Doctrine side (we discussed it with @alcaeus) as the ConnectionRegistry is part of it. Moving it to an optional dependency in the bridge will probably come in 6 months instead.
And doctrine-cache-bundle also brings some, but that's already in the work of being removed from DoctrineBundle 2.0.
Commits
-------
07d90f987e Move doctrine/collections to an optional dep in doctrine-bridge
This PR was merged into the 3.4 branch.
Discussion
----------
[Translator] Warm up the translations cache in dev
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR fixes a bug in development when using the DataCollectorTranslator: because it's not implementing WarmableInterface, the translations cache is not built during cache:clear during development.
Commits
-------
a5f1afca15 [Translator] Warm up the translations cache in dev
The EntityType does not need to convert the array to a collection if
the project does not care about using doctrine/collections. So this
can become an optional dependency.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Workflow] Changed initial_places to initial_marking, added property
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #30662 and #30656
| License | MIT
| Doc PR | https://github.com/symfony/symfony/issues/30656
EUFOSSA
---
* [Workflow] Changed initial_places to initial_marking, added property instead of type
* [Workflow] Finished integration of initial_marking + deprecated support for workflow + single state markin store
[Workflow] Deprecate worflow and single state marking
---
Here is an exemple of deprecation:
```
3x: Passing something else than "method" has been deprecated in Symfony 4.3.
1x in PhpFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
1x in XmlFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
1x in YamlFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
3x: The "framework.workflows.workflows.legacy.marking_store.arguments" configuration key has been deprecated in Symfony 4.3. Use "property" instead.
1x in PhpFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
1x in XmlFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
1x in YamlFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
3x: The "framework.workflows.workflows.legacy.initial_place" configuration key has been deprecated in Symfony 4.3, use the "initial_marking" configuration key instead.
1x in PhpFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
1x in XmlFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
1x in YamlFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
```
Commits
-------
039353546f [Workflow] Deprecate worflow and single state marking
87839cfaf9 [Workflow] Finished integration of initial_marking + deprecated support for workflow + single state markin store
73708a61b6 [Workflow] Changed initial_places to initial_marking, added property instead of type
This PR was merged into the 3.4 branch.
Discussion
----------
[DependencyInjection] Fix a wrong error when using a factory
…d a call
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #30885 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR |
<!--
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.
-->
This a work in progress, it needs tests, firstly I wanted to ask the author to test and tell if it's ok.
Commits
-------
5d4e3a2d57 [WIP] [DependencyInjection] Fix a wrong error when using a factory and a call
This PR was squashed before being merged into the 4.3-dev branch (closes#30906).
Discussion
----------
[symfony/HttpKernel] Throws an error when the generated class name is invalid.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30845
| License | MIT
Commits
-------
c976866566 [symfony/HttpKernel] Throws an error when the generated class name is invalid.
Whenever libxml_use_internal_errors() is called, the previous value for
it should be restored. This used to be the case in this piece of code,
but it was wrongly removed in e53bf5839b ,
which has the nasty side effect of making the Validator component test
suite break with this message:
Validation failed: No DTD found!
This PR was merged into the 4.2 branch.
Discussion
----------
[Messenger] Uses the `SerializerStamp` when deserializing the envelope
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29970
| License | MIT
| Doc PR | ø
Uses the `SerializerStamp` when decoding the message.
Commits
-------
ab55e8e7ef Uses the SerializerStamp when deserializing the envelope
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DomCrawler] Improve Crawler HTML5 parser need detection
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | kind of
| New feature? | no
| BC breaks? | no
| Deprecations? | no>
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Live from #eu-fossa
Follow up of https://github.com/symfony/symfony/pull/29306
This PR introduces a better detection mechanism to choose when to parse using the HTML5 parser or not, and fix a subcrawler parsing issue as well.
@stof I'd be super interested by your review :) !
Commits
-------
9bbdab68ef [DomCrawler] Improve Crawler HTML5 parser need detection
This PR was squashed before being merged into the 4.3-dev branch (closes#30901).
Discussion
----------
Renamed NotPwned to NotCompromisedPassword
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | -
| License | MIT
| Doc PR | -
<!--
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.
-->
Commits
-------
2f648b04ae Renamed NotPwned to NotCompromisedPassword
* 4.2: (45 commits)
[Form] various minor fixes
Ensure the parent process is always killed
bugfix: the terminal state was wrong and not reseted
[Console] Fix inconsistent result for choice questions in non-interactive mode
Define null return type for Constraint::getDefaultOption()
[Routing] Fix: annotation loader ignores method's default values
[HttpKernel] Fix DebugHandlersListener constructor docblock
Skip Glob brace test when GLOB_BRACE is unavailable
bumped Symfony version to 4.2.6
updated VERSION for 4.2.5
updated CHANGELOG for 4.2.5
bumped Symfony version to 3.4.25
updated VERSION for 3.4.24
update CONTRIBUTORS for 3.4.24
updated CHANGELOG for 3.4.24
[EventDispatcher] cleanup
fix testIgnoredAttributesInContext
Re-generate icu 64.1 data
Improve PHPdoc / IDE autocomplete for config tree builder
[Bridge][Twig] DebugCommand - fix escaping and filter
...
* 3.4:
[Form] various minor fixes
bugfix: the terminal state was wrong and not reseted
[Console] Fix inconsistent result for choice questions in non-interactive mode
Define null return type for Constraint::getDefaultOption()
[HttpKernel] Fix DebugHandlersListener constructor docblock
Skip Glob brace test when GLOB_BRACE is unavailable
bumped Symfony version to 3.4.25
updated VERSION for 3.4.24
update CONTRIBUTORS for 3.4.24
updated CHANGELOG for 3.4.24
[EventDispatcher] cleanup
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] Php doc fixes and cs + optimizations
| Q | A
| ------------- | ---
| Branch? | 3.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? | no <!-- 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 | ~
| License | MIT
| Doc PR | ~
<!--
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.
-->
Some micro optimizations may target master with some profiling but I would like some reviews first. Thanks!
Commits
-------
56429a6f08 [Form] various minor fixes
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Ensure message is handled only once per handler
Add check to ensure that a message is only handled once per handler
Add try...catch to run all handlers before throwing exception
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? |no
| Tests pass? | yes
| Fixed tickets | #27215
| License | MIT
| Doc PR | Todo
This would make error handling and retrying of messages much more easier. As statet here https://github.com/symfony/symfony/pull/27008#issuecomment-384677065 there is currently no way to retry a for all failed handlers if there are mutliple handlers and just some throw an exception.
Also if an Exception in an handler occurs the execution chain is disrupted and the other handlers are never invoked.
With this change it is easily possible to create an userland middleware that catches the `ChainedHandlerFailedException` and does some custom retry logic. If you ensure that the `HandledStamps` on the `Envelope` are preserved the message will be handled just by the failed handlers
Commits
-------
2e5e910229 Rename exception, add change log and a few other things
e6e4cde5fc Ensure message is handled only once per handler
This PR was merged into the 4.3-dev branch.
Discussion
----------
[messenger] Adds a stamp to provide a routing key on message publishing
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29950
| License | MIT
| Doc PR | symfony/symfony-docs#11236
Adds a stamp allowing to set a `routing_key` at `MessageBus::dispatch()` level.
```php
$message = (new Envelope('message'))->with(new RoutingKeyStamp('routing_key'));
$bus->dispatch($message);
```
Commits
-------
a515635f18 Simply code and rename "configuration" to "options"
3151b54b7a [messenger] AMQP configurable routing key & multiple queues
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Workflow] Fixed initial places when no places are configured
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? |
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
EUFOSSA
I introduced a BC break in #30468 and this PR fix it.
With the full stack framework, when one does not configure the
initial_place(s) the DIC set `[]` for the initial values.
So it removes the initials values guessed in `Definition::addPlace()`
Commits
-------
76fd9c35b7 [Workflow] Fixed initial places when no places are configured
I introduced a BC break in #30468 and this PR fix it.
With the full stack framework, when one does not configure the
initial_place(s) the DIC set `[]` for the initial values.
So it removes the initials values guessed in `Definition::addPlace()`
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Make MessengerPass less strict when auto-register handlers
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
| Doc PR | not needed
This allows you to auto-register handlers that have more than one argument, which is useful when having custom middleware to pass more parameters.
#symfonyconhackday2018
Commits
-------
49ab2cd9d9 Make MessengerPass less strict when auto-register handlers
This PR was merged into the 3.4 branch.
Discussion
----------
[Console] Fix stty not reset when aborting in QuestionHelper::autocomplete()
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #30861 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | none
<!--
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.
-->
Commits
-------
f54389b95c bugfix: the terminal state was wrong and not reseted
If you try to run the test suite but do not have a redis instance
running, the parent process that was supposed to be killed will never be
as the thing being thrown is not an exception.
This results in the test suite hanging forever at the end.
In this patch, the exception is thrown again, and then caught in the trait, and
the parent gets killed as it should.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] test DoctrineTransport on travis and appveyor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes ? WIP
| Fixed tickets |
| License | MIT
| Doc PR |
Currently tests on the `Symfony\Component\Messenger\Tests\Transport\Doctrine\DoctrineIntegrationTest` are skipped because there is no `MESSENGER_DOCTRINE_DSN` environment variable is not defined.
This PR update the travis and AppVeyor configuration to run these tests.
This is a WIP. I'm not a Travis/AppVeyor user so this clearly need more work
Commits
-------
8f81f55a46 [Messenger] test DoctrineTransport on travis and appveyor
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Fixed DIC config when the messenger is not installed
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
EUFOSSA
---
Fix:
```
In getConsole_Command_MessengerStopWorkersService.php line 9:
Attempted to load class "StopWorkersCommand" from namespace "Symfony\Component\Messenger\Command".
Did you forget a "use" statement for another namespace?
```
Commits
-------
292021b146 [Messenger] Fixed DIC config when the messenger is not installed
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Add a "in-memory://" transport
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29040
| License | MIT
| Doc PR | Todo
Add a new `InMemoryTransport` for test purpose, usable by starting your DSN by `in-memory://`
Commits
-------
8f8c82e009 Make the in-memory transport resettable
fe759205c5 Add a "null://" transport
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] logger integration
| Q | A
| ------------- | ---
| Branch? | master
| 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 | #30502 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR |
Commits
-------
26d15c8bbe [HttpClient] log requests, responses and pushes when they happen
fc6ba7efad [HttpClient] logger integration
This PR was squashed before being merged into the 4.3-dev branch (closes#30757).
Discussion
----------
[Messenger] Adding MessageCountAwareInterface to get transport message count
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | symfony/symfony-docs#11236
This adds a new optional interface that receivers should implement to give an approximate number of the messages "waiting" to be handled. Why? Because, with this, you could design a system that dynamically adds/removes worker processes if a specific transport is getting slammed and needs help. Creating that system could be something we discuss for core later, but this at least makes it possible - and means it could be implemented by the user or in a bundle... which I might do if we don't get it in core ;).
Commits
-------
fc5b0cf570 [Messenger] Adding MessageCountAwareInterface to get transport message count
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpKernel][Framework] Locale aware services
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Added a `LocaleAwareInterface` (and also a new service tag `kernel.locale_aware`) to be implemented on services that require the current locale at request time.
Also, refactored the actual Translator service to implement the overmentioned interface
Todo :
* [ ] Documention PR (will be written after some feedback)
Commits
-------
b9ac645d8b Locale aware service registration
This PR was squashed before being merged into the 4.3-dev branch (closes#29306).
Discussion
----------
[DomCrawler] Optionally use html5-php to parse HTML
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | WIP
| Fixed tickets | https://github.com/symfony/symfony/issues/29280, https://github.com/symfony/symfony/issues/28596
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10700
This PR introduces the possibility to parse HTML content in the Crawler using the html5-php library (https://github.com/Masterminds/html5-php). This allows for better support of HTML5 and fix many unexpected behaviors and inconsistencies of the native DOM extension.
Commits
-------
4050ec4257 [DomCrawler] Optionally use html5-php to parse HTML
This PR was squashed before being merged into the 4.3-dev branch (closes#30255).
Discussion
----------
[DependencyInjection] Invokable Factory Services
| Q | A
| ------------- | ---
| Branch? | `master`
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | symfony/symfony-docs#11014
> Failing test is in the Twig bridge, and outside of the the scope of this PR.
Allow referencing invokable factory services, just as route definitions reference invokable controllers.
This functionality was also added for service configurators for consistency.
## Example
```php
<?php
namespace App\Factory;
class ServiceFactory
{
public function __invoke(bool $debug)
{
return new Service($debug);
}
}
```
```yaml
services:
App\Service:
# Prepend with "@" to differentiate between service and function.
factory: '@App\Factory\ServiceFactory'
arguments: [ '%kernel.debug%' ]
```
```xml
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/serviceshttp://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<!-- ... -->
<service id="App\Service"
class="App\Service">
<factory service="App\Factory\ServiceFactory" />
</service>
</services>
</container>
```
```php
<?php
use App\Service;
use App\Factory\ServiceFactory;
use Symfony\Component\DependencyInjection\Reference;
$container->register(Service::class, Service::class)
->setFactory(new Reference(ServiceFactory::class));
```
Commits
-------
23cb83f726 [DependencyInjection] Invokable Factory Services
This PR was merged into the 4.3-dev branch.
Discussion
----------
[PropertyInfo] Use a single cache item per method
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29977
| License | MIT
| Doc PR | none
Replaces https://github.com/symfony/symfony/pull/30523 with a rebase to master.
This PR changes how property metadata is cached, significantly reducing the number of calls made between PHP and the backend cache. Instead of storing one cache item per method and set of arguments, a single cache item is stored per method. This matches well with real-world use, where most properties in an object will need to be inspected.
Note that the absolute numbers in the above PR are best case. In production environments where memcache is on a remote server, we were seeing multiple seconds consumed by memcache calls.
Commits
-------
2a4f8a11d4 [PropertyInfo] Use a single cache item per method
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] Add ScopingHttpClient::forBaseUri() + tweak MockHttpClient
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This allows creating scoped HTTP clients in one line:
```php
$client = ScopingHttpClient::forBaseUri($client, 'http://example.com');
```
`$client` now resolves relative URLs using the provided base URI.
If one also adds default options as 3rd argument, these will be applied conditionally when a URL matching the base URI is requested.
This PR also tweaks `MockHttpClient` to make it return `MockResponse` on its own when no constructor argument is provided, easing tests a bit.
Commits
-------
2b9b8e5707 [HttpClient] Add ScopingHttpClient::forBaseUri() + tweak MockHttpClient
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] fix HttpClient integration
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
HttpClient should be an optional dep.
Fixes compat of SecurityBundle 4.2 with FrameworkBundle 4.3 as spotted by the CI.
Commits
-------
3e7a47c0bf [FrameworkBundle] fix HttpClient integration
This PR was merged into the 4.3-dev branch.
Discussion
----------
[RouterDebugCommand] add link to Controllers
| Q | A
| ------------- | ---
| Branch? | master for features
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Adds a link to the controller method on your IDE from dev's terminal:
<img width="734" alt="pr-debug-router" src="https://user-images.githubusercontent.com/29813575/54141007-1f3bc400-4425-11e9-82d0-1b37498d4953.png">
Configuration in your `services.yaml`:
```yaml
parameters:
debug.file_link_format: phpstorm://open?file=%%f&line=%%l
```
Commits
-------
e9fca21d6b [RouterDebugCommand] add link to Controllers
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DI] Add support for "wither" methods - for greater immutable services
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10991
Let's say we want to define an immutable service while still using traits for composing its optional features. A nice way to do so without hitting [the downsides of setters](https://symfony.com/doc/current/service_container/injection_types.html#setter-injection) is to use withers. Here would be an example:
```php
class MyService
{
use LoggerAwareTrait;
}
trait LoggerAwareTrait
{
private $logger;
/**
* @required
* @return static
*/
public function withLogger(LoggerInterface $logger)
{
$new = clone $this;
$new->logger = $logger;
return $new;
}
}
$service = new MyService();
$service = $service->withLogger($logger);
```
As you can see, this nicely solves the setter issues.
BUT how do you make the service container create such a service? Right now, you need to resort to complex gymnastic using the "factory" setting - manageable for only one wither, but definitely not when more are involved and not compatible with autowiring.
So here we are: this PR allows configuring such services seamlessly.
Using explicit configuration, it adds a 3rd parameter to method calls configuration: after the method name and its parameters, you can pass `true` and done, you just declared a wither:
```yaml
services:
MyService:
calls:
- [withLogger, ['@logger'], true]
```
In XML, you could use the new `returns-clone` attribute on the `<call>` tag.
And when using autowiring, the code looks for the `@return static` annotation and turns the flag on if found.
There is only one limitation: unlike services with regular setters, services with withers cannot be part of circular loops that involve calls to wither methods (unless they're declared lazy of course).
Commits
-------
f455d1bd97 [DI] Add support for "wither" methods - for greater immutable services
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] change the way http clients are configured by leveraging ScopingHttpClient
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR allows configuring scoped HTTP clients ("scoped_clients" replaces the previous "clients" options):
```yaml
framework:
http_client:
max_host_connections: 4
default_options:
# ...
scoped_clients:
github_client:
base_uri: https://api.github.com
headers:
Authorization: token abc123
# ...
```
The base URI is turned into a scoping regular expression so that the token will be sent only when the `github_client` service is requesting the corresponding URLs.
When the base URI is too restrictive, the `scope` option can be used explicitly to define the regexp that URLs must match before any other options are applied.
~All defined scopes are passed to a new `scoping_http_client` service, that can be used to hit endpoints with authentication pre-configured for several hosts. Its named autowiring alias is `HttpClientInterface $scopingClient` (this cannot be done with `http_client` as we want safe defaults, e.g. credentials should not be used implicitly when writing webhooks/crawlers.)~
Commits
-------
f1a26b9aea [FrameworkBundle] change the way http clients are configured by leveraging ScopingHttpClient
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient][Contracts] rename "raw_headers" to "response_headers"
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
A preliminary step before adding the `request_headers` info on responses to ease debugging.
Commits
-------
0b21268bf5 [HttpClient][Contracts] rename "raw_headers" to "response_headers"
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] Add file links for described classes in debug:form command
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
![debug_form_file_link](https://user-images.githubusercontent.com/2028198/55357775-d1eac980-549b-11e9-8aa8-500aee629753.png)
Commits
-------
dcba01d212 Add file links for described classes
This PR was merged into the 4.3-dev branch.
Discussion
----------
New PHPUnit assertions for the WebTestCase
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | replaces #29990
| License | MIT
| Doc PR | n/a
While reviewing #29990, and working on some tests, I realized that we could do better by adding PHPUnit constraint classes in various components that are then used in WebTextCase.
**Before**
```php
<?php
namespace App\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testSomething()
{
$client = static::createClient();
$crawler = $client->request('GET', '/test');
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertContains('Hello World', $crawler->filter('h1')->text());
}
}
```
**After**
```php
<?php
namespace App\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testSomething()
{
$client = static::createClient();
$client->request('GET', '/test');
$this->assertResponseIsSuccessful();
$this->assertSelectorTextContains('h1', 'Hello World');
}
}
```
Commits
-------
4f91020c8d added PHPUnit assertions in various components
2f8040ee84 Create new PHPUnit assertions for the WebTestCase
This PR was squashed before being merged into the 4.3-dev branch (closes#27738).
Discussion
----------
[Validator] Add a HaveIBeenPwned password validator
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | todo
This PR adds a new `Pwned` validation constraint to prevent users to choose passwords that have been leaked in public data breaches.
The validator uses the https://haveibeenpwned.com/ API. The implementation is similar to the one used by [Firefox Monitor](https://blog.mozilla.org/futurereleases/2018/06/25/testing-firefox-monitor-a-new-security-tool/). It allows to not expose the password hash using a k-anonymity model. The specific implementation for HaveIBeenPwned has been [described in depth by Cloudflare](https://blog.cloudflare.com/validating-leaked-passwords-with-k-anonymity/).
Usage:
```php
// Rejects the password if is present in any number of times in any data breach
class User
{
/** @Pwned */
public $plainPassword;
}
// Rejects the password if is present more than 5 times in data breaches
class User
{
/** @Pwned(maxCount=5) */
public $plainPassword;
}
// Customize the error message
class User
{
/** @Pwned(message='Please select another password, this one has already been hacked.') */
public $plainPassword;
}
```
Commits
-------
ec1ded898a [Validator] Add a HaveIBeenPwned password validator
This PR was merged into the 4.3-dev branch.
Discussion
----------
Changing messenger bus id from 'message_bus' to 'messenger.default_bus'
Changing messenger bus tag from 'message_bus' to 'messenger.message_bus'
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | Maybe
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30670
| License | MIT
| Doc PR |
All is in the title.
This PR change the tag of the default bus from 'message_bus' to 'messenger.message_bus'.
Commits
-------
3cee1cac12#30690 - Changing messenger bus id from 'message_bus' to 'messenger.default_bus'
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] bug fixes in Doctrine Transport
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Just tested the new Doctrine transport and I've see 3 bugs so far :
- [x] The message is not return by the transport
- [x] The headers column must be of type TEXT and not just STRING
- [ ] When using the PhpSerializer the message is truncated (PR: https://github.com/symfony/symfony/pull/30814)
The body in database looks like this :
```
O:36:"Symfony\Component\Messenger\Envelope":2:{s:44:"
```
The body given by the serializer is the following :
```
O:36:"Symfony\Component\Messenger\Envelope":2:{s:44:"Symfony\Component\Messenger\Envelopestamps";a:3:{s:49:"Symfony\Component\Messenger\Stamp\SerializerStamp";a:1:{i:0;O:49:"Symfony\Component\Messenger\Stamp\SerializerStamp":1:{s:58:"Symfony\Component\Messenger\Stamp\SerializerStampcontext";a:0:{}}}s:46:"Symfony\Component\Messenger\Stamp\BusNameStamp";a:1:{i:0;O:46:"Symfony\Component\Messenger\Stamp\BusNameStamp":1:{s:55:"Symfony\Component\Messenger\Stamp\BusNameStampbusName";s:21:"messenger.bus.default";}}s:43:"Symfony\Component\Messenger\Stamp\SentStamp";a:1:{i:0;O:43:"Symfony\Component\Messenger\Stamp\SentStamp":2:{s:56:"Symfony\Component\Messenger\Stamp\SentStampsenderClass";s:64:"Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport";s:56:"Symfony\Component\Messenger\Stamp\SentStampsenderAlias";s:16:"environment.stop";}}}s:45:"Symfony\Component\Messenger\Envelopemessage";O:34:"App\Message\EnvironmentStopMessage":1:{s:51:"App\Message\AbstractEnvironmentMessageenvironment";O:22:"App\Entity\Environment":5:{s:26:"App\Entity\Environmentid";s:36:"3bade252-b7a9-4188-82bd-3e68129e0da7";s:37:"App\Entity\EnvironmentrepositoryUrl";s:6:"string";s:30:"App\Entity\Environmentbranch";s:6:"string";s:33:"App\Entity\EnvironmenthostNames";a:1:{i:0;N;}s:27:"App\Entity\Environmentenv";a:2:{s:7:"APP_ENV";s:4:"prod";s:7:"APP_VAR";s:13:"example value";}}}}
```
Commits
-------
27466498d0 [Messenger] Fix get in Doctrine Transport
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] base64_encoding inside PhpSerializer to avoid null characters
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30805
| License | MIT
| Doc PR | not needed
Hi!
As pointed out in #30805, the `PhpSerializer` creates strings with null bytes. This apparently causes problems on at least some database systems (I didn't notice, but @vincenttouzet did). I also read that, for example, SQS doesn't like null characters. And, in general, because we're sending this data over a transport, `base64_encoding` data is pretty standard.
Does anyone see any downsides?
Cheers!
Commits
-------
fe7ad812c7 base64_encoding inside PhpSerializer to avoid null characters
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Process] Added more detail to the exception when the CWD is invalid
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
---
When using panther with "special" directory structure, the message is
not really usefull. Let's add the CWD to the exception
Commits
-------
d27858f77b [Process] Added more detail to the exception when the CWD is invalid
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Remove unused option in the Doctrine transport
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
This PR remove the unused option `loop_sleep` in the Messenger Doctrine transport
Commits
-------
4811400372 [Messenger] Remove unused option in the Doctrine transport
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Inflector] Support pluralization in the inflector
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | not yet
| Fixed tickets | N/A
| License | MIT
| Doc PR | Not Yet
At present the inflector only supports singularizing plural words, this PR adds the capability to pluralize singular words.
Commits
-------
06920a79c4 Support pluralization in the inflector
This PR was squashed before being merged into the 4.3-dev branch (closes#28637).
Discussion
----------
[Validator] add number constraints
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28608
| License | MIT
| Doc PR | tbd.
I added the following constraints:
* `Positive`
* `PositiveOrZero`
* `Negative`
* `NegativeOrZero`
Commits
-------
01870398eb [Validator] add number constraints
This PR was squashed before being merged into the 3.4 branch (closes#30781).
Discussion
----------
[Intl] Update the ICU data to 64.1
| Q | A
| ------------- | ---
| Branch? | 3.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? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes, including the intl-data group
| Fixed tickets | -
| License | MIT
| Doc PR | -
http://site.icu-project.org/download/64
Commits
-------
ae2cb6f5c5 [Intl] Update the ICU data to 64.1
This PR was squashed before being merged into the 4.3-dev branch (closes#30754).
Discussion
----------
[Messenger] New messenger:stop-workers Command
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | Kinda of #29451
| License | MIT
| Doc PR | symfony/symfony-docs#11236
o/ me again.
This requires and is built on top of #30708
When you deploy, all workers need to be stopped and restarted. That's not currently possible, unless you manually track the pids and send a SIGTERM signal. We can make that much easier :).
Now run:
```
bin/console messenger:stop-workers
```
And it will signal to all workers (even if they're distributed on other servers) that they should stop, once they finish processing their current message. This is done via a key in `cache.app`.
Cheers!
Commits
-------
58971627f5 [Messenger] New messenger:stop-workers Command
This PR was merged into the 4.3-dev branch.
Discussion
----------
[EventDispatcher] Fix BC/FC layer
| 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
Fixes
> TypeError: Argument 3 passed to Symfony\Component\EventDispatcher\EventDispatcher::doDispatch() must be an instance of Symfony\Component\EventDispatcher\Event
Spotted in https://github.com/lexik/LexikJWTAuthenticationBundle/pull/637
Commits
-------
caa0aded89 [EventDispatcher] Fix BC layer
This PR was merged into the 4.3-dev branch.
Discussion
----------
Changing to MessageDecodingFailedException so that invalid messages are rejected
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #30649
| License | MIT
| Doc PR | not needed for bug fix
Bug fix if a message body is completely blank. I'm fixing this on master only, because in 4.2 and earlier, there is actually no system in place to fail serialization and cause the messages to be rejected. In 4.3, we just need to throw this exception.
Cheers!
Commits
-------
4be827d3ca Changing to MessageDecodingFailedException so that invalid messages are rejected
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Updating SyncTransport for recent changes + tests
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | not needed
When making the `SyncTransport`, I neglected having at least one test in each of these classes, which allowed the test suite to pass, even after some interface changes made these classes fail. Fixed all of that :)
Commits
-------
2df023be46 Updating SyncTransport for recent changes + tests
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger][DX] Allow stamps to be passed directly to MessageBusInterface::dispatch()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | TODO
Me again o/!
This proposal is *purely* for DX. With `DelayStamp`, the proposal of QueueNameStamp and future things like `AmqpRoutingKeyStamp`, stamps are becoming more common for end users to use. This changes how it looks to use them:
```php
// before
$bus->dispatch(new Envelope(new SendSmsNotification('Hi!'), new DelayStamp(10), new QueueNameStamp('low')));
// after
$bus->dispatch(new SendSmsNotification('Hi!'), [new DelayStamp(10), new QueueNameStamp('low')]);
```
It's definitely a BC break, which is allowed because the component is experimental, though it should be minimized. This BC break shouldn't be felt by most end users, as creating your own bus is an advanced use-case. Even if you decorated it, you'll get an obvious error.
Commits
-------
e861de7e61 Allow stamps to be passed directly to MessageBusInterface::dispatch()
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Add a Doctrine transport
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | symfony/symfony-docs#10616
| DoctrineBundle PR | doctrine/DoctrineBundle#868
As discussed with @sroze at PHPForum in Paris I've worked on adding a Doctrine transport to the Messenger component.
Actually `AMQP` is the only supported transport and it could be a good thing to support multiple transports. Having a Doctrine transport could help users to start using the component IMHO (Almost all projects use a database).
# How it works
The code is splitted betwwen this PR and the one on the DoctrineBundle : doctrine/DoctrineBundle#868
## Configuration
To configure a Doctrine transport the dsn MUST have the format `doctrine://<entity_manager_name>` where `<entity_manager_name>` is the name of the entity manager (usually `default`)
```yml
# config/packages/messenger.yaml
framework:
messenger:
transports:
my_transport: "doctrine://default?queue=important"
```
## Table schema
Dispatched messages are stored into a database table with the following schema:
| Column | Type | Options | Description |
|--------------|----------|--------------------------|-------------------------------------------------------------------|
| id | bigint | AUTO_INCREMENT, NOT NULL | Primary key |
| body | text | NOT NULL | Body of the message |
| headers | text | NOT NULL | Headers of the message |
| queue | varchar(32) | NOT NULL | Headers of the message |
| created_at | datetime | NOT NULL | When the message was inserted onto the table. (automatically set) |
| available_at | datetime | NOT NULL | When the message is available to be handled |
| delivered_at | datetime | NULL | When the message was delivered to a worker |
## Message dispatching
When dispatching a message a new row is inserted into the table. See `Symfony\Component\Messenger\Transport\Doctrine::publish`
## Message consuming
The message is retrieved by the `Symfony\Component\Messenger\Transport\Doctrine\DoctrineReceiver`. It calls the `Symfony\Component\Messenger\Transport\Doctrine::get` method to get the next message to handle.
### Getting the next message
* Start a transaction
* Lock the table to get the first message to handle (The lock is done with the `SELECT ... FOR UPDATE` query)
* Update the message in database to update the delivered_at columns
* Commit the transaction
### Handling the message
The retrieved message is then passed to the handler. If the message is correctly handled the receiver call the `Symfony\Component\Messenger\Transport\Doctrine::ack` which delete the message from the table.
If an error occured the receiver call the `Symfony\Component\Messenger\Transport\Doctrine::nack` method which update the message to set the delivered_at column to `null`.
## Message requeueing
It may happen that a message is stuck in `delivered` state but the handler does not really handle the message (Database connection error, server crash, ...). To requeue messages the `DoctrineReceiver` call the `Symfony\Component\Messenger\Transport\Doctrine::requeueMessages`. This method update all the message with a `delivered_at` not null since more than the "redeliver timeout" (default to 3600 seconds)
# TODO
- [x] Add tests
- [x] Create DOC PR
- [x] PR on doctrine-bundle for transport factory
- [x] Add a `available_at` column
- [x] Add a `queue` column
- [x] Implement the retry functionnality : See #30557
- [x] Rebase after #29476
Commits
-------
88d008c828 [Messenger] Add a Doctrine transport
This PR was squashed before being merged into the 4.3-dev branch (closes#30569).
Discussion
----------
[FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #27787, symfony/symfony-docs#7988 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | none <!-- 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.
-->
Create a very late controller argument value resolver to throw an intuitive error message when controller fails because it is not registered as a service.
Commits
-------
fbfc623b72 [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service
This PR was squashed before being merged into the 4.3-dev branch (closes#30320).
Discussion
----------
[Form][TwigBridge] Add row_attr to form theme
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | waiting for confirmation to implement
| Fixed tickets |
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Currently you need to copy the whole form_row block if you just want to add a class to the form_row div. Instead we could introduce a `row_attr` which can then simple be set the following in the theme e.g.:
```twig
{% block form_row %}
{% set row_attr = { class: 'form__field' } %}
{{ parent() }}
{% endblock %}
```
or in php:
```
$builder->add('test', TextType::class, ['row_attr' => ['class' => 'form__field']]);
```
Commits
-------
7ab1b00e02 [Form][TwigBridge] Add row_attr to form theme
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Validator][DoctrineBridge][FWBundle] Automatic data validation
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes<!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/11132
This feature automatically adds some validation constraints by inferring existing metadata. To do so, it uses the PropertyInfo component and Doctrine metadata, but it has been designed to be easily extendable.
Example:
```php
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class Dummy
{
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
public $id;
/**
* @ORM\Column(nullable=true)
*/
public $columnNullable;
/**
* @ORM\Column(length=20)
*/
public $columnLength;
/**
* @ORM\Column(unique=true)
*/
public $columnUnique;
}
$manager = $this->managerRegistry->getManager();
$manager->getRepository(Dummy::class);
$firstOne = new Dummy();
$firstOne->columnUnique = 'unique';
$firstOne->columnLength = '0';
$manager->persist($firstOne);
$manager->flush();
$dummy = new Dummy();
$dummy->columnNullable = 1; // type mistmatch
$dummy->columnLength = '012345678901234567890'; // too long
$dummy->columnUnique = 'unique'; // not unique
$res = $this->validator->validate($dummy);
dump((string) $res);
/*
Object(App\Entity\Dummy).columnUnique:\n
This value is already used. (code 23bd9dbf-6b9b-41cd-a99e-4844bcf3077f)\n
Object(App\Entity\Dummy).columnLength:\n
This value is too long. It should have 20 characters or less. (code d94b19cc-114f-4f44-9cc4-4138e80a87b9)\n
Object(App\Entity\Dummy).id:\n
This value should not be null. (code ad32d13f-c3d4-423b-909a-857b961eb720)\n
Object(App\Entity\Dummy).columnNullable:\n
This value should be of type string. (code ba785a8c-82cb-4283-967c-3cf342181b40)\n
*/
```
It also works for DTOs:
```php
class MyDto
{
/** @var string */
public $name;
}
$dto = new MyDto();
$dto->name = 1; // type error
dump($validator->validate($dto));
/*
Object(MyDto).name:\n
This value should be of type string. (code ba785a8c-82cb-4283-967c-3cf342181b40)\n
*/
```
Supported constraints currently are:
* `@NotNull` (using PropertyInfo type extractor, so supports Doctrine metadata, getters/setters and PHPDoc)
* `@Type` (using PropertyInfo type extractor, so supports Doctrine metadata, getters/setters and PHPDoc)
* `@UniqueEntity` (using Doctrine's `unique` metadata)
* `@Length` (using Doctrine's `length` metadata)
Many users don't understand that the Doctrine mapping doesn't validate anything (it's just a hint for the schema generator). It leads to usability and security issues (that are not entirely fixed by this PR!!).
Even the ones who add constraints often omit important ones like `@Length`, or `@Type` (important when building web APIs).
This PR aims to improve things a bit, and ease the development process in RAD and when prototyping. It provides an upgrade path to use proper validation constraints.
I plan to make it opt-in, disabled by default, but enabled in the default Flex recipe. (= off by default when using components, on by default when using the full stack framework)
TODO:
* [x] Add configuration flags
* [x] Move the Doctrine-related DI logic from the extension to DoctrineBundle: doctrine/DoctrineBundle#831
* [x] Commit the tests
Commits
-------
2d64e703c2 [Validator][DoctrineBridge][FWBundle] Automatic data validation
This PR was squashed before being merged into the 3.4 branch (closes#30660).
Discussion
----------
[Bridge][Twig] DebugCommand - fix escaping and filter
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
The PR fixes:
- output escaping was not done for decorated consoles
- filter was not applied when using format json
+ added some tests for paths currently not tested
Commits
-------
7bdb06641d [Bridge][Twig] DebugCommand - fix escaping and filter
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Remove the mention of handler in the `ReceiverInterface::get` phpdoc.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/30708#pullrequestreview-220830730
| License | MIT
| Doc PR | ø
As spotted by @Tobion, we don't have an handler as an argument anymore.
Commits
-------
9c63112d7c Remove the mention of handler in the phpdoc.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[PropertyAccess] Allow Can Accessor in Property Access
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 |
| License | MIT
| Doc PR |
- Added ability to support `can` methods in the property access
in order to be compatible with PropertyInfo component
which allows for `can` accessors
Commits
-------
a4c95745bb [PropertyAccess] Allow Can Accessor in Property Access
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Filesystem] Fix mirroring a directory into itself or in his child with realpath checks
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none / PR #29857
| License | MIT
| Doc PR | n/a
This this the continuity of #29857 by @Fleuv
Fix a bug while trying to mirror a directory into itself or in a child
Adding handle real path checks when mirroring.
Commits
-------
8011f494d4 Handling relative/absolute path
59437a4af9 Skipping iterations in the mirror() method where the iterated file's path name is equal to the target path
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Debug] Mimic __toString php behavior in FlattenException
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | symfony/symfony-docs#
The `Symfony\Component\Debug\Exception\FlattenException` object is returned by `Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector::getException` method, but the docblock of this method indicates that it should return `\Exception` object.
As the `FlattenException` class should behave as much as possible like a php `\Exception` object, it should implement the same methods as `\Exception`.
This PR is adding `__toString` and `getTraceAsString` methods. Those methods are (in my opinion) the most useful methods of a `\Exception` object. A potential use case (where i am stumbled across this inconsistency) is to get the last exception of a request in a `WebTestCase` using the profiler and printing the trace.
Commits
-------
514a1b506c [Debug] Mimic __toString php behavior in FlattenException
This PR was squashed before being merged into the 4.3-dev branch (closes#29495).
Discussion
----------
[Ldap] Implement pagination
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yno
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | N/A (cannot test at the moment)
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
Implement pagination support in the ExtLdap adapter. In a more abstract sense, other adapters should use a query's pageSize option to determine if pagination is being needed. Pagination is required in some environments that frequently query for more results than the remote server is willing to allow.
BC break was avoided by having Query->getResource() return the first result, if available.
A small hack is included to work around php-ldap failing to reset pagination properly; the LDAP_OPT_SERVER_CONTROLS are sent with every request, whether pagination has been 'reset' by sending a 0-page request or not. This appears to be a php-ldap bug that will need to be addressed there, but we can work-around it for now by doing both: setting the 0-page option *and* unsetting the OID directly. This was resulting in odd results, like queries returning 0 results or returning < server_page_size results for a query that should have returned >= server_page_size.
Commits
-------
b96347485c [Ldap] Implement pagination
This PR was squashed before being merged into the 4.3-dev branch (closes#29448).
Discussion
----------
[Ldap] Entry move support
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no (see [1])
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A (see [2])
Add Move support to the ldap EntryManagerInterface and the ExtLdap adapter. This is used to re-parent an entry to another part of the directory. The interface to do so need not be complicated, requiring only the entry to be moved and the parent DN to be moved to.
Underlying implementations may require a 'newrdn' attribute -- this is generally the RDN w.r.t. the immediate parent of the entry, which is easily parsed.
I've attempted to implement it as the rename functionality was originally implemented: adding an interface to be deprecated effective immediately, presumably to allow it to be backported without breaking existing interfaces, and then implementing this interface in the ExtLdap adapter.
[1] I do not have the capacity to run the ldap tests for this locally due to current $work situation; I have no reason to believe this test will fail as written, though. This functionality has been used as currently implemented (against Windows ADS) for some time in my production environment, so it has been functionally tested otherwise.
[2] No doc PR has been created for this feature addition, since it's a minor addition. The LDAP documentation should likely be amended to include rename functionality as well as this.
Commits
-------
32743c850f [Ldap] Entry move support
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Mailer] Fix SMTP support when a message cannot be sent
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
<!--
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.
-->
Commits
-------
3d25c1c613 [Mailer] fixed SMTP support when a message cannot be sent
This PR was merged into the 3.4 branch.
Discussion
----------
Fix getSetMethodNormalizer to correctly ignore the attributes specified in "ignored_attributes"
…ed in "ignored_attributes"
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30453
| License | MIT
The GetSetMethodNormalizer class correctly ignores the attributes specified in "ignored_attributes"
Commits
-------
606d8d370d Fix getSetMethodNormalizer to correctly ignore the attributes specified in "ignored_attributes"
This PR was merged into the 4.3-dev branch.
Discussion
----------
Fix some exception previous type hints
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
follow-up for #30729
Commits
-------
f92efeb429 fixed some exception previous type hints
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Finder] Throw a dedicated exception for non-existing directory
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes [1]
| New feature? | yes
| BC breaks? | no
| Deprecations? | no [2]
| Tests pass? | yes
| Fixed tickets | #30723
| License | MIT
| Doc PR | N/A [3]
Makes `Finder::in()` throw a `DirectoryNotFoundException` instead of an `InvalidArgumentException` if one of the directories is not found.
This behavior is more consistent with the `AccessDeniedException` for files which are unreadable due to insufficient permissions.
To keep backward compatibility, the new exception class inherits from `InvalidArgumentException`.
[1] A valid, but non-existent directory name is IMHO not an invalid argument
[2] However, it may be semantically better to extend from `RuntimeException`, This would require a deprecation.
[3] Possible exceptions are currently not explained at https://symfony.com/doc/current/components/finder.html
Commits
-------
48d5f94cda Throw a dedicated exception for non-existing directory
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Adding the "sync" transport to call handlers synchronously
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | symfony/symfony-docs#11236
This adds a `sync://` transport that just calls the handlers immediately. Why? This allows you to route your messages to some "async" transport. But then, when developing locally or running your tests, you can choose to run them synchronously instead:
```yml
# config/packages/messenger.yaml
framework:
messenger:
transports:
async: '%env(MESSENGER_TRANSPORT_DSN)%'
routing:
'App\Message\SmsNotification': async
'App\Message\OtherMessage': async
```
```
# .env
# by default, handle this sync
MESSENGER_TRANSPORT_DSN=sync://
```
```
# .env.local on production (or set this via real env vars)
# on production, use amqp
MESSENGER_TRANSPORT_DSN=amqp://.......
```
Cheers!
Commits
-------
3da5a438aa Adding the "sync" transport to call handlers synchronously
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Contracts][EventDispatcher] move the Event class to symfony/contracts
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Will allow decoupling more components in 5.0
Commits
-------
a4ce08ec30 [Contracts][EventDispatcher] move the Event class to symfony/contracts
This PR was merged into the 3.4 branch.
Discussion
----------
[Routing] Fix routes annotation loading with glob pattern
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29747
| License | MIT
| Doc PR | n/a
Loading routes annotation loading with glob pattern triggers an error if one of the targetted directory contains an abstract class. This fixes it
Commits
-------
c7c45a13a7 [Routing] Fix routes annotation loading with glob pattern
This PR was merged into the 3.4 branch.
Discussion
----------
[Intl] Simplify the compile binary
| Q | A
| ------------- | ---
| Branch? | 3.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? | no <!-- 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 | -
| License | MIT
| Doc PR | -
The intl docker image comes with build-essential packages now, so there's no need for additional installation steps.
re #30584
Commits
-------
b3184c26ad [Intl] Simplify the compile binary
This PR was squashed before being merged into the 3.4 branch (closes#30737).
Discussion
----------
[Validator] Improve constraint default option check
| 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
Any constraint without default option used as annotation with unnamed first argument (for example, `@Assert\Collection(1)`) throws an exception with an ugly message `The options "" do not exist in constraint Collection`.
This PR makes constraint check the default option in the annotation case in the same way it checks it in the "real" code case. So the exception will be `No default option is configured for constraint Collection.`
Commits
-------
915912e18e [Validator] Improve constraint default option check
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Lock] Added MongoDBStore
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes (requires `ext-mongodb` and `mongodb/mongodb` to test)
| Fixed tickets | #27345
| License | MIT
| Doc PR | symfony/symfony-docs#9807
**Testing caveat**
In order to test this, the test environment needs `ext-mongodb` and `mongodb/mongodb`.
I have both written the test and tested `Symfony\Component\Lock\Store\MongoDbStore` and it does pass in an environment with `ext-mongodb` and `mongodb/mongodb`.
**Description**
We should support Semaphore Locks with a MongoDB back end to allow those that already use MongoDB as a distributed storage engine.
Symfony already partially supports MongoDB for session storage: `Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler`
**Example**
```php
$client = new MongoDb\Client();
$store = new Symfony\Component\Lock\Store\MongoDbStore(
$client
array(
'database' => 'my-app',
)
);
$lockFactory = new Symfony\Component\Lock\Factory($store);
$lock = $lockFactory->createLock('my-resource');
```
This is a squashed pull request of https://github.com/symfony/symfony/pull/27346
Commits
-------
9c04639dc3#27345 Added Lock/Store/MongoDbStore
- Added ability to support `can` methods in the property access
in order to be compatible with PropertyInfo component
which allows for can accessors
Signed-off-by: RJ Garcia <rj@bighead.net>
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] use "nyholm/psr7" by default in Psr18Client
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This makes the factory arguments of `Psr18Client` optional, with a fallback to using `Nyholm\Psr7\Factory\Psr17Factory` when no factories are provided.
Commits
-------
f2222e4bf5 [HttpClient] use "nyholm/psr7" by default in Psr18Client
This PR was merged into the 4.3-dev branch.
Discussion
----------
Add optional parameter `prefetching` for AMQP connection
Add prefetching connection parameter to setup channel prefetch count.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
When setting up AMQP transport connection, it can be interesting to configure prefetching on a channel, which is not currently possible.
Commits
-------
47777eedd6 Add optional parameter `prefetching` in connection configuration, to setup channel prefetch count
Makes Finder::in() throw a DirectoryNotFoundException instead of an InvalidArgumentException if one of the directories is not found.
This behavior is more consistent with the AccessDeniedException for files which are unreadable due to insufficient permissions.
To keep BC, the new exception class inherits from InvalidArgumentException.
This PR was squashed before being merged into the 4.3-dev branch (closes#30606).
Discussion
----------
[Validator] allow brackets in the optional query string
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30603
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Add the `allowBrackets` option from the Url constraint to allow brackets in the optional query string.
Commits
-------
40dc4c89df [Validator] allow brackets in the optional query string
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Add a command to setup transports
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
This PR add a `SetupTransportsCommand` that allow to setup the transports.
Actually the `AMQPTransport` is setup only if debug is enabled. With this PR the new `messenger:setup-transports` will setup all declared transports.
Commits
-------
fbb534a838 [Messenger] Add a command to setup transports
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Mime] Add BodyRendererInterface
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
<!--
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.
-->
Commits
-------
0c9d684d0a [Mime] added BodyRendererInterface
This PR was squashed before being merged into the 4.3-dev branch (closes#30664).
Discussion
----------
[Finder] Get filename without extension
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30655
| License | MIT
| Doc PR |
Commits
-------
821e55ab80 [Finder] Get filename without extension
This PR was merged into the 4.2 branch.
Discussion
----------
[Cache] Ensure key exists before checking array value
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Without this fix we're getting warnings like
```
PHP Notice: Undefined index: %5BOUR-KEY%5D%5B1%5D in vendor/symfony/cache/Traits/PhpFilesTrait.php on line 136
```
when doing a `$cache->contains()` in some cases. I'm having a lot of trouble tracking down exactly when and where this error will happen and what changes in our app / cache cause it, but this fix seems benign enough that maybe it can be merged without that backstory.
Commits
-------
f8b4adef23 Ensure key exists before checking array value
This PR was merged into the 4.3-dev branch.
Discussion
----------
Alias for each assets package
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | ? <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | <!-- required for new features -->
Add autowiring by type + name on assets packages
```yaml
framework:
assets:
packages:
xxx:
base_urls: 'xxxx'
```
```php
<?php
class MyService
{
private $xxxPackage;
public function __construct(PackageInterface $xxxPackage)
{
$this->xxxPackage = $xxxPackage;
...
}
public function myMethod(): string
{
return $this->xxxPackage->getUrl('some-image.png');
}
}
```
instead of:
```php
<?php
class MyService
{
private $packages;
public function __construct(Packages $packages)
{
$this->packages = $packages;
...
}
public function myMethod(): string
{
return $this->packages->getPackage('xxx')->getUrl('some-image.png');
}
}
```
Commits
-------
e8b9856ec3 Alias for each assets package
This PR was squashed before being merged into the 4.3-dev branch (closes#30706).
Discussion
----------
[PropertyInfo] Add possibility to extract private and protected properties in reflection extractor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30248
| License | MIT
| Doc PR | TODO
This PR add the possibility to extract private and protected properties from a class by passing a new argument to the `ReflectionExtractor`
This new argument consist of flag that filters properties, so someone will also be able to use the `ReflectionExtractor` only for private property
```php
new ReflectionExtractor(null, null, null, true, ReflectionExtractor::ALLOW_PRIVATE | ReflectionExtractor::ALLOW_PROTECTED)
```
Flags method was prefered over a list of bool to avoid too many parameters and also be close to the reflection API of PHP
Commits
-------
05e487f3b2 [PropertyInfo] Add possibility to extract private and protected properties in reflection extractor
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DI] Deprecate non-string default envs
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes-ish
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes
| Tests pass? | no <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27680, https://github.com/symfony/symfony/pull/27470#discussion_r196678923
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
This is a failing test to further clarify the issues raised in #27680
So given https://github.com/symfony/symfony/issues/27680#issuecomment-399402480
> We should be sure this solves a real-world issue.
I think it solves a real bug :)
Commits
-------
2311437c9f [DI] Deprecate non-string default envs
This PR was merged into the 4.2 branch.
Discussion
----------
[DependencyInjection] Add test asserting service with factory is not tagged
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
I wrote a test for a scenario that was failing for me on `4.1` branch to find out it's already fixed in 4.2 (which is awesome). Since I already had a test written and couldn't really find a PR in the changelog that could have fixed my issue I figured I'll PR a test, so the behaviour I was expecting won't get broken :)
EDIT: For the record, the issue in 4.1 is: `Symfony\Component\DependencyInjection\Tests\Fixtures\BarInterface` gets tagged due to `_instanceof` which results in it being handed to `Symfony\Component\DependencyInjection\Tests\Fixtures\BarFactory` via `!tagged`. In the end this results in a recursion which is not handled.
Commits
-------
a8e9f4092c Test service with factory is not tagged
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Contracts][EventDispatcher] add EventDispatcherInterface to symfony/contracts and use it where possible
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR adds a new `EventDispatcherInterface` in `Contracts`. This interface contains only one method: `dispatch($event, $eventName)`. That covers almost all use cases of the event dispatcher in components (some use add/removeListeners/Subscribers but they are a minority.)
While doing so, it allows dispatching any objects as events - not only instances of `Event`.
This allows decoupling e.g. `Messenger` from the `EventDispatcher` component.
Next steps could be about planning to remove the base `Event` class from some concrete event classes and/or moving `EventSubscriberInterface` to `symfony/contracts`. It would allow decoupling e.g. `Workflow` from the component - but that's too far away for now, let's think about it in 5.1.
Commits
-------
3c3db2f14a [Contracts][EventDispatcher] add EventDispatcherInterface to symfony/contracts and use it where possible
This PR was merged into the 4.3-dev branch.
Discussion
----------
Fixing bad return on getter
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | not needed
My bad - this method is only to make the Symfony Serializer happy (not used in our code), so I missed it. Test added to be sure.
Commits
-------
f3b3b2f4f3 Fixing bad return on getter
This PR was squashed before being merged into the 4.2 branch (closes#30711).
Discussion
----------
[Serializer] Use object class resolver when extracting attributes
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no (not sure)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Current ObjectNormalizer was not using the object class resolver when extracting attributes, i found this when trying to refactor api platform normalizers and dealing with doctrine proxy objet having __initialize__ property not wanted cf https://github.com/api-platform/core/pull/2579
I don't think this is BC break, but maybe some people using this object class resolver can get different behavior ?
Commits
-------
1d8b5af3f0 [Serializer] Use object class resolver when extracting attributes
This PR was merged into the 4.2 branch.
Discussion
----------
[FrameworkBundle] properly describe service definitions without class
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30638
| License | MIT
| Doc PR |
Commits
-------
e5b0fd37f6 properly describe service definitions without class
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Validator] BIC remove unused sprintf and parameter
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
removed surplus parameter and sprintf as there are no placeholders in message template
Commits
-------
131e495269 [Validator] BIC remove unused sprintf and parameter
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] add missing German translations
| 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
-------
78573a7c10 add missing German translations
This PR was merged into the 4.3-dev branch.
Discussion
----------
Avoid dispatching SendMessageToTransportsEvent on redeliver
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes - I think so
| New feature? | no
| BC breaks? | no (feature only on master)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | a lot, soon :)
This purpose of this event is to be a hook when a message is sent to a transport.
If that message is redelivered later, that's not the purpose of this hook (there
are Worker events for that) and could cause problems if the user unknowingly
tries to modify the Envelope in some way, not thinking about how this might
be a redelivery message.
Commits
-------
3ac6bf9f24 Avoid dispatching SendMessageToTransportsEvent on redeliver
This purpose of this event is to be a hook when a message is sent to a transport.
If that message is redelivered later, that's not the purpose of this hook (there
are Worker events for that) and could cause problems if the user unknowingly
tries to modify the Envelope in some way, not thinking about how this might
be a redelivery message.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Add missing information in messenger logs
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes-ish
| New feature? | yes-ish
| BC breaks? | no
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
When using `messenger:consume`, I get the following logs:
```
2019-03-25T11:39:05+01:00 [info] Received message "Symfony\Component\Mailer\EnvelopedMessage"
2019-03-25T11:39:05+01:00 [warning] An exception occurred while handling message "Symfony\Component\Mailer\EnvelopedMessage"
2019-03-25T11:39:05+01:00 [info] Retrying Symfony\Component\Mailer\EnvelopedMessage - retry #1.
2019-03-25T11:39:05+01:00 [info] Sending message "Symfony\Component\Mailer\EnvelopedMessage" with "Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransport"
2019-03-25T11:39:06+01:00 [info] Received message "Symfony\Component\Mailer\EnvelopedMessage"
2019-03-25T11:39:06+01:00 [warning] An exception occurred while handling message "Symfony\Component\Mailer\EnvelopedMessage"
2019-03-25T11:39:06+01:00 [info] Retrying Symfony\Component\Mailer\EnvelopedMessage - retry #2.
2019-03-25T11:39:06+01:00 [info] Sending message "Symfony\Component\Mailer\EnvelopedMessage" with "Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransport"
2019-03-25T11:39:09+01:00 [info] Received message "Symfony\Component\Mailer\EnvelopedMessage"
2019-03-25T11:39:09+01:00 [warning] An exception occurred while handling message "Symfony\Component\Mailer\EnvelopedMessage"
2019-03-25T11:39:09+01:00 [info] Retrying Symfony\Component\Mailer\EnvelopedMessage - retry #3.
2019-03-25T11:39:09+01:00 [info] Sending message "Symfony\Component\Mailer\EnvelopedMessage" with "Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransport"
```
So, an. error occurred, but I have no idea what's going on. The exception is in the context, but the context is not displayed by default. So, this PR fixes it.
Commits
-------
20664caf25 [Messenger] added missing information in messenger logs
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Validator] Add constraint on unique elements collection(Assert\Unique)
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no <!-- please add some, will be required by reviewers -->
| Fixed tickets | #26535
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- 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.
-->
Commits
-------
d0eb13e55a Rebase and update to latest CS
fc66683cf2 Add UniqueCollection constraint and validator
This PR was squashed before being merged into the 4.3-dev branch (closes#27684).
Discussion
----------
[FrameworkBundle] Debug container environment variables
| Q | A
| ------------- | ---
| Branch? | master
| 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 -->
This PR is an attempt to ease debugging environment variables used by the container. Main purpose is to tell which are missing and show detailed usage information.
![image](https://user-images.githubusercontent.com/1047696/47601226-ae43c480-d9cd-11e8-926b-8c49069189fc.png)
![image](https://user-images.githubusercontent.com/1047696/47601234-d7645500-d9cd-11e8-9e3f-d1c2ad85dbc5.png)
Commits
-------
b813a05aa5 [FrameworkBundle] Debug container environment variables
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form][Console] Use dumper
| Q | A
| ------------- | ---
| Branch? | master
| 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 -->
Continuation of #28898 for `debug:form`
Commits
-------
a94228edba [Form][Console] Use dumper
This PR was merged into the 4.3-dev branch.
Discussion
----------
Fix type hints for email attachments
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
`createDataPart()` must return a `DataPart` instance, so `attachPart()` must only accept `DataPart` instances and `getAttachments()` is guaranteed to return an array of `DataPart` instances.
Commits
-------
8059c50e75 fixed type hints for email attachments
This PR was squashed before being merged into the 4.3-dev branch (closes#30559).
Discussion
----------
[HttpClient] Parse common API error formats for better exception messages
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | todo?
Use extra details provided by popular error formats following to improve HTTP exception messages.
The following formats are supported:
* Hydra (default in API Platform)
* RFC 7807 (followed by Symfony's [ConstraintViolationListNormalizer](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Serializer/Normalizer/ConstraintViolationListNormalizer.php) and supported by API Platform and Apigility)
* JSON:API (because it respects the semantic of the RFC 7807)
It allows to write code like the following (here in a test context):
```php
public function testBadRequest()
{
$this->expectException(ClientExceptionInterface::class);
$this->expectExceptionCode(400); // HTTP status code
$this->expectExceptionMessage(<<<ERROR
Validation Failed
users: This collection should contain 1 element or more.
users: The current logged in user must be part of the users owning this resource.
ERROR
);
$response = (HttpClient::create())->request('POST', 'http://example.com/api/projects', [
'json' => [
'name' => 'My project',
],
]);
$response->getContent();
}
```
Port of https://github.com/api-platform/core/pull/2608#issuecomment-472510732.
Commits
-------
96df4464a1 [HttpClient] Parse common API error formats for better exception messages
This PR was squashed before being merged into the 4.3-dev branch (closes#28898).
Discussion
----------
[Console] Add dumper
| Q | A
| ------------- | ---
| Branch? | master
| 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 | https://github.com/symfony/symfony-docs/issues/10502
This PR adds a new `Dumper` helper in the Console component. As there are 2 types of dumps
- debug purpose (e.g. `dd()`, `dump()`)
- output purpose (see #24208, #27684)
For the latter we cannot use the global system (debug) dumper, i.e. `VarDumper::dump()`, we need something tied to the current output and dependency free. Here it is:
```php
$io = new SymfonyStyle($input, $output);
$dumper = new Dumper($io);
$io->writeln($dumper([-0.5, 0, 1]));
$io->writeln($dumper(new \stdClass()));
$io->writeln($dumper(123));
$io->writeln($dumper('foo'));
$io->writeln($dumper(null));
$io->writeln($dumper(true));
```
With VarDumper comonent:
![image](https://user-images.githubusercontent.com/1047696/47069483-4cc26f80-d1ef-11e8-902e-2f9b0f040f25.png)
Without:
![image](https://user-images.githubusercontent.com/1047696/47069517-6663b700-d1ef-11e8-9328-ae1db0b83d7e.png)
> https://github.com/symfony/symfony/pull/27684#discussion_r224054237 var-dumper is not a mandatory dep of fwb, can we do without?
Now we can :)
Commits
-------
fc7465c02c [Console] Add dumper
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] added CachingHttpClient
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
The proposed `CachingHttpClient` uses `HttpCache` from the HttpKernel component to provide an HTTP-compliant cache.
If this is accepted, it could replace the corresponding part in #30602
Commits
-------
dae5686722 [HttpClient] added CachingHttpClient
This PR was merged into the 4.3-dev branch.
Discussion
----------
[BrowserKit] Add support for HttpClient
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no <!-- 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 | part of #30502
| License | MIT
| Doc PR | not yet
When combining the power of the new HttpClient component with the BrowserKit and Mime components, we can makes something really powerful... a full/better/awesome replacement for https://github.com/FriendsOfPHP/Goutte.
So, this PR is about integrating the HttpClient component with BrowserKit to give users a high-level interface to ease usages in the most common use cases.
Scraping websites can be done like this:
```php
use Symfony\Component\BrowserKit\HttpBrowser;
use Symfony\Component\HttpClient\HttpClient;
$client = HttpClient::create();
$browser = new HttpBrowser($client);
$browser->request('GET', 'https://example.com/');
$browser->clickLink('Log In');
$browser->submitForm('Sign In', ['username' => 'me', 'password' => 'pass']);
$browser->clickLink('Subscriptions')->filter('table tr:nth-child(2) td:nth-child(2)')->each(function ($node) {
echo trim($node->text())."\n";
});
```
And voilà! Nice, isn't?
Want to add HTTP cache? Sure:
```php
use Symfony\Component\HttpKernel\HttpCache\Store;
$client = HttpClient::create();
$store = new Store(sys_get_temp_dir().'/http-cache-store');
$browser = new HttpBrowser($client, $store);
// ...
```
Want logging and debugging of HTTP Cache? Yep:
```php
use Psr\Log\AbstractLogger;
class EchoLogger extends AbstractLogger
{
public function log($level, $message, array $context = [])
{
echo $message."\n";
}
}
$browser = new HttpBrowser($client, $store, new EchoLogger());
```
The first time you run your code, you will get an output similar to:
```
Request: GET https://twig.symfony.com/
Response: 200 https://twig.symfony.com/
Cache: GET /: miss, store
Request: GET https://twig.symfony.com/doc/2.x/
Response: 200 https://twig.symfony.com/doc/2.x/
Cache: GET /doc/2.x/: miss, store
```
But then:
```
Cache: GET /: fresh
Cache: GET /doc/2.x/: fresh
```
Limit is the sky here as you get the full power of all the Symfony ecosystem.
Under the hood, these examples leverage HttpFoundation, HttpKernel (with HttpCache),
DomCrawler, BrowserKit, CssSelector, HttpClient, Mime, ...
Excited?
P.S. : Tests need to wait for the HttpClient Mock class to land into master.
Commits
-------
b5b2a2557c Add tests for HttpBrowser
dd55845706 [BrowserKit] added support for HttpClient
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] Update Client class to KernelBrowser
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
I updated recently the WebTestCase with a check to provide a better/more clear exception message (see #30479). After that change @fabpot renamed different `Client` classes in components to a clearer name (for ex Client in HttpKernel is now KernelBrowser etc.). This PR aims to replace the Client in WebTestCase to the new name class name.
Commits
-------
28b6dd243e Replace class with new name.
This PR was merged into the 4.3-dev branch.
Discussion
----------
Allow user to set the project dir
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | <!-- symfony/symfony-docs#... required for new features -->
Currently, the project directory is defined by the location of the composer.json file.
That file is not required in production, which therefore [breaks the method getProjectDir](https://github.com/symfony/symfony/issues/23950) (who sends back null).
The offered solution, while working, requires the developer to implement it, and uses inheritance override, while a more aesthetic solution could be used.
This does not fix the behaviour, but allows the developer to pass the project dir as a parameter.
While this solution does not include BC break or anything, it is important to notice that it includes
**an optional parameter**.
[Object instantiation in the framework bundle recipe](https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/4.2/public/index.php#L23) could be updated as follow (in another PR):
```php
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
```
```php
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG'], dirname(__DIR__));
```
Commits
-------
c40017d63c Allow user to set the project dir
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] Add a ScopingHttpClient
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR is a follow up of #30592 by @XuruDragon, with two main differences:
- I think `ScopingHttpClient` might be a better name for what is called a `ConditionalHttpClient` there,
- the `FrameworkBundle` part is removed so that it can be submitted separately later on.
With a `ScopingHttpClient`, you can add some default options conditionally based on the requested URL and a regexp that it should match. This allows building clients that add e.g. credentials based on the requested scheme/host/path.
When the requested URL is a relative one, a default index can be provided - whose corresponding default options (the `base_uri` one especially) will be used to turn it into an absolute URL.
Regexps are anchored on their left side.
E.g. this defines a client that will send some github token when a request is made to the corresponding API, and will not send those credentials if any other host is requested, while also turning relative URLs to github ones:
```php
$client = HttpClient::create();
$githubClient = new ScopingClient($client, [
'http://api\.github\.com/' => [
'base_uri' => 'http://api.github.com/',
'headers' => ['Authorization: token '.$githubToken],
],
], 'http://api\.github\.com/');
```
Of course, it's possible to define several regexps as keys so that one can create a client that is authenticated against several hosts/paths.
Commits
-------
1ee0a1147a [HttpClient] Add a ScopingHttpClient
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Security] undeprecate the RoleHierarchyInterface
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/22048#discussion_r260247046
| License | MIT
| Doc PR |
Instead of deprecating the interface it is sufficient to deprecate its
getReachableRoles() method and add a new getReachableRoleNames() method
in Symfony 5.
Commits
-------
2d3f2b7a74 undeprecate the RoleHierarchyInterface
This PR was merged into the 4.3-dev branch.
Discussion
----------
Fixing a bug where messenger:consume could send message to wrong bus
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | arguably, yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30631
| License | MIT
| Doc PR | Not needed
This fixes#30631, where you can run `messener:consume` and accidentally sent received messages into the wrong bus.
The fix (done via middleware) is to attach a "bus name" to the `Envelope` and use it when the message is received to find that bus.
Commits
-------
ef077cf26c Fixing a bug where a transport could receive a message and dispatch it to a different bus
This PR was merged into the 4.3-dev branch.
Discussion
----------
Dispatching two events when a message is sent & handled
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | TODO
Alternative to #30646. This uses a more generic system, so you could do anything when a message is sent. The main use-case is when a message is dispatched by a 3rd party.
I didn't try to add *exhaustive* events everywhere: I added an event for a very specific use-case:
When a message is dispatched by a 3rd party, being able to add stamps (e.g. `DelayStamp` or a future `AmqpRoutingKeyStamp` before the message is sent. Example:
```php
class MailerMessageSendToTransportEventSubscriber implements EventSubscriberInterface
{
public function onSendMessage(SendMessageToTransportsEvent $event)
{
$envelope = $event->getEnvelope();
if (!$envelope->getMessage() instanceof SomeMailerMessage) {
return;
}
$event->setEnvelope($envelope->with(new AmpqRoutingKeyStamp('mailer-route')));
}
public static function getSubscribedEvents()
{
return [SendMessageToTransportsEvent::class => 'onSendMessage'];
}
}
```
Along with #30557, we will now have the following events, regarding async messages:
* Event when a message is sent to transports (this PR)
* Event when a message is received from transport, but before handling it
* Event when a message is received from transport and after handling it
Commits
-------
a7ad1b4ccc Dispatching two events when a message is sent & handled
Currently, the project directory is defined by the location of the composer.json file.
That file is not required in production, which therefore breaks the method getProjectDir (who sends back null).
This does not fix the behaviour, but allows the developer to pass the project dir as a parameter.
Instead of deprecating the interface it is sufficient to deprecate its
getReachableRoles() method and add a new getReachableRoleNames() method
in Symfony 5.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Workflow] Deprecate MultipleStateMarkingStore and SingleStateMarkingStore in favor of MethodMarkingStore
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
4d58beb7c8 [Workflow] Deprecate MultipleStateMarkingStore and SingleStateMarkingStore in favor of MethodMarkingStore
This PR was merged into the 4.3-dev branch.
Discussion
----------
Make MethodMarkingStore final
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Made `MethodMarkingStore` final as proposed in https://github.com/symfony/symfony/pull/29146#issuecomment-475574327.
Commits
-------
bbf582bce5 Make MethodMarkingStore final
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Workflow] Added support for many inital places
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #30080
| License | MIT
| Doc PR |
Commits
-------
1af1bf29ef Added support for many inital places
* 4.2:
[Phpunit] fixed support for PHP 5.3
Response prepare method update
[Workflow] Added missing license header
Fix case when multiple loaders are providing paths for the same namespace
Check if Client exists when test.client does not exist, to provide clearer exception message
throw TypeErrors to prepare for type hints in 5.0
[Form] Preventing validation of children if parent with Valid constraint has no validation groups
[Form] Added ResetInterface to CachingFactoryDecorator
Remove deprecated usage
[Tests] fixed compatbility of assertEquals(): void
Fixed usage of TranslatorInterface in form extension (fixes#30591)
[Intl][4.2] Fix test
[Intl] Fix test
[Validator] Add the missing translations for the Arabic (ar) locale
[Intl] Add compile binary
Fix DebugCommand when chain loader is involved
[Form] Fixed some phpdocs
* 3.4:
[Phpunit] fixed support for PHP 5.3
Response prepare method update
[Workflow] Added missing license header
Check if Client exists when test.client does not exist, to provide clearer exception message
[Form] Preventing validation of children if parent with Valid constraint has no validation groups
[Tests] fixed compatbility of assertEquals(): void
[Intl] Fix test
[Validator] Add the missing translations for the Arabic (ar) locale
[Intl] Add compile binary
[Form] Fixed some phpdocs
This PR was squashed before being merged into the 4.3-dev branch (closes#30448).
Discussion
----------
[Finder] Ignore paths from .gitignore #26714
| Q | A
| ------------- | ---
| Branch? | master for features
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26714
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- 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.
-->
Implementation of feature request #26714
Finder::ignoreVCS() is great at ignoring file patterns for the files created by popular VCS systems.
However, it would be great to be able to instruct Finder to actually exclude the paths excluded by .gitignore.
So if we have .gitignore:
vendor/
cache/
Finder::create()
->files()
->ignoreVCS(true) // <--- Ignores `.git`
->ignoreVCSIgnored(true); // <--- Ignores vendor/ and cache/
Commits
-------
9491393dc2 [Finder] Ignore paths from .gitignore #26714
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] improve MockResponse
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
While working with `MockHttpClient`, we figured out these would be useful:
- `MockResponse::getRequestOptions()` to get the options that were used when doing the request
- relax the format of the `raw_headers` info and allow it to be defined as name=>value(s) pairs.
Commits
-------
26f6e28160 [HttpClient] improve MockResponse
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Routing] Exposed "utf8" option, defaults "locale" and "format" in configuration
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ~
| License | MIT
| Doc PR | symfony/symfony-docs#11126
A sibling to #30501, everything is in the title :).
Commits
-------
2911490c80 [Routing] Exposed "utf8" option, defaults "locale" and "format" in configuration
This PR was merged into the 4.3-dev branch.
Discussion
----------
[EventDispatcher] swap arguments of dispatch() to allow registering events by FQCN
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
PR green and ready. From UPGRADE files:
EventDispatcher
---------------
* The signature of the `EventDispatcherInterface::dispatch()` method should be updated to `dispatch($event, string $eventName = null)`, not doing so is deprecated
HttpKernel
----------
* Renamed `FilterControllerArgumentsEvent` to `ControllerArgumentsEvent`
* Renamed `FilterControllerEvent` to `ControllerEvent`
* Renamed `FilterResponseEvent` to `ResponseEvent`
* Renamed `GetResponseEvent` to `RequestEvent`
* Renamed `GetResponseForControllerResultEvent` to `ViewEvent`
* Renamed `GetResponseForExceptionEvent` to `ExceptionEvent`
* Renamed `PostResponseEvent` to `TerminateEvent`
Security
---------
* The `ListenerInterface` is deprecated, turn your listeners into callables instead.
* The `Firewall::handleRequest()` method is deprecated, use `Firewall::callListeners()` instead.
Commits
-------
75369dabb8 [EventDispatcher] swap arguments of dispatch() to allow registering events by FQCN
This PR was squashed before being merged into the 4.3-dev branch (closes#30605).
Discussion
----------
[Cache] added DSN support for rediss in AbstractAdapter and RedisTrait
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/30573
| License | MIT
A fix for this issue: https://github.com/symfony/symfony/issues/30573
Support for "rediss:" in DSN added.
Commits
-------
7e2852dd44 [Cache] added DSN support for rediss in AbstractAdapter and RedisTrait
This PR was squashed before being merged into the 3.4 branch (closes#30479).
Discussion
----------
Check if Client exists when test.client does not exist, to provide clearer exception message
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30420
| License | MIT
The `DotEnv` component does not overwrite by using environment variables declared in `.env` files.
In the `FrameworkExtension` will be checked if the framework.test config is set to a non-false value, if so it will load the `test.xml` file which contains the definition for the `test.client` service.
When running `php bin/phpunit` it will use `phpunit.xml.dist` but because we defined `APP_ENV` in our system it will not load `test.xml` so when creating a client to do functional tests, we'll get an exception which isn't correct: `You cannot create the client used in functional tests if the BrowserKit component is not available. Try running "composer require symfony/browser-kit"`
This PR aims to add a clearer exception message which indicates what really should be done to fix the error message.
Commits
-------
b429950af6 Check if Client exists when test.client does not exist, to provide clearer exception message
This PR was merged into the 4.2 branch.
Discussion
----------
[Form] Added ResetInterface to CachingFactoryDecorator
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29259
| License | MIT
| Doc PR | ~
I don't know if this should be considered a feature and target master, but I tend to see it as a bug fix.
Commits
-------
4ddf5a14eb [Form] Added ResetInterface to CachingFactoryDecorator
This PR was merged into the 4.2 branch.
Discussion
----------
[Workflow] Remove deprecated usage
| Q | A
| ------------- | ---
| Branch? | master for features / 3.4 up to 4.2 for bug fixes <!-- see below -->
| 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/no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| License | MIT
This is a little improvement suggestion because string usage is deprecated while it's still the default value. `null` is also deprecated but is required for BC.
Commits
-------
eeb3c29fab Remove deprecated usage
This PR was merged into the 4.3-dev branch.
Discussion
----------
throw TypeErrors to prepare for type hints in 5.0
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
10afb99e3f throw TypeErrors to prepare for type hints in 5.0
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] add MockHttpClient
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR introduces `MockHttpClient` and `MockResponse`, to be used for testing classes that need an HTTP client without making actual HTTP requests.
`MockHttpClient` is configured via its constructor: you provide it either with an iterable or a callable, and these will be used to provide responses as the consumer requests them.
Example:
```php
$responses = [
new MockResponse($body1, $info1),
new MockResponse($body2, $info2),
];
$client = new MockHttpClient($responses);
$response1 = $client->request(...); // created from $responses[0]
$response2 = $client->request(...); // created from $responses[1]
```
Or alternatively:
```php
$callback = function ($method, $url, $options) {
return new MockResponse(...);
};
$client = new MockHttpClient($callback);
$response = $client->request(...); // calls $callback internal
```
The responses provided to the client don't have to be instances of `MockResponse` - any `ResponseInterface` works (e.g. `$this->getMockBuilder(ResponseInterface::class)->getMock()`).
Using `MockResponse` allows simulating chunked responses and timeouts:
```php
$body = function () {
yield 'hello';
yield ''; // the empty string is turned into a timeout so that they are easy to test
yield 'world';
};
$mockResponse = new Mockresponse($body);
```
Last but not least, the implementation simulates the full lifecycle of a properly behaving `HttpClientInterface` contracts implementation: error handling, progress function, etc. This is "proved" by `MockHttpClientTest`, who implements and passes the reference test suite in `HttpClientTestCase`.
Commits
-------
8fd7584158 [HttpClient] add MockHttpClient
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Support for handling messages after current bus is finished
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10015
This is a replacement for #27844. We achieve the same goals without introducing the new concept of "recorder".
```php
class CreateUserHandler
{
private $em;
private $eventBus;
public function __construct(MessageBus $eventBus, EntityManagerInterface $em)
{
$this->eventBus = $eventBus;
$this->em = $em;
}
public function __invoke(CreateUser $command)
{
$user = new User($command->getUuid(), $command->getName(), $command->getEmail());
$this->em->persist($user);
$message = new UserCreatedEvent($command->getUuid();
$this->eventBus->dispatch((new Envelope($message))->with(new DispatchAfterCurrentBus()));
}
}
```
Note that this `DispatchAfterCurrentBusMiddleware` is added automatically as the first middleware.
2019-03-13: I updated the PR description.
Commits
-------
903355fbcc Support for handling messages after current bus is finished
This PR was squashed before being merged into the 4.3-dev branch (closes#29538).
Discussion
----------
[Workflow] Add colors to workflow dumps
Fixes#28874
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28874, replaces #28933
| License | MIT
| Doc PR | TODO, requires https://github.com/symfony/symfony-docs/pull/9476
Fetch data with the `MetadataStore` from #26092 in order to add colors to the dumps.
Example of configuration:
```yaml
transitions:
submit:
from: start
to: travis
metadata:
title: transition submit title
dump_style:
label: 'My custom label'
arrow_color: '#0088FF'
label_color: 'Red'
```
This code was developed as a bundle, examples can be found on its repository: https://github.com/alexislefebvre/SymfonyWorkflowStyleBundle
Commits
-------
60ad109533 [Workflow] Add colors to workflow dumps
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DI] Add an url EnvProcessor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/11128
This PR add a new env processor `url` to convert an URL (or DSN) into an array.
The main goal is to simplify the project configuration and reduce the number of env variable when working with bundle which are not able to deal with DSN
(pick some random project in symfony/recipes-contrib: https://github.com/symfony/recipes-contrib/blob/master/facile-it/mongodb-bundle/0.6/manifest.json or https://github.com/symfony/recipes-contrib/blob/master/wouterj/eloquent-bundle/1.0/manifest.json)
```yaml
# before
MONGODB_HOST=localhost
MONGODB_PORT=27017
MONGODB_USER=
MONGODB_PASSWORD=
MONGODB_DB=symfony
mongo_db_bundle:
data_collection: '%kernel.debug%'
clients:
default:
hosts:
- { host: '%env(MONGODB_HOST)%', port: '%env(int:MONGODB_PORT)%' }
username: '%env(MONGODB_USER)%'
password: '%env(MONGODB_PASSWORD)%'
connectTimeoutMS: 3000
connections:
default:
database_name: '%env(MONGODB_DB)%'
# after
MONGODB_DSN=mongodb://localhost:27017/symfony
mongo_db_bundle:
data_collection: '%kernel.debug%'
clients:
default:
hosts:
- { host: '%env(key:host:url:MONGODB_DSN)%', port: '%env(key:port:url:MONGODB_DSN)%' }
username: '%env(key:user:url:MONGODB_DSN)%'
password: '%env(key:pass:url:MONGODB_DSN)%'
connectTimeoutMS: 3000
connections:
default:
database_name: '%env(key:path:url:MONGODB_DSN)%'
```
Added also a `query_string` processor to parse query string
```
DATABASE_DSN=mysql://localhost/db?charset=utf8
foo:
bar:
charset: '%env(key:charset:query_string🔑query:url:DATABASE_DSN)%'
```
Commits
-------
f253c9b7ca Add an url EnvProcessor
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] Add integration of http-client component
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR adds the integration of the HttpClient component on FrameworkBundle.
By default, two services are provided, one implementing SFC-HttpClient, and another PSR18:
* `http_client` + its autowiring alias for `Symfony\Contracts\HttpClient\HttpClientInterface`)
This service is automatically set to the best HTTP client available with the configuration given under the `framework.http_client` key.
* `psr18.http_client` + its autowiring alias for `Psr\Http\Client\ClientInterface`). To make it work, one needs to provide autowiring aliases for `ResponseFactoryInterface` and `StreamFactoryInterface`, which are provided by [the recipe](https://github.com/symfony/recipes-contrib/blob/master/nyholm/psr7/1.0/config/packages/nyholm_psr7.yaml) for `nyholm/psr7` (but could be overriden by apps when using something else).
* one can also configure the default options, and "scoped" clients. For example:
```yaml
http_client:
default_options:
capath: '...'
clients:
github_client:
default_options:
base_uri: 'https://api.github.com'
```
This definition create a `github_client` service implementing SFC-HttpClient and a `psr18.github_client` one implementing PSR18, +2 corresponding named autowiring aliases: `HttpClientInterface $githubClient`, and `ClientInterface $githubClient`.
Commits
-------
f2d2cf3021 work with attributes for xml config
0023a71260 [FrameworkBundle] Add integration of http-client component
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DI] fix casting AutowiringFailedException to string when its callback throws
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30571
| License | MIT
| Doc PR | -
ping @weaverryan
Commits
-------
d57a148b8b [DI] fix casting AutowiringFailedException to string when its callback throws
This PR was squashed before being merged into the 4.3-dev branch (closes#30450).
Discussion
----------
[Profiler] Render the performance graph with SVG
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | Part 1, 3 and 4 of #27262
| License | MIT
| Doc PR | n/a
Following a suggestion by @ogizanagi in #27262,
Here's a proposal to render the Request Graph, from the performance profiler panel, with SVG instead of canvas.
Some benefits of the SVG format:
- The text labels are searchable and can be selected.
- It renders well on high DPI monitors.
- [Colors and text styles](https://github.com/symfony/symfony/issues/27262#issuecomment-388868068) can be defined with CSS just like the rest of the page.
In addition, SVG allow us to consider (and easily implement) interactives features such as:
- Zoom in and time navigation (thanks to the viewport).
- Highlight hovered line (or other DOM related events).
Preview:
![screenshot_2019-03-08 symfony profiler 1](https://user-images.githubusercontent.com/1846873/54036727-a33f4300-41bc-11e9-8be7-b1de10d4afd9.png)
Filtered events example:
![capture d ecran 2019-03-08 a 17 22 47](https://user-images.githubusercontent.com/1846873/54041039-00d88d00-41c7-11e9-9590-23e809415c34.png)
### Progress :
- [x] Render request events in SVG
- [x] Show labels with duration and memory
- [x] Show specific markers at start / end of lines
- [x] Re-render graph when window resize
- [x] Re-render graph when threshold change.
- [x] Generate graph legend with only existing categories (part 1. of #27262 )
- [x] Show sub-request area with hatched pattern
- [x] Allow to hide categories by clicking them on the legend (part 3. of #27262 )
- [x] Handle text overflow on long labels.
- [x] Ensure JS code is compatible with all supported browsers (used [classes](https://caniuse.com/#feat=es6-class) and [arrow functions](https://caniuse.com/#feat=arrow-functions).
- ~Add left-padding to sub-request graph?~
Commits
-------
a69a718ec9 [Profiler] Render the performance graph with SVG
This PR was squashed before being merged into the 4.3-dev branch (closes#30549).
Discussion
----------
[HttpClient] Make exceptions public
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no<!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | n/a
Makes it easier to implement the interface. See api-platform/core#2608
Commits
-------
928d774e4a [HttpClient] Make exceptions public
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Serializer] Normalize constraint violation parameters
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | yes <!-- 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 | N/A <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A?
Adding violation constraints' parameters to the normalized data, as these are valuable for an API client.
I used `parameters` for now, as it's the name used in `ConstraintViolationInterface::getParameters()`, but what about `placeholders` or `context`?
Commits
-------
32c90ebc8e [Serializer] Normalize constraint violation parameters
This PR was squashed before being merged into the 4.3-dev branch (closes#28330).
Discussion
----------
[MonologBridge] Add monolog processors adding route and command info
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | symfony/symfony-docs#10244
This PR adds two simple processors that add context to every log entry.
RouteProcessor adds routing information:
`app.INFO: Some log text {"someContext":"ctx"} {"route":{"controller":"App\\Controller\\SomeController::number","route":"index","route_params":[]}`
ConsoleCommandProcessors adds current command information:
`app.INFO: Some log text {"someContext":"ctx"} {"command":{"name":"app:some-command","arguments":{"command":"app:some-command","some-argument":10}}}`
For ConsoleCommandProcessor I've decided against including command options by default, because there's a lot of default ones:
`"options":{"help":false,"quiet":false,"verbose":false,"version":false,"ansi":false,"no-ansi":false,"no-interaction":false,"env":"dev","no-debug":false}`. This behavior can be changed with a constructor argument.
Commits
-------
669f6b2726 [MonologBridge] Add monolog processors adding route and command info
This PR was merged into the 3.4 branch.
Discussion
----------
[Intl] Add compile binary
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no-ish
| 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 -->
Compile the Intl data by invoking a single command, and make it work out-of-the-box. (Split from #28831)
```bash
$ src/Symfony/Component/Intl/Resources/bin/compile
```
run in repository root because of
b7e798ef74/src/Symfony/Component/Intl/Data/Generator/LocaleDataGenerator.php (L141)
3.4 is ok, 4.2 is not because of #28833 but new locales are introduced in https://github.com/symfony/symfony/pull/28977/files#diff-f52da32e1ee6b93598814090d0749aa6R1
So as long as 3.4 is supported, but branches above add filters etc. during generation we're risking this discrepancy. I suggest after merge in upper branches to re-run `compile` (potential for automating, but run if needed :))
Commits
-------
426b92f4a8 [Intl] Add compile binary
* 4.2:
Fix Cache error while using anonymous class
[Cache] fix LockRegistry
Update validators.cs.xlf
Make translations consistent with other translations.
Correct language code for ukrainian language in security translations.
Fix return type of Request::getRequestFormat
[Cache] Fix perf when using RedisCluster by reducing roundtrips to the servers
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DependencyInjection] Add ability to define an index for service in an injected service locator argument
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | in progress / symfony/symfony-docs#...
It's more or less the same thing then the PR #30257 but for a service locator argument
Add a simple way to specify an index based on a tag attribute to simplify retrieving a specific service when injecting a service locator as argument into services, but also a way to fallback to a static method on the service class.
Yaml:
```yaml
services:
foo_service:
class: Foo
tags:
- {name: foo_tag, key: foo_service}
foo_service_tagged:
class: Bar
arguments:
- !tagged_locator
tag: 'foo_tag'
index_by: 'key'
default_index_method: 'static_method'
```
XML:
```xml
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/serviceshttp://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="foo" class="Foo">
<tag name="foo_tag" key="foo_service" />
</service>
<service id="foo_tagged_iterator" class="Bar" public="true">
<argument type="tagged_locator" tag="foo_tag" index-by="key" default-index-method="static_method" />
</service>
</services>
</container>
```
PHP:
```php
// config/services.php
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
$container->register(Foo::class)
->addTag('foo_tag', ['key' => 'foo_service']);
$container->register(App\Handler\HandlerCollection::class)
// inject all services tagged with app.handler as first argument
->addArgument(new ServiceLocatorArgument(new TaggedIteratorArgument('app.handler', 'key')));
```
Usage:
```php
// src/Handler/HandlerCollection.php
namespace App\Handler;
use Symfony\Component\DependencyInjection\ServiceLocator;
class HandlerCollection
{
public function __construct(ServiceLocator $serviceLocator)
{
$foo = $serviceLocator->get('foo_service'):
}
}
```
Tasks
* [x] Support PHP loader/dumper
* [x] Support YAML loader/dumper
* [x] Support XML loader/dumper (and update XSD too)
* [x] Add tests
* [x] Documentation
Commits
-------
cb3c56bc0c Support indexing tagged locators by FQCN as fallback
250a2c8332 [DI] Allow tagged_locator tag to be used as an argument
This PR was squashed before being merged into the 4.3-dev branch (closes#30469).
Discussion
----------
Create a hyperlink to interfaces/classes that can be autowired
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Added hyperlink to definition of interfaces/classes that can be used for autowiring.
But I need help with:
- the aliases are becoming hyperlinks too, but shouldn't.
It's outputting `<fg=yellow;href=phpstorm://open?file=filepath&line=17>Symfony\Contracts\Translation\TranslatorInterface</> <fg=cyan>(translator.default)</>`
- it currently works with phpstorm because it's hardcoded but it should work with framework.ide option, but don't know what the best approach is to support that config option.
Commits
-------
a3dfcee406 Create a hyperlink to interfaces/classes that can be autowired
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DI] add ReverseContainer: a locator that turns services back to their ids
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR introduces a `ReverseContainer`, which is a class you can type hint for to get it as a service.
When you have a `ReverseContainer` at hand, you can then use it to know the service id of an object (if the object is not found, `null` is returned):
`$id = $reverseContainer->getId($someObject);`
You can also call `$reverseContainer->getService($id);` and get the service in return.
To be reversible, a service must either be public or be tagged with `container.reversible`.
I'm using this feature to serialize service references in a message, then send them through a Messenger bus, allowing the handler on the other side to use that referenced service to process the message. More specifically, my use case is sending messages for early cache expiration events through a bus and have a worker compute the soon-to-expire value in the background. The reversible services are the computation callbacks and the cache pools I need to compute the value for.
Commits
-------
ac1e4291e8 [DI] add ReverseContainer: a locator that turns services back to their ids
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] deprecate LoggingMiddleware in favor of providing a logger to SendMessageMiddleware
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Discussing with @simensen, we figured out the currently logged messages are not precise enough.
Logging is a cross-cutting concern: splitting it in a dedicated middleware means losing details - or building complexity.
Let's make things simple and log the best messages depending on the internal situation.
While the component is experimental, removing the `LoggingMiddleware` altogether would break FrameworkBundle 4.2 when it is used with Messenger 4.3. Not worth the trouble when it's two lines to deprecate IMHO.
Commits
-------
2bff625abe [Messenger] deprecate LoggingMiddleware in favor of providing a logger to SendMessageMiddleware
This PR was squashed before being merged into the 4.3-dev branch (closes#30547).
Discussion
----------
[HttpClient] Add new bearer option
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes<!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | n/a
Add a new "auth_bearer" option to set the corresponding flavor of the `Authorization` header as defined in RFC 6750 and used in OAuth (and others).
Also rename "auth" to "auth_basic" for consistency as discussed with @nicolas-grekas.
Commits
-------
f79ef21458 [HttpClient] Add new bearer option
* 3.4:
Make translations consistent with other translations.
Correct language code for ukrainian language in security translations.
Fix return type of Request::getRequestFormat
[Cache] Fix perf when using RedisCluster by reducing roundtrips to the servers
This PR was merged into the 3.4 branch.
Discussion
----------
Correct language code for ukrainian language
| 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 |
Correct language code for [ukrainian language](https://en.wikipedia.org/wiki/Ukrainian_language) is **uk**, not **ua**. Similar bug was earlier addressed in #5972, but somehow it appeared here again. Possible BC break in case someone relies on "ua" version being present, but I think that is a minor problem.
Commits
-------
b86fa9312b Correct language code for ukrainian language in security translations.
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Improve Bulgarian translations.
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- see below -->
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | none <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | none <!-- 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.
-->
This pull request is an improvement on top of #30227 and improves translations in the following ways:
- Make consistent how `This` word is translated.
- Make consistent how `This value` is translated.
- Fix capitalization rules for abbreviations.
- Change `email` to `имейл` (this is a word in the official Bulgarian dictionary).
- Removes unnecessary words in brackets.
Feel free to comment and criticize I'm not a professional translator.
Commits
-------
d15c76cd53 Make translations consistent with other translations.
This PR was merged into the 3.4 branch.
Discussion
----------
[Cache] Fix perf when using RedisCluster by reducing roundtrips to the servers
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
This is slimmed down version of: https://github.com/symfony/symfony/pull/28269 _(many of the fixes there are already part of 3.4)_
Does:
- Adds test coverage for Predis with RedisCluster
- Removes usage of key versioning when on RedisCluster, besides performance aspect of that it simplifies / aligning clear() handling across all clients
- reuse doDelete() from clear to make sure we call singular del calls when in predis cluster
Commits
-------
dacf17962b [Cache] Fix perf when using RedisCluster by reducing roundtrips to the servers
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] Fix debug form when using partial type name
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
Since https://github.com/symfony/symfony/pull/29452 (4.3) we have the possibility of passing a partial type name. This fixes the case where `debug:form dateTime` doesn't work as expected:
```bash
In FormRegistry.php line 89:
[Symfony\Component\Form\Exception\InvalidArgumentException]
Could not load type "dateTime": class does not implement "Symfony\Component\Form\FormTypeInterface".
```
Commits
-------
22b20cab10 Fix debug:form dateTime
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Workflow] Move code from ValidateWorkflowsPass to the FrameworkExtension
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
---
Just some cleaning. See
https://github.com/symfony/symfony/pull/29146#issuecomment-44418654
Commits
-------
a608797165 [Workflow] Move code from ValidateWorkflowsPass to the FrameworkExtension
This PR was merged into the 4.3-dev branch.
Discussion
----------
[BrowserKit] Rename Client to Browser
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
`Client` is very generic and used in 3 places: BrowserKit, HttpKernel, and FramewrokBundle. Each Client extends another one. So, to make things clearer, I'd like to rename Client to Browser like this:
Symfony\Component\BrowerKit\Client -> AbstractBrowser
Symfony\Component\HttpKernel\Client -> HttpKernelBrowser
Symfony\Bundle\FrameworkBundle\Client -> KernelBrowser
The next PR will introduce an `HttpBrowser` based on the new HttpClient component :)
Commits
-------
dbe4f8605b renamed Client to Browser
This PR was merged into the 4.2 branch.
Discussion
----------
[Messenger] Fix README about BC promise
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
We don't have a BC *break* policy :)
Should be applied to MIME and HttpClient when merging into master.
Commits
-------
9b2af69403 Fix README about BC promise
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] yield a last chunk for completed responses also
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
When a response completed, streaming it again yields no chunks right now.
This PR makes it yield a `LastChunk` - or an `ErrorChunk` when applicable.
The reasoning for the previous behavior was that streams should yield only activity from the network.
But this looks more complex to use in practice. The proposed behavior is simpler to reason about I think.
Commits
-------
e11ef7ed12 [HttpClient] yield a last chunk for completed responses also
* 4.2:
[Cache] Only delete one key at a time when on Predis + Cluster
[Validator] Add missing translations for Swedish locale
[Process] fix using argument $php of new PhpProcess()
[Routing] removed a useless var
[Routing] Fixed XML options resolution
This is slimmed down version of: https://github.com/symfony/symfony/pull/28269 _(many of the fixes here are already part of 3.4)_
Adds:
- Test coverage for Predis with RedisCluster
- Removes usage of key versioning when on RedisCluster, besides performance aspect of that simplify / aligning clear() handling across cases
* 3.4:
[Cache] Only delete one key at a time when on Predis + Cluster
[Validator] Add missing translations for Swedish locale
[Routing] removed a useless var
[Routing] Fixed XML options resolution
This PR was merged into the 3.4 branch.
Discussion
----------
[Cache] Only delete one key at a time when on Predis + Cluster
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Makes sure deletes when on Predis Cluster is only done one by one as it's not able to send the keys to right cluster node like RedisCluster can.
_This is backport of logic from 4.x to fix this. With one tweak; make sure to only do this when on cluster so not all Predis users pay the penalty for it._
Commits
-------
f5ece20a83 [Cache] Only delete one key at a time when on Predis + Cluster
This PR was merged into the 3.4 branch.
Discussion
----------
[Routing] Fixed XML options resolution
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ~
| License | MIT
| Doc PR | ~
Found this bug while adding tests in #30501. I need it to be merged upward so it can get green there.
Thanks!
Commits
-------
53a6ff88f7 [Routing] Fixed XML options resolution
This PR was merged into the 3.4 branch.
Discussion
----------
[Routing] removed a useless var
| 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 was never documented, we should rely on `$routes->import()` instead.
Commits
-------
10c1313d41 [Routing] removed a useless var
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Add the missing translations for the Swedish ("sv") locale
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30190
| License | MIT
| Doc PR | -
Added the missing translations to the `src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf` file.
Commits
-------
7e9f63da43 [Validator] Add missing translations for Swedish locale
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DI] replace "nullable" env processor by improving the "default" one
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Neither `nullable` nor `default` are released yet.
I propose to replace the `nullable` processor (see #29767) with an improved `default` one (from #28976).
`%env(default::FOO)%` now defaults to `null` when the env var doesn't exist or compares to false".
ping @jderusse @bpolaszek
Commits
-------
c50aad2be1 [DI] replace "nullable" env processor by improving the "default" one
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] add ResponseInterface::toArray()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
I'd like we discuss adding a `toArray()` method to `ResponseInterface`.
JSON responses are so common when doing server-side requests that this may help remove boilerplate - especially the logic dealing with errors.
WDYT?
(about flags, I don't think we should make them configurable: if one really needs to deal with custom flags, there's always `ResponseInterface::getContent()` - but it should be very rare.).
Commits
-------
aabd1d455e [HttpClient] add ResponseInterface::toArray()
* 4.2: (27 commits)
cs fix
cs fix
[PHPUnit-Bridge] override some environment variables
[TwigBridge] Remove use spaceless tag
Upgrade zookeeper ext
[translation] Update defaut format from yml to yaml
Change default log level for output streams
update docblock to match the actual behavior
Don't resolve the Deprecation error handler mode until a deprecation is triggered
compatibility with phpunit8
Make 'headers' key optional for encoded messages
[Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods
Fix undefined variable fromConstructor when passing context to getTypes
Added translations for chineese language.
Allow 3rd argument to be null
Remove whitespace (tab on blank line)
[Monolog] Really reset logger when calling logger::reset()
[Form] Fixes debug:form appears many times as type extensions configured with new getExtendedTypes method
Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
...
* 3.4:
cs fix
cs fix
[PHPUnit-Bridge] override some environment variables
[TwigBridge] Remove use spaceless tag
[translation] Update defaut format from yml to yaml
Change default log level for output streams
update docblock to match the actual behavior
compatibility with phpunit8
[Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods
Added translations for chineese language.
This PR was merged into the 3.4 branch.
Discussion
----------
[TwigBridge] Remove usages of the spaceless tag
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
The spaceless tag is deprecated since version 2.7.
Commits
-------
2ee178b5c5 [TwigBridge] Remove use spaceless tag
This PR was merged into the 4.2 branch.
Discussion
----------
[Messenger] Make 'headers' key optional for encoded messages
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30455
| License | MIT
Commits
-------
bb881c9cd0 Make 'headers' key optional for encoded messages
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Translation] Add XLIFF 1 source to metadata to differentiate from attr
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Here's our use case this patch solves:
We have 2 translation files. One is created by developer and has empty `<target>`. Second one is created by translator and has non-empty `<target>`, but same `<source>`.
Now, unlike Symfony fixtures, we also use `resname=` XLIFF1 attribute. This allows us to detect when translation is out of date, which happens when `<source>` in dev translation is changed, but `resname=` is not. As visualization which better illustrates problem:
dev.xlf:
```xml
<trans-unit id="source_is_different" resname="source_is_different">
<source>Welcome to Calida</source>
</trans-unit>
```
real.xlf:
```xml
<trans-unit id="source_is_different" resname="source_is_different">
<source>Welcome to Jacqueline</source>
<target>Willkommen bei Jacqueline</target>
</trans-unit>
```
We need to be able to tell `<source>` for this pair is different (so we prepend alert glyph to translation message, to alert developer something is wrong). In current XliffFileLoader there is no way for consumer to figure out if translation key came from `resname` or `<source>`, so we had to copy whole loader.
Commits
-------
ab04f25da4 [Translation] Add XLIFF 1 source to metadata to differentiate from attr
This PR was merged into the 3.4 branch.
Discussion
----------
compatibility with phpunit8
This basically adds the same phpunit8 compatibility layer added in https://github.com/symfony/symfony/pull/30084 (but for other test classes)
See also discussion in https://github.com/symfony/symfony/issues/30071
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30071
| License | MIT
| Doc PR | none
Commits
-------
5ef254fa65 compatibility with phpunit8
This PR was squashed before being merged into the 3.4 branch (closes#30498).
Discussion
----------
[translation] Update defaut format from yml to yaml
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #30443
| License | MIT
| Doc PR |
As stated in #30443 , command `php bin/console translation:update --dump-messages --force fr` will by default output the translation to yml format, which is not supported by Symfony
Commits
-------
ba42030641 [translation] Update defaut format from yml to yaml
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpClient] fixes
| Q | A
| ------------- | ---
| Branch? | master
| 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 client.
There is an issue with 307/308 redirects + streamed body that is not fixed here; use string bodies for now.
I'm going to look for a solution in another PR.
Commits
-------
3eca2b448d [HttpClient] fixes
This PR was squashed before being merged into the 4.3-dev branch (closes#30482).
Discussion
----------
[Mime] Fix support for date form parts
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
<!--
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.
-->
Commits
-------
5c8a4e3deb [Mime] removed the 2 parts constraints on Multipart (not true for DataFormPart for instance)
0450c4f244 [Mime] fixed support for date form parts
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Mime] Use "yield from" when possible
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
df1b627417 [Mime] used yield-from when possible
This PR was squashed before being merged into the 4.3-dev branch (closes#30385).
Discussion
----------
[SecurityBundle] Validate the IPs configured in access_control
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30299
| License | MIT
| Doc PR | -
Commits
-------
857ac9519e [SecurityBundle] Validate the IPs configured in access_control
This PR was squashed before being merged into the 4.3-dev branch (closes#30413).
Discussion
----------
[HttpClient][Contracts] introduce component and related contracts
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28628
| License | MIT
| Doc PR | -
This PR introduces new `HttpClient` contracts and
component. It makes no compromises between DX, performance, and design.
Its surface should be very simple to use, while still flexible enough
to cover most advanced use cases thanks to streaming+laziness.
Common existing HTTP clients for PHP rely on PSR-7, which is complex
and orthogonal to the way Symfony is designed. More reasons we need
this in core are the [package principles](https://en.wikipedia.org/wiki/Package_principles): if we want to be able to keep our
BC+deprecation promises, we have to build on more stable and more
abstract dependencies than Symfony itself. And we need an HTTP client
for e.g. Symfony Mailer or #27738.
The existing state-of-the-art puts a quite high bar in terms of features we must
support if we want any adoption. The code in this PR aims at implementing an
even better HTTP client for PHP than existing ones, with more (useful) features
and a better architecture. What a pitch :)
Two full implementations are provided:
- `NativeHttpClient` is based on the native "http" stream wrapper.
It's the most portable one but relies on a blocking `fopen()`.
- `CurlHttpClient` relies on the curl extension. It supports full
concurrency and HTTP/2, including server push.
Here are some examples that work with both clients.
For simple cases, all the methods on responses are synchronous:
```php
$client = new NativeHttpClient();
$response = $client->get('https://google.com');
$statusCode = $response->getStatusCode();
$headers = $response->getHeaders();
$content = $response->getContent();
```
By default, clients follow redirects. On `3xx`, `4xx` or `5xx`, the `getHeaders()` and `getContent()` methods throw an exception, unless their `$throw` argument is set to `false`.
This is part of the "failsafe" design of the component. Another example of this
failsafe property is that broken dechunk or gzip streams always trigger an exception,
unlike most other HTTP clients who can silently ignore the situations.
An array of options allows adjusting the behavior when sending requests.
They are documented in `HttpClientInterface`.
When several responses are 1) first requested in batch, 2) then accessed
via any of their public methods, requests are done concurrently while
waiting for one.
For more advanced use cases, when streaming is needed:
Streaming the request body is possible via the "body" request option.
Streaming the response content is done via client's `stream()` method:
```php
$client = new CurlHttpClient();
$response = $client->request('GET', 'http://...');
$output = fopen('output.file', 'w');
foreach ($client->stream($response) as $chunk) {
fwrite($output, $chunk->getContent());
}
```
The `stream()` method also works with multiple responses:
```php
$client = new CurlHttpClient();
$pool = [];
for ($i = 0; $i < 379; ++$i) {
$uri = "https://http2.akamai.com/demo/tile-$i.png";
$pool[] = $client->get($uri);
}
$chunks = $client->stream($pool);
foreach ($chunks as $response => $chunk) {
// $chunk is a ChunkInterface object
if ($chunk->isLast()) {
$content = $response->getContent();
}
}
```
The `stream()` method accepts a second `$timeout` argument: responses that
are *inactive* for longer than the timeout will emit an empty chunk to signal
it. Providing `0` as timeout allows monitoring responses in a non-blocking way.
Implemented:
- flexible contracts for HTTP clients
- `fopen()` + `curl`-based clients with close feature parity
- gzip compression enabled when possible
- streaming multiple responses concurrently
- `base_uri` option for scoped clients
- progress callback with detailed info and able to cancel the request
- more flexible options for precise behavior control
- flexible timeout management allowing e.g. server sent events
- public key pinning
- auto proxy configuration via env vars
- transparent IDN support
- `HttpClient::create()` factory
- extensive error handling, e.g. on broken dechunk/gzip streams
- time stats, primary_ip and other info inspired from `curl_getinfo()`
- transparent HTTP/2-push support with authority validation
- `Psr18Client` for integration with libs relying on PSR-18
- free from memory leaks by avoiding circular references
- fixed handling of redirects when using the `fopen`-based client
- DNS cache pre-population with `resolve` option
Help wanted (can be done after merge):
- `FrameworkBundle` integration: autowireable alias + semantic configuration for default options
- add `TraceableHttpClient` and integrate with the profiler
- logger integration
- add a mock client
More ideas:
- record/replay like CsaGuzzleBundle
- use raw sockets instead of the HTTP stream wrapper
- `cookie_jar` option
- HTTP/HSTS cache
- using the symfony CLI binary to test ssl-related options, HTTP/2-push, etc.
- add "auto" mode to the "buffer" option, based on the content-type? or array of content-types to buffer
- *etc.*
Commits
-------
fc83120691 [HttpClient] Add Psr18Client - aka a PSR-18 adapter
8610668c1c [HttpClient] introduce the component
d2d63a28e1 [Contracts] introduce HttpClient contracts
This PR was squashed before being merged into the 4.3-dev branch (closes#30377).
Discussion
----------
[Validator] add MIR card scheme
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30376
| License | MIT
Commits
-------
aecb33a620 [Validator] add MIR card scheme
This PR was merged into the 4.2 branch.
Discussion
----------
[Form] Avoid a form type extension appears many times in debug:form
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30394 <!-- #-prefixed issue number(s), if any -->
| License | MIT
This PR fixes#30394. Avoid a form type extension appears many times in debug:form command. This is caused by new 4.2 feature getExtendedTypes().
Commits
-------
c4be39ce21 [Form] Fixes debug:form appears many times as type extensions configured with new getExtendedTypes method
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] Allow to disable and customize PercentType symbol
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #28796 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#11078
<!--
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.
-->
## `PercentType` `symbol` option
As of this writing, Symfony will forcibly append a percentage sign (`%`) to all input fields that are of the PercentType form type. This PR will introduce a boolean flag called `symbol` that, when `false`, will not display the percentage sign. Each of the default layouts that define percent_widget will respect this option. You could also use a customised string as value for `symbol` option.
By default, this new option will be set to `true` so that it maintains backward compatibility. The unit tests have been updated where appropriate, and a new unit test has been added (as appropriate).
Commits
-------
53c5f41f37 [Form] Allow to disable and customize PercentType symbol
9aeaea06fc Add ‘symbol’ option to PercentType
This PR was merged into the 4.2 branch.
Discussion
----------
[PropertyInfo] Fix undefined variable fromConstructor when passing context to getTypes
| Q | A
| ------------- | ---
| Branch? | 4.1, 4.2, master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | symfony/symfony-docs#10969
| License | MIT
| Doc PR |
If passing context to getTypes, it checks value of $context['enable_constructor_extraction'] for true/false or the constructor value of enableConstructorExtraction and should then populate fromConstructor if necessary. The missing brackets around the first part of this check mean that fromConstructor is only applied if context is not set.
This fixes the issue described at [symfony/symfony-docs#10969](https://github.com/symfony/symfony-docs/pull/10969)
Commits
-------
8e401afa37 Allow 3rd argument to be null
04dc6921bd Remove whitespace (tab on blank line)
a0aa15a41e Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
c2986d5e40 Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
42995c859c Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
2d88298ace Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
e43a3bce11 Update ReflectionExtractorTest.php
2c91c754bc Update ReflectionExtractorTest.php
5acc85c48b Update ReflectionExtractorTest.php
d0a2dc0a2d Update ReflectionExtractorTest.php
be8d14a129 Fix undefined variable fromConstructor when passing context to getTypes
This PR was squashed before being merged into the 4.3-dev branch (closes#30325).
Discussion
----------
[HttpKernel] Prevent search engines from indexing dev applications
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30318
| License | MIT
| Doc PR | TODO
Add the *X-Robots-Tag: noindex* to dev (and test) applications to prevent search engines to index them.
Commits
-------
3dd86719bf [HttpKernel] Prevent search engines from indexing dev applications
This PR was squashed before being merged into the 4.3-dev branch (closes#30445).
Discussion
----------
[Mime] Fix generate message id with named address
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR |
When using a NamedAddress in from(), the generated MessageId don't pass the validation.
In effect, the email passed to generateMessageId look like this `Fabien <fabien@symfony.com>` and the strstr transform email in this `4641b2b294b53fe983a05b1a@symfony.com>`
By passing the address only instead of toString, it's fixed.
<!--
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.
-->
Commits
-------
375ac9237f [Mime] Fix generate message id with named address
This PR was squashed before being merged into the 4.3-dev branch (closes#30390).
Discussion
----------
[FrameworkBundle] Fix UrlGenerator::generate to return an empty string instead of null
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30306
| License | MIT
Fix#30306 : Controller::generateUrl() must be of the type string, null returned
Commits
-------
c5b1247977 [FrameworkBundle] Fix UrlGenerator::generate to return an empty string instead of null
This PR was merged into the 3.4 branch.
Discussion
----------
[Debug] detect annotations before blank docblock lines
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
This fixes the tests and a small issue after the CS changes made in df1d50dcc2 for #29920.
Commits
-------
dedd526b19 detect annotations before blank docblock lines
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Added transport agnostic exception
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30346
| License | MIT
| Doc PR | TODO
As described in #30346, client code shouldn't care about which transport is currently used by the message bus. This pr adds a new generic exception that is thrown by the `AmqpSender` if the message couldn't be delivered.
Commits
-------
7d6a3fa487 Updated changelog to document changes in AmqpReceiver
62a08eeea0 Updated exception message in AmqpSender, updated AmqpReceiver to throw new TransportException
b2b0640d80 Chain new exception with previous one
06c84040c4 forgot one backslash, my bad
93c10013fa [Messenger] Added new TransportException which is thrown if transport could not send a message
This PR was squashed before being merged into the 4.3-dev branch (closes#29254).
Discussion
----------
[FrameworkBundle] Added the condition routing option to the debug router command
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | <!-- #-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.
-->
This PR will add the condition routing option to debug:router command, to show if a route have conditions or not and showing this conditions.
Commits
-------
92bdc9b5f4 [FrameworkBundle] Added the condition routing option to the debug router command
* 4.2:
fixed CS
Autoconfig: don't automatically tag decorators
removed suggestion
[PropertyAccess] Fixed PropertyPathBuilder remove that fails to reset internal indexes
bumped Symfony version to 4.2.5
updated VERSION for 4.2.4
updated CHANGELOG for 4.2.4
bumped Symfony version to 3.4.24
updated VERSION for 3.4.23
update CONTRIBUTORS for 3.4.23
updated CHANGELOG for 3.4.23
[Routing][ServiceRouterLoader] Remove an outdated comment
* 3.4:
fixed CS
removed suggestion
[PropertyAccess] Fixed PropertyPathBuilder remove that fails to reset internal indexes
bumped Symfony version to 3.4.24
updated VERSION for 3.4.23
update CONTRIBUTORS for 3.4.23
updated CHANGELOG for 3.4.23
[Routing][ServiceRouterLoader] Remove an outdated comment
This PR was merged into the 3.4 branch.
Discussion
----------
[Routing][ServiceRouterLoader] Remove an outdated comment
| 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 | -
Since 0043653ea8, this comment is technically false.
Commits
-------
a2b73489dd [Routing][ServiceRouterLoader] Remove an outdated comment
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle][Routing] allow boolean container parameters for routes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30366
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/11059
This fixes https://github.com/symfony/symfony/issues/30366 and adds support for boolean container parameters in route conditions, defaults etc.
Commits
-------
21f4e38800 [FrameworkBundle][Routing] allow boolean container parameters for routes
This PR was squashed before being merged into the 4.3-dev branch (closes#29661).
Discussion
----------
[Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Running PHPStan on my project picked up that passing a resource to `Filesystem::dumpFile()` didn't match the documented type.
I found this has been discussed in #20980 and #28019, without a clear result. But, my reading is that only strings should be supported. While I think that not supporting streams makes this a lot less useful (and I'm going to switch away from it), this does need to be resolved. So, I've deprecated using arrays and resources.
Commits
-------
0eaf9d2474 [Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile()
* 4.2:
Removed non-existing parameters for LogoutUrlGenerator calls
[WebProfilerBundle] toolbar: invisible route name in Firefox
Drop spurious execution bit
[HttpKernel] Correctly merging cache directives in HttpCache/ResponseCacheStrategy
[Validator] Add the missing translations for the Latvian ("lv") locale
Fixed the DebugClassLoader compatibility with eval()'d code on Darwin
[Validator] Update Serbian translation file
* 3.4:
Removed non-existing parameters for LogoutUrlGenerator calls
[HttpKernel] Correctly merging cache directives in HttpCache/ResponseCacheStrategy
[Validator] Add the missing translations for the Latvian ("lv") locale
Fixed the DebugClassLoader compatibility with eval()'d code on Darwin
[Validator] Update Serbian translation file
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] be able to specify the input format for times
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
This expands the work started in #29887 to also allow to configure the input format for string inputs in the `TimeType`.
Commits
-------
2d9bc18c1b be able to specify the input format for times
This PR was squashed before being merged into the 4.2 branch (closes#30383).
Discussion
----------
[WebProfilerBundle] toolbar: invisible route name in Firefox
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29858
| License | MIT
| Doc PR | -
This fixes#29858, fixing a bug that prevents Route name displaying in debug toolbar on Firefox
Commits
-------
6b6bd453e1 [WebProfilerBundle] toolbar: invisible route name in Firefox
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Security] deprecate the Role and SwitchUserRole classes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #20824
| License | MIT
| Doc PR | symfony/symfony-docs#11047
In #20801, we deprecated the `RoleInterface`. The next logical step would be to also deprecate the `Role` class. However, we currently have the `SwitchUserRole` class (a sub-class of `Role`) that acts as an indicator to check whether or not the authenticated user switched to another user.
This PR proposes an alternative solution to the usage of the special `SwitchUserRole` class by storing the original token inside the `UsernamePasswordToken`. This PR is not complete, but rather acts as a proof of concept of how we could get rid of the `Role` and the `SwitchUserRole` classes.
Please share your opinions whether you think this is a valid approach and I will be happy to finalise the PR.
Commits
-------
d7aaa615b9 deprecate the Role and SwitchUserRole classes
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Add the missing translations for the Latvian ("lv") locale #30174Fixes#30174
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30174
| License | MIT
| Doc PR | -
Commits
-------
86b8c253c7 [Validator] Add the missing translations for the Latvian ("lv") locale
This PR was squashed before being merged into the 3.4 branch (closes#26532).
Discussion
----------
[HttpKernel] Correctly merging cache directives in HttpCache/ResponseCacheStrategy
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26245, #26352, #28872
| License | MIT
| Doc PR | -
This PR is a first draft to fix the incorrect merging of private and other cache-related headers that are not meant for the shared cache but the browser (see mentioned issues).
The existing implementation of `HttpFoundation\Response` is very much tailored to the `HttpCache`, for example `isCacheable` returns `false` if the response is `private`, which is not true for a browser cache. That is why my implementation does not longer use much of the response methods. They are however still used by the `HttpCache` and we should keep them as-is. FYI, the `ResponseCacheStrategy` does **not** affect the stored data of `HttpCache` but is only applied to the result of multiple merged subrequests/ESI responses.
I did read up a lot on RFC2616 as a reference. [Section 13.4](https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.4) gives an overall view of when a response MAY be cached. [Section 14.9.1](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1) has more insight into the `Cache-Control` directives.
Here's a summary of the relevant information I applied to the implementation:
- > Unless specifically constrained by a cache-control (section 14.9) directive, a caching system MAY always store a successful response (see section 13.8) as a cache entry, MAY return it without validation if it is fresh, and MAY return it after successful validation.
A response without cache control headers is totally fine, and it's up to the cache (shared or private) to decide what to do with it. That is why the implementation does not longer set `no-cache` if no `Cache-Control` headers are present.
- > A response received with a status code of 200, 203, 206, 300, 301 or 410 MAY be stored […] unless a cache-control directive prohibits caching.
> A response received with any other status code (e.g. status codes 302 and 307) MUST NOT be returned […] unless there are cache-control directives or another header(s) that explicitly allow it.
This is what `ResponseCacheStrategy::isUncacheable` implements to decide whether a response is not cacheable at all. It differs from `Response::isCacheable` which only returns true if there are actual `Cache-Control` headers.
- > [Section 13.2.3](https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.2.3): When a response is generated from a cache entry, the cache MUST include a single Age header field in the response with a value equal to the cache entry's current_age.
That's why the implementation **always** adds the `Age` header. It takes the oldest age of any of the responses as common denominator for the content.
- > [Section 14.9.3](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3): If a response includes an s-maxage directive, then for a shared cache (but not for a private cache), the maximum age specified by this directive overrides the maximum age specified by either the max-age directive or the Expires header.
This effectively means that `max-age`, `s-maxage` and `Expires` must all be kept on the response. My implementation assumes that we can only do that if they exist in **all** of the responses, and then takes the lowest value of any of them. Be aware the implementation might look confusing at first. Due to the fact that the `Age` header might come from another subresponse than the lowest expiration value, the values are stored relative to the current response date and then re-calculated based on the age header.
The Symfony implementation did not and still does not implement the full RFC. As an example, some of the `Cache-Control` headers (like `private` and `no-cache`) MAY actually have a string value, but the implementation only supports boolean. Also, [Custom `Cache-Control` headers](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.6) are currently not merged into the final response.
**ToDo/Questions:**
1. [Section 13.5.2](https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.5.2) specifies that we must add a [`Warning 214 Transformation applied`](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.46) if we modify the response headers.
2. Should we add an `Expires` headers based on `max-age` if none is explicitly set in the responses? This would essentially provide the same information as `max-age` but with support for HTTP/1.0 proxies/clients.
3. I'm not sure about the implemented handling of the `private` directive. The directive is currently only added to the final response if it is present in all of the subresponses. This can effectively result in no cache-control directive, which does not tell a shared cache that the response must not be cached. However, adding a `private` might also tell a browser to actually cache it, even though non of the other responses asked for that.
4. > [Section 14.9.2](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.2): The purpose of the `no-store` directive is to prevent the inadvertent release or retention of sensitive information […]. The `no-store` directive applies to the entire message, and MAY be sent either in a response or in a request. If sent in a request, a cache MUST NOT store any part of either this request or any response to it. If sent in a response, a cache MUST NOT store any part of either this response or the request that elicited it.
I have not (yet) validated whether the `HttpCache` implementation respects any of this.
5. As far as I understand, the current implementation of [`ResponseHeaderBag::computeCacheControlValue`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php#L313) is incorrect. `no-cache` means a response [must not be cached by a shared or private cache](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1), which overrides `private` automatically.
5. The unit tests are still very limited and I want to add plenty more to test and sort-of describe the implementation or assumptions on the RFC.
/cc @nicolas-grekas
#SymfonyConHackday2018
Commits
-------
893118f978 [HttpKernel] Correctly merging cache directives in HttpCache/ResponseCacheStrategy
If passing context to getTypes, it checks value of $context['enable_constructor_extraction'] for true/false or the constructor value of enableConstructorExtraction and should then populate fromConstructor if necessary. The missing brackets around the first part of this check mean that fromConstructor is only applied if context is not set.
This fixes the issuse described at [symfony/symfony-docs#10969](https://github.com/symfony/symfony-docs/pull/10969)
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Update Serbian translation file
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- see below -->
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #30189 <!-- #-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.
-->
I am not sure about some translations, if someone could check these, I would appreciate it.
Also, I've found that singular/plural translations have 3 translations. I am not sure if that's a mistake or not. I removed the third translation, but if I was wrong, I'll be happy to put it back.
Commits
-------
9e9a57a544 [Validator] Update Serbian translation file
* 4.2: (26 commits)
Apply php-cs-fixer rule for array_key_exists()
[Cache] fix warming up cache.system and apcu
[Security] Change FormAuthenticator if condition
handles multi-byte characters in autocomplete
speed up tests running them without debug flag
[Translations] added missing Croatian validators
Fix getItems() performance issue with RedisCluster (php-redis)
[VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning
IntegerType: reject submitted non-integer numbers
be keen to newcomers
[HttpKernel] Fix possible infinite loop of exceptions
fixed CS
[Validator] Added missing translations for Afrikaans
do not validate non-submitted form fields in PATCH requests
Update usage example in ArrayInput doc block.
[Console] Prevent ArgvInput::getFirstArgument() from returning an option value
[Validator] Fixed duplicate UUID
fixed CS
[EventDispatcher] Fix unknown priority
Avoid mutating the Finder when building the iterator
...
* 3.4: (24 commits)
Apply php-cs-fixer rule for array_key_exists()
[Security] Change FormAuthenticator if condition
handles multi-byte characters in autocomplete
speed up tests running them without debug flag
[Translations] added missing Croatian validators
Fix getItems() performance issue with RedisCluster (php-redis)
[VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning
IntegerType: reject submitted non-integer numbers
be keen to newcomers
[HttpKernel] Fix possible infinite loop of exceptions
fixed CS
[Validator] Added missing translations for Afrikaans
do not validate non-submitted form fields in PATCH requests
Update usage example in ArrayInput doc block.
[Console] Prevent ArgvInput::getFirstArgument() from returning an option value
[Validator] Fixed duplicate UUID
fixed CS
[EventDispatcher] Fix unknown priority
Avoid mutating the Finder when building the iterator
[Validator] Add the missing translations for the Greek (el) locale
...
This PR was squashed before being merged into the 3.4 branch (closes#30347).
Discussion
----------
[Security] Change FormAuthenticator if condition
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30341
| License | MIT
| Doc PR | -
I changed the if condition in `SimpleFormAuthenticationListener` and `UsernamePasswordFormAuthenticationListener` based on the solution provided by @nikic in issue #30341
#OpenSourceFriday
Commits
-------
67ae121b2e [Security] Change FormAuthenticator if condition
This PR was merged into the 3.4 branch.
Discussion
----------
[Console] handles multi-byte characters in autocomplete
fixes#29966
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #29966 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | - <!-- required for new features -->
I used the `mb_ord` to detect whether the amount of bytes read is valid before proceeding. I limit the number of bytes read to 4 before giving up because characters can use at most 4 bytes.
The test passes with or without the fix though.
Commits
-------
47320a63e2 handles multi-byte characters in autocomplete
This PR was merged into the 3.4 branch.
Discussion
----------
Fix getItems() performance issue with RedisCluster (php-redis)
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | TBD
| License | MIT
On any kind of multi loads, including tags loading where it's always the case, current code leads to an explosion of Redis lookups affecting performance on RedisCluster _(as it does not support pipeline)_.
This backports the code for mget() usage from 4.x in order to fix it.
It's done with one small improvment which would also be relevant for 4.x, only using pipeline on cluster on predis as mget is more efficient (ref redis doc).
Commits
-------
178506e72c Fix getItems() performance issue with RedisCluster (php-redis)
This PR was merged into the 3.4 branch.
Discussion
----------
[VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Fixes the root issue that led to https://github.com/symfony/symfony/pull/30311#issuecomment-466457434
Commits
-------
29a0683107 [VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR |
see also https://github.com/symfony/monolog-bundle/pull/297
from that:
![image](https://user-images.githubusercontent.com/408368/53246085-f63ed380-36af-11e9-9bff-2e42f8af141c.png)
to that:
![image](https://user-images.githubusercontent.com/408368/53246115-0787e000-36b0-11e9-93ef-e47ed058adbf.png)
with some configuration:
```yaml
diff --git a/config/packages/dev/monolog.yaml b/config/packages/dev/monolog.yaml
index b1998da..66ae2db 100644
--- a/config/packages/dev/monolog.yaml
+++ b/config/packages/dev/monolog.yaml
@@ -17,3 +17,6 @@ monolog:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console"]
+ console_formater_options:
+ format: "%%datetime%% %%start_tag%%%%level_name%%%%end_tag%% <comment>[%%channel%%]</> %%message%%%%context%%\n"
+ multiline: false
```
Commits
-------
5e494db04c [Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler
This PR was merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle][SecurityBundle] speed up tests running them without debug flag
| 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
-------
dfb924f6a9 speed up tests running them without debug flag
This PR was merged into the 4.3-dev branch.
Discussion
----------
[TwigBridge] rename parent_form() to form_parent()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | symfony/symfony-docs#11049
We got some feedback on the blog post that form_parent() would be better
for consistency with all the existing form_*() functions. I think that
user has a point about that.
Commits
-------
057d177378 rename parent_form() to form_parent()
We got some feedback on the blog post that form_parent() would be better
for consistency with all the existing form_*() functions. I think that
user has a point about that.
On any kind of multi loads, including tags loading, current code leads to
an explosion of Redis lookups slowing down performance.
This backports the code for mget() usage from 4.x in order to fix it.
It's done with one small improvment which would also be relevant for 4.x,
only using pipeline on cluster on predis as mget is more efficient.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[VarDumper] Implement DsCaster
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
When dumping the data structures from [Ds extension](http://php.net/manual/en/book.ds.php) Symfony only shows the class name but not the actual data. So in this PR I tried to write a Caster for these data structures.
Map can't be simply casted to array because it can contain objects as keys so I dump the pairs instead.
Commits
-------
eab631fc45 [VarDumper] Implement DsCaster
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpKernel] Fix possible infinite loop of exceptions
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
I ran into an [issue](https://github.com/php-enqueue/enqueue-dev/issues/774) in the enqueue library which copied this part of code from Symfony. I'm now starting to understand what the problem is and it should most likely be fixed in Symfony as well.
I didn't actually run into it in Symfony itself but it seems at least hypothetically possible. Imagine if [here](8c3dc8254a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php (L77)) `$e` is somehow the same (===) as `$exception`. The code [below](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php#L82-L92) will then find the last exception in the `getPrevious()` chain and assigns `$exception` as the previous. However in the off chance that `$exception` is actually `$e` (the first exception in the chain) then it creates an infinite loop of exceptions which is not good for monolog and exception handlers.
What do you think?
Commits
-------
3447222b68 [HttpKernel] Fix possible infinite loop of exceptions
This PR was merged into the 3.4 branch.
Discussion
----------
[Routing] fix URL generation with look-around requirements
| Q | A
| ------------- | ---
| Branch? | 2.8 up to 4.1 for bug fixes
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10548
| License | MIT
| Doc PR |
If you have a non-catchable pattern in requirements like f.e. a positive lookahead (.+(?=/foo/)), the generator will not accept the parameter as the parameter itself cannot fulfil the requirement, but only matches in the context of the entire path.
This fix looks for lookAround in the path and ignores checking the requirements if any lookAround exists.
Commits
-------
c474451176 [Routing] fix URL generation with look-around requirements
This PR was squashed before being merged into the 4.3-dev branch (closes#28919).
Discussion
----------
[DX][WebProfilerBundle] Add Pretty Print functionality for Request Content
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | n/a ?
## Why?
Quite often when attempting to debug issues with JSON requests sent to a Symfony API, I use the Web Profiler to check the request content. More often than not the request content isn't easily readable (99% of the time it's all stuck on a single line and impossible to read). I always find myself copying + pasting the content into a random online tool to have it "pretty-print" the JSON.
Usually this isn't an issue, but can be annoying when offline. There's also the security issue of sending entire JSON payloads to a third-party server just for formatting 😳. Alternatively, maybe developers copy+paste into their chosen editors and this PR is all a waste of time — I hope not 😛.
## How?
This PR adds "Pretty-Print" JSON functionality straight into the profiler.
We can use `collector.requestheaders` to detect if the request was JSON and conditionally show the Pretty Print button.
When the button is clicked, we format the JSON from the "Request Content" card.
## What does it look like?
Before:
![without-pretty-print](https://user-images.githubusercontent.com/573318/47180751-36b0ce00-d319-11e8-86ed-eb0d78ebcbe3.png)
After:
![pretty](https://user-images.githubusercontent.com/573318/47180763-3c0e1880-d319-11e8-995d-eba565aad827.png)
Non-JSON Requests (unchanged):
![non-json-request](https://user-images.githubusercontent.com/573318/47181080-03227380-d31a-11e8-8cf2-e8b2e8c1a21d.png)
## Things to consider
- Is `JSON.stringify(JSON.parse(content));` the safest, most efficient way to do this?
- Should the "Pretty Print" button be in-line next to the "Request Content" header? I couldn't find a pattern for this sort of thing elsewhere in the profiler.
- Do people want JSON formatted with 4 spaces, would 2 spaces be preferred? Should this be a configuration option stored in localStorage (such as the light/dark theme configuration)?
- Should this be a toggle? E.g. click to pretty print, then click to undo
## Future Improvements
Depending on how this is received it could be extended to support formatting different request content-types (e.g. XML formatting) — I assume.
## Progress
- [x] Gather feedback and decide where to perform the pretty-print: [server-side, or client-side](https://github.com/symfony/symfony/pull/28919#issuecomment-431508361).
*It was decided server-side would be better.*
Commits
-------
9f85103151 [DX][WebProfilerBundle] Add Pretty Print functionality for Request Content
This PR was squashed before being merged into the 4.3-dev branch (closes#29865).
Discussion
----------
[Console] Added suggestions for missing packages
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Currently, when someone runs one of the most common commands, e.g. `server:run`, but does not have a required package installed, they will get a general **'There are no commands defined...'** message.
This commit adds a more useful message, informing the user about a package that might be missing and suggesting a command that should be run in order to install it, e.g. `composer require symfony/web-server-bundle --dev`.
Commits
-------
423a54f46e [Console] Added suggestions for missing packages
This PR was merged into the 4.3-dev branch.
Discussion
----------
Additional addons for the ghost
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Following #30236 I've prepared two additional addons for the ghost.
The first one will display a plus on February 29, to indicate it's a leap year.
![ghost-plus](https://user-images.githubusercontent.com/35422131/53133091-3730ce00-3572-11e9-89f7-44568d796f7e.png)
The second one will display a gift on October 18, to indicate it's Symfony's birthday.
![ghost-gift](https://user-images.githubusercontent.com/35422131/53133127-5596c980-3572-11e9-8901-704785e235a8.png)
I would just like to point out that the addons are purely for fun, to amuse every hardcoding Symfony developer and offer a chance to smile on these few selected occasions.
Commits
-------
51ed942ef5 Additional addons for the ghost
This PR was squashed before being merged into the 3.4 branch (closes#30243).
Discussion
----------
[Validator] Added missing translations for Afrikaans
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30148
| License | MIT
Added missing translations for Afrikaans
Commits
-------
8a931576d2 [Validator] Added missing translations for Afrikaans
This PR was merged into the 3.4 branch.
Discussion
----------
[Console] Prevent ArgvInput::getFirstArgument() from returning an option value
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #23343
| License | MIT
| Doc PR | n/a
Fixes the case where the passed input string contains no command name but one or more global (i.e. application-defined) options accepting values.
Commits
-------
46461e91f9 [Console] Prevent ArgvInput::getFirstArgument() from returning an option value
This PR was merged into the 3.4 branch.
Discussion
----------
[Security] Complain about an empty decision strategy
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
When an empty string is passed (or objects with a similarly behaving `__toString()` method) to the constructor, the call to `decide` causes infinite recursion.
Commits
-------
3a22cad29b Fix infinite recursion when passed an empty string
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Routing] deprecate some router options
| Q | A
| ------------- | ---
| Branch? | master
| 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 | https://github.com/symfony/symfony/pull/28865#issuecomment-463480970
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- 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.
-->
Commits
-------
bf4cd6164d [Routing] deprecate some router options
This PR was merged into the 3.4 branch.
Discussion
----------
[EventDispatcher] Fix unknown priority
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| 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 -->
Somehow, after #29411 the profiler actually shows the security firewall `ContextListener`.
This listener removes itself at call time, but at this point it's wrapped reference is already in the call stack; to be displayed in the profiler.
Because the wrapped listener lazily collects its priority - it asks it from the dispatcher - we get null; the listener was already removed.
This causes the profiler to render `-` by default:
![image](https://user-images.githubusercontent.com/1047696/50850320-d5c5ee80-1379-11e9-8516-0c6bc54512ce.png)
This fixes it by always passing the expected priority at call time.
Commits
-------
9fb619ac62 [EventDispatcher] Fix unknown priority
This PR was merged into the 3.4 branch.
Discussion
----------
[Console] Doc Block: More intuitive usage example in ArrayInput.
Make the ArrayInput doc block example more self-explanatory and less misleading. Show the common use case of having `command`, and replace the confusing `name` argument with something more arbitrary.
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
The current doc block example for `ArrayInput` seems to imply that the command name goes in as `name`, but this is actually just a random argument, named "name", in this case.
```php
new ArrayInput(['name' => 'foo', '--bar' => 'foobar']);
```
It might be more helpful to provide an example that works with Symfony's `Console` component out of the box, as that is a common use case:
```php
new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']);
```
Commits
-------
0c8d311657 Update usage example in ArrayInput doc block.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] deprecate using invalid names for buttons
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #28964
| License | MIT
| Doc PR |
Commits
-------
405aa548eb deprecate using invalid names for buttons
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Fixed duplicate UUID
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30285
| License | MIT
| Doc PR | N/A
Fixes the `TOO_HIGH_ERROR` constant had the same value in two different constraints: `LessThan` and `LessThanOrEqual`.
Commits
-------
0bd5dd84ef [Validator] Fixed duplicate UUID
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] do not validate non-submitted form fields in PATCH requests
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #11493, #19788, #20805, #24453, #30011
| License | MIT
| Doc PR |
When a form field is not embedded as part of a HTTP PATCH requests, its
validation constraints configured through the `constraints` option must
not be evaluated. The fix from #10567 achieved this by not mapping their
violations to the underlying form field. This however also means that
constraint violations caused by validating the whole underlying data
object will never cause the form to be invalid. This breaks use cases
where some constraints may, for example, depend on the value of other
properties that were changed by the submitted data.
Commits
-------
a60d802619 do not validate non-submitted form fields in PATCH requests
Make the ArrayInput doc block example more self-explanatory and less misleading. Show the common use case of having `command`, and replace the confusing `name` argument with something more arbitrary.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] Add input_format option to DateType and DateTimeType
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/29883
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10882
Add a new option to specify the date format when using the `string` input type.
Commits
-------
c8240a0423 [Form] Add input_format option to DateType and DateTimeType
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] undeprecate date formats in single_text widgets
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
1a983d07db undeprecate date formats in single_text widgets
This PR was merged into the 4.2 branch.
Discussion
----------
[FrameworkBundle] Fix Descriptor throwing on non existent parent
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | https://github.com/nelmio/NelmioApiDocBundle/issues/1470 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR |
The Descriptor throws an exception when it encounters a class having a non existent parent, see https://github.com/nelmio/NelmioApiDocBundle/issues/1470 for the record.
<!--
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.
-->
Commits
-------
6b354cc304 Fix Descriptor throwing on non existent parent
* 4.2:
[Console] Fix command testing with missing inputs
[Validator] Sync no/nb translation files
[Translation] Added a script to display the status of translations
[Validator] Added missing translations for Norwegian (\"no\") locale #30179
[Security\Guard] bump lowest version of security-core
[TwigBridge] Fix test
Remove unnecessary ProgressBar stdout writes (fixes flickering)
[Validator] improve translations for albanian ("sq") locale
[VarDumper] fix serializing Stub instances
[Validator] Added missing use statement for UnexpectedTypeException
Don't resolve the Deprecation error handler mode until a deprecation is triggered
bug #30245 fix lost namespace in eval (fizzka)
fix lost namespace in eval
[Twig] removed usage of non-namespaced classes
added missing dot
Update validators.lt.xlf
#30172 Add the missing validation translations for the Luxembourgish …
[Debug][ErrorHandler] Preserve next error handler
* 3.4:
[Console] Fix command testing with missing inputs
[Validator] Sync no/nb translation files
[Translation] Added a script to display the status of translations
[Validator] Added missing translations for Norwegian (\"no\") locale #30179
[Security\Guard] bump lowest version of security-core
This PR was merged into the 4.3-dev branch.
Discussion
----------
[VarDumper] link paths in stack traces to IDE
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | not really
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
`./test.php:8` and `./test.php:11` can now be clicked:
![image](https://user-images.githubusercontent.com/243674/52971041-466b1c80-33b6-11e9-9bc1-0e55dc115f63.png)
Commits
-------
6672ac3f43 [VarDumper] link paths in stack traces to IDE
This PR was squashed before being merged into the 3.4 branch (closes#30237).
Discussion
----------
[Translation] Added a script to display the status of translations
| Q | A
| ------------- | ---
| Branch? | 3.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? | no <!-- 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 | -
| License | MIT
| Doc PR | -
This is the script I used to get the missing translations for each locale. I think it could come in handy for Symfony to always keep translations in sync.
Commits
-------
5ca7dedaaa [Translation] Added a script to display the status of translations
This PR was merged into the 3.4 branch.
Discussion
----------
[Security\Guard] bump lowest version of security-core
| 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 | -
Forgotten in #30006 so that `PostAuthenticationGuardToken` can call `AbstractToken::doSerialize()`.
Commits
-------
93cfd5b2a0 [Security\Guard] bump lowest version of security-core
This PR was merged into the 3.4 branch.
Discussion
----------
[TwigBridge] Fix test
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
ad752b1a48 [TwigBridge] Fix test
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] improve translations for albanian ("sq") locale
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
While reviewing the changes announced in the "A Week of Symfony #633" post I found that there was room for improvement in the Validation component translations as they were defined earlier in 2012 and were never revisited.
All the translations have been reviewed and some of them were updated with the following improvements:
* overall translation message consistency
* fix singular expression messages
* fix grammatical errors
* use albanian form of expression
* restore, as lexical gap, the "locale" translation
Commits
-------
5cac9ad97d [Validator] improve translations for albanian ("sq") locale
* improve overall translation message consistency
* fix singular expression messages
* fix grammatical errors
* use albanian form of expression
* restore as lexical gap the "locale" translation
This PR was merged into the 4.3-dev branch.
Discussion
----------
Add element to ghost in Exception
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Let's make love (& good code) not war. Sorry for not submitting it at least yesterday, but hopefully you will accept it, and we will be able to merge today. This will allow us to add different addons on other special ocasions.
![zrzut ekranu 2019-02-14 o 09 53 42](https://user-images.githubusercontent.com/35422131/52775440-0582a900-3040-11e9-8d9a-ee4959fa6982.png)
On personal side, I dedicate it, with lots of kisses, to my wife Martha.
If you like it, just ❤️
Commits
-------
c8d6dd7c8f Add element to ghost in Exception
This PR was merged into the 3.4 branch.
Discussion
----------
Don't resolve the Deprecation error handler mode until a deprecation is triggered
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30047
| License | MIT
<!--
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.
-->
If an error happens before `.env.test` is loaded the mode is set to 0 and cached so SYMFONY_DEPRECATIONS_HELPER is not read from `.env.test`.
Commits
-------
1090b8cb6e Don't resolve the Deprecation error handler mode until a deprecation is triggered
This PR was merged into the 3.4 branch.
Discussion
----------
[Debug][ErrorHandler] Preserve next error handler
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/30140
| License | MIT
| Doc PR | -
Thank you @cuchac
Getting the current error handler in the error handler itself actually works. If you try to see the content of the `$currentErrorHandler` var however, you will always see `null`. That's why I thought it was impossible. Because I did not test from end to end until today.
Commits
-------
a8b34348e7 [Debug][ErrorHandler] Preserve next error handler
This PR was squashed before being merged into the 4.2 branch (closes#30245).
Discussion
----------
fix lost namespace in eval
Bugfix:
phpunit8 tearDown() declaration
Commits
-------
8743a1ada8 fix lost namespace in eval
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle][Translation] Added support for PHP files with trans() in translation commands
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29085
| License | MIT
| Doc PR | -
This PR allows translation commands be able to debug and update translation messages from any PHP file/class defined as service, injecting or wiring the `translator` service, e.g.:
```php
use Symfony\Component\Translation\TranslatorInterface;
class ParallelUniverseController extends AbstractController
{
public function hello(Request $request, TranslatorInterface $translator)
{
// this id 'hello_message' will be extracted from translation:update
$message = $translator->trans('hello_message');
// send message to space...
}
}
```
this supports all ways of wiring (auto or not): via constructor, public property, method calls, service subscriber and controller argument.
Commits
-------
9f9b828832 Added support for PHP files with translation in translation commands
This PR was squashed before being merged into the 4.2 branch (closes#30245).
Discussion
----------
fix lost namespace in eval
Bugfix:
phpunit8 tearDown() declaration
Commits
-------
8743a1ada8 fix lost namespace in eval
This PR was merged into the 3.4 branch.
Discussion
----------
[Twig] removed usage of non-namespaced classes
| Q | A
| ------------- | ---
| Branch? | 3.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? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
<!--
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.
-->
Commits
-------
bd719cd7e1 [Twig] removed usage of non-namespaced classes
This PR was squashed before being merged into the 4.3-dev branch (closes#30239).
Discussion
----------
Add missing Romanian translations for validator
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30183 [Validator] Add the missing translations for the Romanian ("ro") locale
Commits
-------
6674391dd4 Add missing Romanian translations for validator
This PR was squashed before being merged into the 3.4 branch (closes#30251).
Discussion
----------
#30172 Add the missing validation translations for the Luxembourgish …
…locale
| Q | A
| ------------- | ---
| Branch? | master for features / 3.4 up to 4.2 for bug fixes <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #30172 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Add the missing validation translations for the Luxembourgish locale
Commits
-------
b0be36648f#30172 Add the missing validation translations for the Luxembourgish …
* 4.2:
allow to skip tests based on the supported version
Update validators.bg.xlf
Update validators.ca.xlf
fixed CS
Updated validators.eu.xlf with missing translations
fixed typo
backported a translation
[Validator] added missing translation for UK validator
Validator: add the Persian translations
Update validators.sq.xlf
fixed CS
forward valid numeric values to transform()
add constraint validators before optimizations
* 3.4:
allow to skip tests based on the supported version
Update validators.bg.xlf
Update validators.ca.xlf
fixed CS
Updated validators.eu.xlf with missing translations
fixed typo
backported a translation
[Validator] added missing translation for UK validator
Validator: add the Persian translations
Update validators.sq.xlf
fixed CS
forward valid numeric values to transform()
add constraint validators before optimizations
This PR was merged into the 3.4 branch.
Discussion
----------
allow to skip tests based on the supported version
| 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 |
Writing tests for Form related features in the Doctrine and Twig bridges
as well as the FrameworkBundle is a pain as soon as these tests are run
with more recent versions of the Form component. This is due to the fact
that our tests in the bridges and bundle extend test cases from the
component. The tests in the component are expanded with every feature
that gets added there. However, these new features are not present in
the other packages in older version and we thus need to be able to skip
them somehow.
Commits
-------
be23926bf8 allow to skip tests based on the supported version
Writing tests for Form related features in the Doctrine and Twig bridges
as well as the FrameworkBundle is a pain as soon as these tests are run
with more recent versions of the Form component. This is due to the fact
that our tests in the bridges and bundle extend test cases from the
component. The tests in the component are expanded with every feature
that gets added there. However, these new features are not present in
the other packages in older version and we thus need to be able to skip
them somehow.
This PR was merged into the 3.4 branch.
Discussion
----------
Updated validators.eu.xlf
with missing translations
Commits
-------
f496ab638e Updated validators.eu.xlf with missing translations
This PR was squashed before being merged into the 3.4 branch (closes#30224).
Discussion
----------
Update validators.ca.xlf
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Update validators.ca.xlf for Catalan language.
Commits
-------
077df27eca Update validators.ca.xlf
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] add a convenience method to get the parent form in Twig templates
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28686
| License | MIT
| Doc PR |
Commits
-------
cb60642d15 add a convenience method to get the parent form in Twig templates
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle][Translation] Add support for Translator paths, Twig paths and Translator aware services paths in commands
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29085, #29633, #17739
| License | MIT
| Doc PR | TODO
Add custom (also common) Twig and Translation paths to the translation commands:
* Custom directories configured in `twig.paths`.
* Custom directories configured in `translator.paths`
* The `Resources/translations/` directory of `Validation` component (if installed).
* The `Resources/translations/` directory of `Form` component (if installed).
* The `Resources/translations/` directory of Security Core component (if installed).
Commits
-------
31d7a09bf5 Add support for translator paths and twig paths in translation commands
This PR was squashed before being merged into the 4.3-dev branch (closes#28477).
Discussion
----------
[Validator] Add new json Validator
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10351
Hi,
in so many cases we want to test if a value is a valid json or not, so I propose this new ~~NotJson~~ `Json` constraint for this need.
cordially,
Commits
-------
131febc7be [Validator] Add new json Validator
This PR was squashed before being merged into the 4.3-dev branch (closes#28635).
Discussion
----------
[Form] Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form type
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes. Travis-ci isn't green because it tests the components separately. Fabbot.io requires license headers in files where they were not present before.
| Fixed tickets | #27698
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10065
Hi, this is an alternative to #27775.
`translation_parameters` is separated to `label_translation_parameters`, `help_translation_parameters`, `attr_translation_parameters`.
Commits
-------
b3f3c5361f [Form] Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form type
This PR was merged into the 4.3-dev branch.
Discussion
----------
Nullable environment variable processor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | todo
Hey there,
Because environment variables are strings by design, empty environment variables are evaluated to `""` by default.
In the same way, `MY_ENV_VAR=null` will be evaluated to `"null"`, as a string.
What I suggest is to allow some environment variables to be evaluated to `null` (the real one) when their strings are _blank_ or equal _null_, _Null_ or _NULL_.
This can be easily done through a new `nullable` processor:
```bash
# .env
API_KEY=
```
```yaml
# config/services.yaml
services:
FooService:
arguments:
$apiKey: %env(nullable:API_KEY)%
```
```php
# src/Services/FooService
namespace App\Services;
final class FooService
{
/**
* @var string|null
*/
private $apiKey;
/**
* FooService constructor.
*/
public function __construct(?string $apiKey)
{
$this->apiKey = $apiKey;
}
public function doSomething()
{
// Free plan
if (null === $this->apiKey) {
// ...
}
}
}
```
That's an example that comes to my mind but there can be many others.
This can also help in using null coalesce operators in constructors instead of checking if a string equals `""` (which is very PHP4 style).
Of course it can be used in conjunction with other types, i.e. `%env(float:nullable:SOME_OPTIONAL_FLOAT_ENV_VAR)%`.
What do you think?
Commits
-------
3a604ac392 Nullable environment variable processor
This PR was merged into the 3.4 branch.
Discussion
----------
Validator: add the Persian translations
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30162
| License | MIT
| Doc PR | -
Add the missing translations for the Persian (fa) validator.
Commits
-------
32306d8795 Validator: add the Persian translations
* 4.2: (25 commits)
Add missing ID_id validators translation
fixed CS
Added missing translations in validators.tr.xlf
Update validators.es.xlf
Update validators.hu.xlf
[Validator] Add the missing translations for the Welsh (cy) locale
[Validator] Add missing DE validator translations
[Validator] Add the missing translations for the Dutch (nl) locale
Add missing PL translation
Add missing translations.
Add missing translations for IT to Validator
minor #30184 [Validator] Add the missing translations for the Russian (ru) locale (antonch1989)
[Validator] Add the missing translations for the Arabic (ar) locale
add_missing_translations_for_portuguese : [Validator] Add the missing translations for the Portuguese ("pt") locale
[Validator] Add the missing translations for the French (fr) locale
[Validator] Add some missing contents to the English translation
use PropertyAccessorInterface instead of PropertyAccessor
Fix KernelTestCase compatibility for PhpUnit 8 (bis)
add xabbuh as code owner of the Form component
[Validator] Added a missing translation
...
* 3.4: (25 commits)
Add missing ID_id validators translation
fixed CS
Added missing translations in validators.tr.xlf
Update validators.es.xlf
Update validators.hu.xlf
[Validator] Add the missing translations for the Welsh (cy) locale
[Validator] Add missing DE validator translations
[Validator] Add the missing translations for the Dutch (nl) locale
Add missing PL translation
Add missing translations.
Add missing translations for IT to Validator
minor #30184 [Validator] Add the missing translations for the Russian (ru) locale (antonch1989)
[Validator] Add the missing translations for the Arabic (ar) locale
add_missing_translations_for_portuguese : [Validator] Add the missing translations for the Portuguese ("pt") locale
[Validator] Add the missing translations for the French (fr) locale
[Validator] Add some missing contents to the English translation
use PropertyAccessorInterface instead of PropertyAccessor
Fix KernelTestCase compatibility for PhpUnit 8 (bis)
add xabbuh as code owner of the Form component
[Validator] Added a missing translation
...
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Add the missing translations for the Dutch (nl) locale
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30177
| License | MIT
This PR addresses the issue #30177, adding the missing translations for the Dutch (nl) locale.
Commits
-------
02662384c3 [Validator] Add the missing translations for the Dutch (nl) locale
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Add the missing translations for the Russian (ru) locale
… (ru) locale (antonch1989)
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30184
| License | MIT
Added missing ru translations for the validator component
Commits
-------
8d84cf916b minor #30184 [Validator] Add the missing translations for the Russian (ru) locale (antonch1989)
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Add some missing contents to the English translation
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | -
| License | MIT
| Doc PR | -
To simplify things, translated files contains all the keys of the English file in `master` branch. That's why our translations in 3.4 branch contain the key `id = 85` even if that is not used in 3.4 branch.
I propose to also include that unused key in the English file to make it easier to keep things in sync.
Commits
-------
ce4ff50b41 [Validator] Add some missing contents to the English translation
This PR was squashed before being merged into the 3.4 branch (closes#30204).
Discussion
----------
Add missing ID_id validators translation
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30170
| License | MIT
| Doc PR |
Add the missing translations for the Indonesian ("id") locale
Commits
-------
b645024f5d Add missing ID_id validators translation
This PR was squashed before being merged into the 3.4 branch (closes#30203).
Discussion
----------
Added missing translations in validators.tr.xlf
I referred the same tone and style in the new translations. I did not touch the abbreviation name such as IBAN or BIC. Because they have no counterparts.
| Q | A
| ------------- | ---
| Branch? | master for features / 3.4 up to 4.2 for bug fixes <!-- see below -->
| Bug fix? | yes/no
| New feature? | yes/no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes/no <!-- 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 | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- 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.
-->
Commits
-------
48f1189879 Added missing translations in validators.tr.xlf
This PR was squashed before being merged into the 3.4 branch (closes#30198).
Discussion
----------
Update validators.es.xlf
| Q | A
| ------------- | ---
| Branch? | master for features / 3.4 up to 4.2 for bug fixes <!-- see below -->
| Bug fix? | yes/no
| New feature? | yes/no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes/no <!-- 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 | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- 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.
-->
Commits
-------
3197a5ff29 Update validators.es.xlf
This PR was squashed before being merged into the 3.4 branch (closes#30200).
Discussion
----------
Update validators.hu.xlf
Translating message of DivisibleBy constraint.
| Q | A
| ------------- | ---
| Branch? | master for features / 3.4 up to 4.2 for bug fixes
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30168
| License | MIT
Commits
-------
4ab3af0036 Update validators.hu.xlf
This PR was squashed before being merged into the 3.4 branch (closes#30208).
Discussion
----------
[Validator] Add the missing translations for the Welsh (cy) locale
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30154
| License | MIT
Addresses the missing translations listed in #30154
Commits
-------
8f701ce4e5 [Validator] Add the missing translations for the Welsh (cy) locale
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Add the missing translations for the Arabic (ar) locale
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #30149 <!-- #-prefixed issue number(s), if any -->
| License | MIT
This PR addresses the issue #30149, adding the missing translations.
Commits
-------
21b5a27507 [Validator] Add the missing translations for the Arabic (ar) locale
This PR was squashed before being merged into the 3.4 branch (closes#30202).
Discussion
----------
[Validator] Add missing DE validator translations
| Q | A
| ------------- | ---
| Branch | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30156
| License | MIT
Updated the validator translation file with the missing German (DE) translations.
Commits
-------
c489cc8b33 [Validator] Add missing DE validator translations
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Add missing translations for IT to Validator
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #30171 <!-- #-prefixed issue number(s), if any -->
| License | MIT
I add missing translations for IT to Validator going to solve the following issue: #30171
Commits
-------
40903335fd Add missing translations for IT to Validator
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Add the missing translations for the Portuguese ("pt") locale
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30181
| License | MIT
This PR addresses the issue https://github.com/symfony/symfony/issues/30181, adding the missing translations.
Commits
-------
95795dc8cd add_missing_translations_for_portuguese : [Validator] Add the missing translations for the Portuguese ("pt") locale
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] consolidate the mime types service definition
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
I wonder if we couldn't simplify things by just initializing the default `MimeTypes` instance once the first one is going to be created.
Commits
-------
ce546f5e5b consolidate the mime types service definition
This PR was squashed before being merged into the 4.3-dev branch (closes#30111).
Discussion
----------
[SecurityBundle] Deprecate the normalization of the cookie names
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This is an alternative solution to #24018 providing a BC layer until Symfony 5.0.
Commits
-------
36c5df4589 [SecurityBundle] Deprecate the normalization of the cookie names
This PR was merged into the 3.4 branch.
Discussion
----------
[Security] fix switch user without having current token
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #22729
| License | MIT
Attempting to switch a user cause an error when not having any token in the storage
Commits
-------
15db914984 [Security] fix switch user without having current token
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] add back test after fixing it
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/29934#discussion_r250501108
| License | MIT
| Doc PR |
Commits
-------
0daeba8e8a add back test after fixing it
This PR was merged into the 3.4 branch.
Discussion
----------
[PhpunitBridge] dropping ext-zip suggestion as its no longer needed
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| License | MIT
The zip requirement was dropped after this pull request: https://github.com/symfony/symfony/pull/29265
Commits
-------
bb4b53bc45 Update composer.json
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] Added a missing translation
| Q | A
| ------------- | ---
| Branch? | 3.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? | no <!-- 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 | -
| License | MIT
| Doc PR | -
Commits
-------
34698372e4 [Validator] Added a missing translation
This PR was squashed before being merged into the 3.4 branch (closes#30124).
Discussion
----------
Fix KernelTestCase compatibility for PhpUnit 8 (bis)
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Follow up of #30084 and @Tobion's comment there.
Fabbot failure is a false-positive.
Commits
-------
1077df60ab Fix KernelTestCase compatibility for PhpUnit 8 (bis)
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] add missing null return type
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
This reflects how all our implementations of this interface actually behave.
Commits
-------
03abfc09bd add missing null return type
* 4.2:
New extensions were released supporting PHP 7.3
Remove "internal" annotation from datacollector serialization methods
replace mocks with real objects in tests
[DependencyInjection] fix#29930 add $lazyLoad flag to the generated factory code for lazy non-shared services
escape function does not always take a string
Fix phpunit 8 compatibility
render integer types with grouping as text input
ignore _method forms in NativeRequestHandler
don't lose int precision with not needed type casts
* 3.4:
Remove "internal" annotation from datacollector serialization methods
replace mocks with real objects in tests
Fix phpunit 8 compatibility
render integer types with grouping as text input
ignore _method forms in NativeRequestHandler
don't lose int precision with not needed type casts
This PR was merged into the 3.4 branch.
Discussion
----------
Remove "internal" annotation from datacollector serialization methods
| 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 | -
I've been a bit too aggressively adding `@internal` in #30035.
Commits
-------
3c8fd2072f Remove "internal" annotation from datacollector serialization methods
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29830
| License | MIT
| Doc PR | n/a
this a fix for the issue #29830
After deliberation, we estimate that only `sid_length` and` sid_bits_per_character` session options should be exposed. These options à optional.
For others, we recommend changing your php.ini file
We can now configure the session like this :
```yaml
framwork:
session:
sid_length: 64 //optional, recommended value is 32
sid_bits_per_character: 6 //optional, recommended value is 5
```
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] render integer types with grouping as text input
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29422
| License | MIT
| Doc PR |
Commits
-------
d6a5fde521 render integer types with grouping as text input
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] don't lose int precision with not needed type casts
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26795
| License | MIT
| Doc PR |
Commits
-------
72136f1c04 don't lose int precision with not needed type casts
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] ignore _method forms in NativeRequestHandler
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19017
| License | MIT
| Doc PR |
Commits
-------
bc4b0913b4 ignore _method forms in NativeRequestHandler
This PR was merged into the 3.4 branch.
Discussion
----------
Fix KernelTestCase compatibility for PhpUnit 8
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? |no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30071
| License | MIT
| Doc PR |
As the PhpUnit 8 Testcase has different return types as PhpUnit 7 there need to be 2 different classes to support both PhpUnit 8 and PhpUnit 7. With a class alias we can then change which version is used based on the PhpUnit Version constant. The fix is a little bit hacky but to support different major versions I see no other way.
Not sure as we can't upgrade symfony/symfony to PhpUnit 8 how we can create a TestCase for this change.
Commits
-------
83a56a0cbe Fix phpunit 8 compatibility
This PR was merged into the 4.2 branch.
Discussion
----------
[DependencyInjection] add $lazyLoad context to the generated code for lazy non-shared service by PhpDumper
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29930
| License | MIT
| Doc PR | n/a
Fix#29930 by adding $lazyLoad context to the generated code for lazy non-shared service by PhpDumper
Commits
-------
98d4dfdadb [DependencyInjection] fix#29930 add $lazyLoad flag to the generated factory code for lazy non-shared services
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DependencyInjection] Added information about deprecated aliases in debug:autowiring
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | n/a
Fix and improves a bit PR #29968 and #29995
![Screenshot](https://i.imgur.com/GDj2NIY.png)
Commits
-------
3d2378dab5 [DependencyInjection] Added information about deprecated aliases in debug:autowiring
This PR was merged into the 4.2 branch.
Discussion
----------
[Workflow] Graphviz dumper escape not always a string
| Q | A
| ------------- | ---
| Branch? | 4.1
| 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 `escape` function takes a string as parameter but it can be a `bool` (see `findTransitions` method in same class). In this PR I allow any type in `escape` and does escaping only for `string`.
Commits
-------
1b17192b0a escape function does not always take a string
* 4.2:
fix merge
[FrameworkBundle] fix xsd
[FrameworkBundle] update xsd to match the 4.2 configuration
[FrameworkBundle] Update the xsd to match the actual session configuration
[Form] CsrfValidationListener marks the token as invalid if it is not a string
[Routing] fix perf issue when dumping large number of routes
Fix wrong value in file id attribute for Xliff 2.0
[VarDumper] Fixed phpDoc
[PhpUnitBridge] fix PHP 5.3 compat
[Messenger] Fix DataCollector template
[Filesystem] Fixed some docblocks and typos
bumped Symfony version to 4.2.4
updated VERSION for 4.2.3
updated CHANGELOG for 4.2.3
bumped Symfony version to 3.4.23
updated VERSION for 3.4.22
update CONTRIBUTORS for 3.4.22
updated CHANGELOG for 3.4.22
fix some minor typos
do not overwrite the constraint being evaluated
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29930
| License | MIT
| Doc PR | n/a
Fix#29930 by adding $lazyLoad context to the generated code for lazy non-shared service by PhpDumper
* 3.4:
[FrameworkBundle] Update the xsd to match the actual session configuration
[Form] CsrfValidationListener marks the token as invalid if it is not a string
[VarDumper] Fixed phpDoc
[PhpUnitBridge] fix PHP 5.3 compat
[Filesystem] Fixed some docblocks and typos
bumped Symfony version to 3.4.23
updated VERSION for 3.4.22
update CONTRIBUTORS for 3.4.22
updated CHANGELOG for 3.4.22
fix some minor typos
do not overwrite the constraint being evaluated
This PR was merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle] Update the xsd to match the actual session configuration
| 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
Update the FrameworkBundle xsd to match the actual session configuration
Commits
-------
40bd76c9d4 [FrameworkBundle] Update the xsd to match the actual session configuration
| 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
Update the FrameworkBundle xsd to match the actual session configuration
This PR was squashed before being merged into the 3.4 branch (closes#29884).
Discussion
----------
[Form] CsrfValidationListener marks the token as invalid if it is not a string
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29882
| License | MIT
Commits
-------
deb8e95091 [Form] CsrfValidationListener marks the token as invalid if it is not a string
This PR was squashed before being merged into the 4.3-dev branch (closes#30024).
Discussion
----------
[Debug] Display more details in the simple error page of Debug
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29891
| License | MIT
| Doc PR | -
Note: this only changes the simple error page of Debug component, which is different from the full-featured error page of WebProfilerBundle.
-----
#29891 shows a confusing error page. In #29928 we improved the first error message displayed to the user. In this PR we implement @nicolas-grekas' idea to replace the generic error page title by a better error message. So, this PR + #29928 would fix#29891 to me.
### Before
![error-before](https://user-images.githubusercontent.com/73419/51920135-1519b500-23e5-11e9-99d6-e9b631b97499.png)
### After
![error-after](https://user-images.githubusercontent.com/73419/51920141-1945d280-23e5-11e9-97c3-49b2170dbd15.png)
Commits
-------
75ff151580 [Debug] Display more details in the simple error page of Debug
This PR was merged into the 4.2 branch.
Discussion
----------
[Routing] fix perf issue when dumping large number of routes
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29918
| License | MIT
| Doc PR | -
In my reproducer, dumping 12k routes goes from 40s to 3s without xdebug, and from 50s to 12s with xdebug.
There is a lower level issue which is that `strpos` is called 16M times, but that's still a lot faster than calling `preg_match` 16M times. Reducing the number of checks is certainly possible, but that would be more involving. This could happen on master if someone is up to dig into it.
Commits
-------
872efe5729 [Routing] fix perf issue when dumping large number of routes
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] do not overwrite the constraint being evaluated
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27362
| License | MIT
| Doc PR |
Commits
-------
345a6329dd do not overwrite the constraint being evaluated
This PR was squashed before being merged into the 4.2 branch (closes#30074).
Discussion
----------
Fix wrong value in file id attribute for Xliff 2.0
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | ?
| Deprecations? | no
| Tests pass? | ?
| Fixed tickets |
| License | MIT
| Doc PR |
Currently using the `XliffFileDumper` for exporting messages from catalogue with domain of the form `xxxx+intl-icu` produces an invalid Xliff version 2.0 file as the file id attribute is of type `xs:NMTOKEN` (cf. https://github.com/symfony/translation/blob/master/Resources/schemas/xliff-core-2.0.xsd#L139) which doesn't accept `+` character (cf. http://www.datypic.com/sc/xsd/t-xsd_NMTOKEN.html).
Exception is thrown when loading the content after.
Commits
-------
8bf12f89a3 Fix wrong value in file id attribute for Xliff 2.0
This PR was merged into the 3.4 branch.
Discussion
----------
[Filesystem] Fixed some docblocks and typos
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
972b971129 [Filesystem] Fixed some docblocks and typos
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Yaml] Fixed invalid Parser behavior
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27874
| License | MIT
| Doc PR | NA
This fixes#27874
I'm not sure about the update in composer.json though. It seems a good idea because I was able to run composer update without the zip extension. If required, I'll remove it.
Commits
-------
7bf83815bd Added deprecation notice when mapping keys are found in multi-line blocks
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Console] Add an iterate method to the ProgressBar class
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10949
Add an iterate method to the `ProgressBar` class that simplify updating the progress bar when iterating over an `iterable`.
Before:
```php
$bar->start();
foreach ($iterable as $value) {
// Process $value
$bar->advance();
}
$bar->finish();
```
After:
```php
foreach ($bar->iterate($iterable) as $value) {
// Process $value
}
```
Additionally if `$iterable` is countable, the progress bar max step will automatically set to its count. If it isn't countable, nothing is done (instead of setting it to 0) to allow passing a max independently before calling `iterate`.
I will try to do the doc PR soon.
Commits
-------
eb355314b0 Add an iterate method to the ProgressBar class
This PR was merged into the 3.4 branch.
Discussion
----------
[Security] Declare exceptions that are already thrown by implementations
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29650
| License | MIT
| Doc PR |
Adding exception declarations for PasswordEncoderInterface. I think it's a matter of opinion whether this change is a BC break. The BC promise doesn't cover such a case; I'd see it as a BC break to add exceptions in general, but in this case it's more of a "documentation" issue, as most implementations of the interface have been throwing those exceptions for years.
Commits
-------
f4cc30b72b Declare exceptions that are already thrown by implementations
* 4.2:
[DI] Fix dumping Doctrine-like service graphs
fix serialization workaround in CustomUserMessageAuthenticationException
PHPUnit Bridge: Rollback to traditional array syntax.
[Form] fix some docblocks and type checks
* 3.4:
[DI] Fix dumping Doctrine-like service graphs
fix serialization workaround in CustomUserMessageAuthenticationException
PHPUnit Bridge: Rollback to traditional array syntax.
[Form] fix some docblocks and type checks
This PR was merged into the 3.4 branch.
Discussion
----------
[DI] Fix dumping Doctrine-like service graphs
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30017#29637#29693
| License | MIT
| Doc PR | -
I'm unable to provide a reproducer for this, the required service reference graph is too crazy, but that does the job :)
Commits
-------
ed96830893 [DI] Fix dumping Doctrine-like service graphs
This PR was merged into the 3.4 branch.
Discussion
----------
PHPUnit Bridge: Rollback to traditional array syntax.
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30039
| License | MIT
| Doc PR | N/A
I've used PHP CS Fixer to convert all short array expressions back to the traditional syntax understood by php 5.3. Unfortunately, I don't have a local php 5.3 setup anymore, so I hope I've caught all occurrences.
Commits
-------
8b330de7f7 PHPUnit Bridge: Rollback to traditional array syntax.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[PropertyAccess] speed up accessing object properties
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28926, #29405
| License | MIT
| Doc PR |
I propose to improve the performance of the `ObjectNormalizer` by not adding a new interface to the PropertyAccess component, but by adding some shortcut for cases where we know that we do not need to perform all checks. The added benefit is that this will not only speed up the `ObjectNormalizer` class, but will be available for every consumer of the `PropertyAccessor` without having to adapt to a new API.
TODO:
- [ ] confirm that these changes indeed introduce the same benefit as #29405 doing an actual benchmark
Commits
-------
ef7876e517 speed up accessing object properties
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] fix some docblocks and type checks
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30018
| License | MIT
| Doc PR |
Commits
-------
ec0c37192b [Form] fix some docblocks and type checks
* 4.2:
Add missing `@internal` annotations
Disable Twig in the profiler menu when Twig is not used
Mark some/most implementations of Serializable as `@internal`
[Config] ensure moving away from Serializable wont break cache:clear
[VarDumper] dont implement Serializable in Stub
[Config] fix compat with wrapping autoloaders
[Messenger] fixed RabbitMQ arguments not passed as integer values
* 3.4:
Add missing `@internal` annotations
Disable Twig in the profiler menu when Twig is not used
Mark some/most implementations of Serializable as `@internal`
[Config] ensure moving away from Serializable wont break cache:clear
[VarDumper] dont implement Serializable in Stub
[Config] fix compat with wrapping autoloaders
This PR was merged into the 3.4 branch.
Discussion
----------
Disable Twig in the profiler menu when Twig is not used
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #30033
| License | MIT
| Doc PR | -
Commits
-------
b47408179f Disable Twig in the profiler menu when Twig is not used
This PR was merged into the 3.4 branch.
Discussion
----------
[VarDumper] dont implement Serializable in Stub
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30014
| License | MIT
| Doc PR | -
`Serializable` is really really broken...
Commits
-------
73070d7d32 [VarDumper] dont implement Serializable in Stub
This PR was merged into the 3.4 branch.
Discussion
----------
Mark some/most implementations of Serializable as `@internal`
| 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 | -
There are more usages of `Serializable` in the code base, but the remaining are unfortunately exposed as part of interfaces.
All these places are IMHO already considered internal, this just makes it explicit.
Will ease moving away from `Serializable`.
Commits
-------
7b9d73d891 Mark some/most implementations of Serializable as `@internal`
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Mime] improve some types in docblocks
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
27463daced [Mime] improve some types in docblocks
* 4.2:
[Routing] dont redirect routes with greedy trailing vars with no explicit slash
skip native serialize among child and parent serializable objects
[Routing] backport tests from 4.1
[MonologBridge] Remove unused local variable
Remove unreachable code
Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR
Support use of hyphen in asset package name
Fix format strings for deprecation notices
Remove a harmless duplicate array key from VarDumper
[VarDumper] Fixed search bar
Remove gendered pronouns
Replace gender by eye color in tests
[Security] dont do nested calls to serialize()
* 4.1:
[Routing] dont redirect routes with greedy trailing vars with no explicit slash
skip native serialize among child and parent serializable objects
[Routing] backport tests from 4.1
[MonologBridge] Remove unused local variable
Remove unreachable code
Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR
Support use of hyphen in asset package name
Remove gendered pronouns
Replace gender by eye color in tests
[Security] dont do nested calls to serialize()
* 3.4:
skip native serialize among child and parent serializable objects
[Routing] backport tests from 4.1
Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR
Support use of hyphen in asset package name
Remove gendered pronouns
Replace gender by eye color in tests
[Security] dont do nested calls to serialize()
This PR was merged into the 3.4 branch.
Discussion
----------
[Security] don't do nested calls to serialize()
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29951
| License | MIT
| Doc PR | n/a
The problem (originally reported as `Symfony\Component\Security\Core\Authentication\Token\AbstractToken` issue), may occur also in classes extending `Symfony\Component\Security\Core\Exception\AuthenticationException`
Tasks:
- [x] Skip native serializer (workaround itself)
- [x] Token test
- [x] Exception test
Commits
-------
10256fc4fd skip native serialize among child and parent serializable objects
41000f1de0 [Security] dont do nested calls to serialize()
This PR was squashed before being merged into the 4.3-dev branch (closes#29641).
Discussion
----------
[Validator] NotBlank: add a new option to allow null values
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | #27876
| License | MIT
| Doc PR | todo
This PR adds a new option to the `@NotBlank` constraint to allow null values. As described in #27876, this is particularly useful when creating web APIs.
Commits
-------
484d22a6d9 [Validator] NotBlank: add a new option to allow null values
This PR was merged into the 4.2 branch.
Discussion
----------
Remove a harmless duplicate array key from VarDumper
This has the same field order as the original code.
Detected via static analysis - The `type` is also the first element of the array. This change preserves the key order of the resulting array.
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes (harmless)
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | N/A
| Fixed tickets |
| License | MIT
| Doc PR |
<!--
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.
-->
Commits
-------
1cd30acc2a Remove a harmless duplicate array key from VarDumper
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DI] add id of referencing service when a deprecated alias is found
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Improves #29968 a bit for DX.
Commits
-------
b124fb7271 [DI] add id of referencing service when a deprecated alias is found
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes (Manual tests only)
| Fixed tickets | #28122
| License | MIT
| Doc PR | n/a
According to issue https://github.com/symfony/symfony-docs/pull/10442, we tested in a demo bundle, for example in src/AppBundle/Resources/config/config.yml a package using hyphens: app-client-frontend, and withouth the patch it fails because the package is not recognized. With the patch, it works as expected.
```
framework:
assets:
packages:
app-client-frontend:
version: "%env(FRONTEND_VERSION)%"
version_format: '%%2$s/dist/%%1$s'
base_urls:
- "%env(FRONTEND_URL)%"
```
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Mime] move add mime type guesser pass to the component
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
ba20bb2e7e move add mime type guesser pass to the component
This PR was merged into the 4.3-dev branch.
Discussion
----------
[PHPUnitBridge] Static access in closure
| Q | A
| ------------- | ---
| Branch? | master for features
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n / a
| License | MIT
| Doc PR | n / a
#29718 bumps php to 5.5 . This is what we could simplify if it gets merged, thanks to this "new" PHP feature: https://3v4l.org/sJOWr
EDIT: it was merged, this can be reviewed.
Commits
-------
97f3023963 Use the scope of an instance
9df76ebbe5 Extract closures into static functions
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] deprecate some options for single_text widgets
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
89ff331865 deprecate some options for single_text widgets
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Mime] Add a set of default content-types for some extensions
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a
| License | MIT
| Doc PR | n/a
Some extensions have many possible content-types. This PR forces the first (preferred) content type for some extensions (the preset comes from Swiftmailer).
Commits
-------
37065d45f3 [Mime] added a set of default content-types for some extensions
This PR was merged into the 4.3-dev branch.
Discussion
----------
remove accidentally added changelog entries
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
The `help_html` option is neither part of the Twig bridge nor of the
FrameworkBundle. It is provided by the Form component.
Commits
-------
aa354cef57 remove accidentally added changelog entries
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Debug][DebugClassLoader] Match callable() type for parameters not defined in sub classes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29969
| License | MIT
| Doc PR | -
Added test fixture for multi param, no param type and multi spaces as well.
BTW, I didn't understand why there was a positive lookbehind on the current regex. Looks useless to me and tests passes without it.
Commits
-------
89c89c9776 [Debug][DebugClassLoader] Match callable() type for parameters not defined in sub classes
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DependencyInjection] fix DOM element namespace URL access
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
429bddf96b fix DOM element namespace URL access
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Routing] allow using compiled matchers and generators without dumping PHP code
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #29590
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10790
This is a resurrection of #25909 to make matcher+generator dumpers output PHP arrays instead of PHP code.
Don't be fooled by the diff stats, it's mostly fixtures.
This PR should contribute to making the Routing component easier to use standalone.
On the way back from SFLive USA.
![image](https://user-images.githubusercontent.com/243674/46920076-784e1b80-cf9d-11e8-86e7-850fffb409de.png)
Commits
-------
f0a519ac7d [Routing] allow using compiled matchers and generators without dumping PHP code