[Messenger] Bugfix on the DateTime format

by @vincenttouzet

Some issues have been detected in this pull request

0
Coding Standard

0
Common Typos

0
License Headers

0
Pull Request Contributor Headers

0
JSON Files Syntax

0
File Permissions

Issues that cannot be fixed automatically

in Commits list, a `git rebase` is needed to remove any merges
  • feature #32255 [HttpFoundation] Drop support for ApacheRequest (lyrixx) This PR was merged into the 4.4 branch. Discussion ---------- [HttpFoundation] Drop support for ApacheRequest | 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 | `ApacheUrlMatcher` has been [deprecated in 2.7](https://github.com/symfony/symfony/pull/12728) and removed in 3.0 I think we forgot to remove this class too. This class in never used in symfony, and there are no more reference in the documentation. Commits ------- f82e28c533 [HttpFoundation] Deprecated ApacheRequest
  • minor #32322 [FrameworkBundle] Simplified some code in the DI configuration (javiereguiluz) This PR was submitted for the 3.4 branch but it was merged into the 4.4 branch instead (closes #32322). Discussion ---------- [FrameworkBundle] Simplified some code in the DI configuration | 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 | - | License | MIT | Doc PR | not needed Commits ------- e6d76bae9f [FrameworkBundle] Simplified some code in the DI configuration
  • minor #32269 [PropertyAccess] Adds entries to CHANGELOG and UPGRADE (jschaedl) This PR was squashed before being merged into the 4.4 branch (closes #32269). Discussion ---------- [PropertyAccess] Adds entries to CHANGELOG and UPGRADE | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #32179 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A In PR #32241 I missed to add entries to the CHANGELOG and UPGRADE file. Commits ------- c4afbf376f [PropertyAccess] Adds entries to CHANGELOG and UPGRADE
  • minor #32317 [Mime] Updated some PHPDoc contents (javiereguiluz) This PR was squashed before being merged into the 4.4 branch (closes #32317). Discussion ---------- [Mime] Updated some PHPDoc contents | 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 | not needed While documenting #30981 I found some PHPDoc info not clear enough. This "improves" it, but if you don't like it, it's OK to close this. Thanks. Commits ------- 9432f1f970 [Mime] Updated some PHPDoc contents
  • minor #32316 [Ldap] Document the new exceptions thrown by the code (javiereguiluz) This PR was merged into the 4.4 branch. Discussion ---------- [Ldap] Document the new exceptions thrown by the code | 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 | not needed While deciding if we should document #31547 I saw that the new exceptions weren't documented in the code. I don't know if this is the place where this should be added. Commits ------- 0d27af93ea [Ldap] Document the new exceptions thrown by the code
  • minor #32315 [Filesystem] deprecate calling isAbsolutePath with a null (smoench) This PR was merged into the 4.4 branch. Discussion ---------- [Filesystem] deprecate calling isAbsolutePath with a null | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | N/A <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A This PR is a result of #32247 and deprecates calling `Filesystem::isAbsolutePath()` with a `null` value. Commits ------- 93190182f6 [Filesystem] depreacte calling isAbsolutePath with a null
  • feature #32081 [WIP][Mailer] Overwrite envelope sender and recipients from config (Devristo) This PR was squashed before being merged into the 4.4 branch (closes #32081). Discussion ---------- [WIP][Mailer] Overwrite envelope sender and recipients from config | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #31592 #31733 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> # Description This MR adds the following configuration, example: ```yaml # config/packages/mailer.yaml framework: mailer: envelope: sender: '[email protected]' recipients: ['[email protected]'] ``` In turn the `\Symfony\Component\Mailer\EventListener\EnvelopeListener` will be configured to alter the sender and recipient addresses before the message has been sent. Note: it will only alter the envelope, thus rerouting the message to the correct mailbox. However the message itself will still have the original 'from' and 'to' headers. # Todos - [x] Alter configuration and dependency injection - [x] Create test case - [ ] Update XML config schema? - [ ] Doc PR <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - 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 ------- 8e0c8006d8 [WIP][Mailer] Overwrite envelope sender and recipients from config
  • minor #32254 [Security] [Guard] Added type-hints to AuthenticatorInterface (thomasbisignani) This PR was merged into the 5.0-dev branch. Discussion ---------- [Security] [Guard] Added type-hints to AuthenticatorInterface | Q | A | ------------- | --- | Branch? | 5.0 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #32179 | License | MIT | Doc PR | This PR adds the type-hints to the AuthenticatorInterface Commits ------- 51b3c2e84e [Security] [Guard] Added type-hints to AuthenticatorInterface
  • minor #32305 [HttpKernel][DX] Improve the error message when not defining the controller as a service but using construct parameters (Simperfit) This PR was merged into the 4.4 branch. Discussion ---------- [HttpKernel][DX] Improve the error message when not defining the controller as a service but using construct parameters | 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 | none <!-- #-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 branch 4.4. - Legacy code removals go to the master branch. --> I'm working with newcomers to the symfony framework ATM and one of them has got stuck in this errors trying to understand why the constructor argument declared as a a service would not work and didn't check if the controller was declared as a service itself. I feel like this could be improve to be really specific since "such" is not that specific ;). Commits ------- c670d5120e [HttpKernel][DX] Improve the error message when not defining the controller as a service but using contruct parameters
  • feature #31528 [Validator] Add a Length::$allowEmptyString option to reject empty strings (ogizanagi) This PR was merged into the 4.4 branch. Discussion ---------- [Validator] Add a Length::$allowEmptyString option to reject empty strings | 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? | yes <!-- 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 | Todo (change the warning on top of https://symfony.com/doc/current/reference/constraints/Length.html) which defaults to `true` in 4.4 but will trigger a deprecation if not set explicitly in order to make the default `false` in 5.0. While it could be solved now thanks to #29641 by using both `@Length(min=1)` & `@NotBlank(allowNull=true)` constraints, as expressed in https://github.com/symfony/symfony/issues/27876#issuecomment-403307783 and following comments, the `@Length(min=1)` behavior doesn't match our expectations when reading it: it feels logical to invalidate empty strings, but it actually doesn't. Hence the proposal of making the behavior of rejecting empty strings the default in 5.0. In my opinion, the flag could even be removed later. Commits ------- e113e7f812 [Validator] Add a Length::$allowEmptyString option to reject empty strings
  • feature #32265 [Validator] deprecate non-string constraint violation codes (xabbuh) This PR was merged into the 4.4 branch. Discussion ---------- [Validator] deprecate non-string constraint violation codes | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | https://github.com/symfony/symfony/pull/32066#discussion_r294106130 | License | MIT | Doc PR | Commits ------- e217729066 deprecate non-string constraint violation codes
  • feature #32231 [HttpClient] Add support for NTLM authentication (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] Add support for NTLM authentication | 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 | - Someone mentioned NTLM auth on Twitter, so here we are, this adds support for it. Requires curl. Commits ------- 548f4fd0ea [HttpClient] Add support for NTLM authentication
  • minor #32188 [PropertyInfo] add static cache to ContextFactory (bastnic) This PR was merged into the 4.4 branch. Discussion ---------- [PropertyInfo] add static cache to ContextFactory | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no (performance...) | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #32073, https://github.com/api-platform/api-platform/issues/1159 | License | MIT | Doc PR | no The issue is very very well described here #32073, and was also discussed a few weeks ago with @dunglas here https://github.com/api-platform/api-platform/issues/1159. `ContextFactory::createFromReflector` is heavy, and it's called redundanlty by `Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor` for each property and methods. Avoid that by parsing it only once and then use static cache This is a quite big performance problem. ![Deepin Capture-écran_zone de sélection _20190626142041](https://user-images.githubusercontent.com/84887/60179692-8471c480-981e-11e9-9e3c-3f9c0b83b01b.png) Commits ------- 063e880861 [PropertyInfo] add static cache to ContextFactory
  • minor #32340 [Messager] Simplified MessageBus::__construct() (lyrixx) This PR was merged into the 4.4 branch. Discussion ---------- [Messager] Simplified MessageBus::__construct() | 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 | The third path deals with generator (or other king of iterator that are not an IteratorAggregate). It means, very few cases in practice The previous code saved one object on the first call of `self::dispatch()` by replacing it at runtime. More over, this object (anon. class) is very light in memory. The performance optimization (even if fun) is not useful here. Let's make the code readable to everyone. Commits ------- 6b5671f5ae [Messager] Simplified MessageBus::__construct()
  • feature #32344 [HttpFoundation][HttpKernel] Improving the request/response format autodetection (yceruto) This PR was merged into the 4.4 branch. Discussion ---------- [HttpFoundation][HttpKernel] Improving the request/response format autodetection | 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 | - Mainly for API-based apps, currently the response header `Content-Type` (if no provided) is guessed based on the request format (`_format` attribute), falling back to `html` by default. Especially for the new error renderer system, where any kind of error can occur and it becomes an http response, this PR improves this guesser mechanism by taking into account also the `Content-type` of the request. Example: ```bash $ curl -X POST -H 'Content-Type: application/json' -i 'https://127.0.0.1:8000/login' ``` **before:** ```bash HTTP/2 500 cache-control: no-cache, private content-type: text/html; charset=UTF-8 # <- inaccurate ... {"title":"Internal Server Error","status":500,"detail":"Invalid credentials!"} ``` Most of the 3rd-party bundles that I know (`api-platform/core`, `FOSRestBundle`) need a dedicated listener to achieve it right. **after:** ```bash HTTP/2 500 cache-control: no-cache, private content-type: application/json ... {"title":"Internal Server Error","status":500,"detail":"Invalid credentials!"} ``` Of course, this applies to all kind of responses, as long as the `Content-Type` is not explicitly provided. So, as a last chance, the `Accept` heading of the request is also taken into account to detect the preferred format: ```bash $ curl -H 'Accept: application/json' -i 'https://127.0.0.1:8000/userinfo' HTTP/2 404 cache-control: no-cache, private content-type: application/json ... {"title":"Not Found","status":404,"detail":"No route found for \"GET \/userinfo\""} ``` They could be other places in the code where this new method could also be useful, please advise :) WDYT? Commits ------- 1952928471 Improving the request/response format autodetection
  • Merge branch '4.3' into 4.4 * 4.3: Fixes windows error [Messenger] Added more test for MessageBus fixed typo [Filesystem] added missing deprecations to UPGRADE-4.3.md Fix authentication for redis transport only decorate when an event dispatcher was passed [FrmaeworkBundle] More simplifications in the DI configuration Fixing validation for messenger transports retry_strategy service key Removed unused field. Remove @internal annotations for the serilize methods [Lock] Stores must implement `putOffExpiration` Annotated correct return type for getInEdges()/getOutEdges(). deprecate the framework.templating option
  • feature #32207 [FrameworkBundle] Allow to use the BrowserKit assertions with Panther and API Platform's test client (dunglas) This PR was submitted for the 4.3 branch but it was merged into the 4.4 branch instead (closes #32207). Discussion ---------- [FrameworkBundle] Allow to use the BrowserKit assertions with Panther and API Platform's test 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 | n/a | License | MIT | Doc PR | n/a I'm adding a testing client for API Platform that implements the interfaces of HttpClient: https://github.com/api-platform/core/pull/2608 Most PHPUnit assertions provided by Symfony are useful and can be reused, but the ones using the crawler are not relevant and pollute auto-complete suggestions (because a web API usually returns JSON, not HTML). This PR splits the existing trait to allow reusing the HTTP related assertions only. Commits ------- cd0341e69b [FrameworkBundle] Allow to use the BrowserKit assertions with Panther and API Platform's test client