This PR was merged into the 5.2 branch.
Discussion
----------
[Notifier] Add missing charset to content-type for Slack notifier
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
Symfony HttpClient doesn't set charset for the Content-Type header when used with `json` request option so with each response slack includes:
```
"response_metadata" => array:1 [
"warnings" => array:1 [
0 => "missing_charset"
]
]
```
Commits
-------
e642100ea5 Add missing charset to content-type for Slack notifier
* 4.4:
[Console] Fix Windows code page support
[CI][Psalm] Install stable/released PHPUnit
Bump Symfony version to 4.4.24
Update VERSION for 4.4.23
Update CONTRIBUTORS for 4.4.23
Update CHANGELOG for 4.4.23
This PR was merged into the 4.4 branch.
Discussion
----------
[Console] Fix Windows code page support
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37385, Fix#35842, Fix#36324, Fix#37495, Fix#37278
| License | MIT
Corrects mojibake problem on Windows where an OEM code page was applied to an input string and then messed with PHP.internal_encoding setting used by the script. This caused strings with different encodings to be displayed on the console output.
Commits
-------
41452785c6 [Console] Fix Windows code page support
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Mailer][Notifier] Sort transport factories alphabetically
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
I would like to get this merged in 5.3 to avoid conflicts in the future, not sure it is possible
Commits
-------
e14816cbd6 [Notifier] [Mailer] Sort transport factories alphabetically
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[CI][Psalm] Install stable/released PHPUnit
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
PHPUnit 10 is soon released. We dont need to install it before it is actually released.
Currently, PHPUnit is updating dependencies and we get psalm failing with things like:
<img width="918" alt="Screenshot 2021-05-12 at 08 28 29" src="https://user-images.githubusercontent.com/1275206/117930440-468cc500-b2fe-11eb-8028-579478c001cf.png">
<img width="972" alt="Screenshot 2021-05-12 at 08 33 54" src="https://user-images.githubusercontent.com/1275206/117930443-47bdf200-b2fe-11eb-8cb7-79255532e899.png">
Commits
-------
2345614316 [CI][Psalm] Install stable/released PHPUnit
This PR was merged into the 5.3-dev branch.
Discussion
----------
[FrameworkBundle] improve AbstractController::renderForm()
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Even better than #41178, this requires a simple change on apps, and is compatible with multiple forms.
Usage:
```diff
- return $this->render('thing/new.html.twig', [
+ return $this->renderForm('thing/new.html.twig', [
'thing' => $thing,
- 'form' => $form->createView(),
+ 'form' => $form,
]);
```
In 5.4, we could even deprecate passing a FormView to render() so that we can always set the 422.
Commits
-------
e244d31fb0 [FrameworkBundle] improve AbstractController::renderForm()
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Translation] Fix Crowdin Translation Provider DSN example
| Q | A
| ------------- | ---
| Branch? | 5.x <!-- see below -->
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | <!-- required for new features -->
Crowdin DSN structure was changed in #41146. This PR updates the README for Crowdin Translation Provider.
Commits
-------
8465e885ba [Translation] Fix Crowdin Translation Provider DSN example
This PR was merged into the 5.3-dev branch.
Discussion
----------
[FrameworkBundle] Introduce `AbstractController::renderForm()` instead of `handleForm()`
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | yes
| Tickets |
| License | MIT
| Doc PR | -
I'm know I'm a bit late on this once, but I don't really like the `handleForm()` method:
1. It uses callable and PHP does not support type hint on callable so it's error prone. While trying the feature I forgot to return a response and I got a fatal error "cannot call getStatusCode() on null". Not really user friendly;
1. callables receive `mixed $data`: it's too generic. Static analysis could not work properly and so autocompletion does not work;
1. This is a new syntax to learn;
1. All documentation, blog post, etc should be updated, and it's not fixable with `sed` or similar tool;
1. This is not really flexible. We are going to lock people with this flow, and they will hesitate to use the "old" syntax when they need more flexibility;
That's why I propose this alternative, which is more simple I guess and addresses issues I leveraged.
I read somewhere that calling `isValid()` trigger twice the validation logic: This is wrong. The validation occurs during form submitting via an event listener. calling `isValid()` only check if there is some errors attached to the form.
---
Usage:
```diff
#[Route('/new', name: 'thing_new', methods: ['GET', 'POST'])]
public function new(Request $request): Response
{
$thing = new Thing();
$form = $this->createForm(ThingType::class, $thing);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager = $this->getDoctrine()->getManager();
$entityManager->persist($thing);
$entityManager->flush();
return $this->redirectToRoute('thing_index');
}
- return $this->render('thing/new.html.twig', [
+ return $this->renderForm('thing/new.html.twig', $form, [
'thing' => $thing,
'form' => $form->createView(),
]);
}
```
Commits
-------
27f8f50386 [FrameworkBundle] Introduce AbstractController::renderForm()
This PR was merged into the 5.3-dev branch.
Discussion
----------
[DependencyInjection] allow PHP-DSL files to be env-conditional
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This PR makes config builders compatible with conditional configuration based on the $env.
See fixture for an example:
```php
use Symfony\Component\DependencyInjection\Tests\Fixtures\AcmeConfig;
if ('prod' !== $env) {
return;
}
return static function (AcmeConfig $config) {
$config->color('blue');
};
```
On PHP8, the PR to allow using `#[When(env: prod')]`:
```php
use Symfony\Component\DependencyInjection\Attribute\When;
use Symfony\Component\DependencyInjection\Tests\Fixtures\AcmeConfig;
return #[When(env: 'prod')] function (AcmeConfig $config) {
$config->color('blue');
};
```
Without this patch, such a config file cannot be used if AcmeBundle is not loaded in the current $env.
This is a follow up of https://symfony.com/blog/new-in-symfony-5-3-configure-multiple-environments-in-a-single-file#comment-24521 by `@a`-menshchikov
Commits
-------
29173a91d1 [DependencyInjection] inject $env in the scope of PHP-DSL files
This PR was merged into the 5.3-dev branch.
Discussion
----------
[PhpUnitBridge] fix test on appveyor
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Hopefully :)
Commits
-------
89033a5781 [PhpUnitBridge] fix test on appveyor