Commit Graph

44241 Commits

Author SHA1 Message Date
Wouter de Jong
0a6f5e50b7 [Config] Support extensions without configuration 2021-04-18 19:45:52 +02:00
Oskar Stark
f9ad1cd91f bug #40852 [Notifier] Add missing entries in scheme to package map (jschaedl)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Add missing entries in scheme to package map

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | - <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 5.x.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->

Commits
-------

8cf605062b Add missing entries in scheme to package map
2021-04-18 19:44:12 +02:00
Yonel Ceruto
29d41b1970 Add prototype definition support for nested options 2021-04-18 09:39:20 -04:00
Nicolas Grekas
88eb0b57c1 [DependencyInjection] Improve autowiring errors when named autowiring aliases exist 2021-04-18 10:37:39 +02:00
Fabien Potencier
926f87ff51 Bump Symfony version to 5.3.0 2021-04-18 08:45:08 +02:00
Fabien Potencier
450f45ae70 Update VERSION for 5.3.0-BETA1 2021-04-18 08:39:48 +02:00
Jan Schädlich
8cf605062b Add missing entries in scheme to package map 2021-04-18 07:25:16 +01:00
Fabien Potencier
13f9ee533b Fix tests 2021-04-18 08:18:12 +02:00
Fabien Potencier
f67d11c84d minor #40845 [Notifier] Notifier add test for adding transport factories to framework extension (jschaedl, fabpot)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Notifier add test for adding transport factories to framework extension

| 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       |  <!-- 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 -->

Follow up of https://github.com/symfony/symfony/pull/40843 and https://github.com/symfony/symfony/pull/40844

Needs to be rebased after both were merged.

See changes: ddf61c2dae

Commits
-------

3118c9088a Make sure we will not forget to add notifier transport factories to FrameworkExtension anymore
2021-04-18 07:55:29 +02:00
Jan Schädlich
3118c9088a Make sure we will not forget to add notifier transport factories to FrameworkExtension anymore 2021-04-18 07:55:19 +02:00
Fabien Potencier
1a87c72c1f feature #40838 [SecurityBundle] Deprecate public services to private (fancyweb)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[SecurityBundle] Deprecate public services to private

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | -
| License       | MIT
| Doc PR        | -

Follow up of https://github.com/symfony/symfony/pull/36691 on the SecurityBundle

Commits
-------

56be86aa7d [SecurityBundle] Deprecate public services to private
2021-04-18 07:46:24 +02:00
Thomas Calvet
56be86aa7d [SecurityBundle] Deprecate public services to private 2021-04-18 07:46:12 +02:00
Jan Schädlich
213ef7f39f Fix wrong class name usage 2021-04-17 23:05:24 +01:00
Oskar Stark
3fd41ce110 minor #40844 [FrameworkBundle] Add basic tests for the notifier framework bundle integration (jschaedl)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[FrameworkBundle] Add basic tests for the notifier framework bundle integration

| 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       | - <!-- 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 -->

This PR adds basic tests for the notifier framework bundle integration:

- [x] Adjust the symfony-1.0.xsd and define the notifier type
- [x] Add general notifier configuration tests in FrameworkExtensionTest

Commits
-------

47088eb53a Add basic notifier tests
2021-04-17 20:14:09 +02:00
Nicolas Grekas
f3428928cf bug #40846 Fix typo (fabpot)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Fix typo

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

791313b6a7 Fix typo
2021-04-17 19:13:30 +02:00
Nicolas Grekas
4cac9cf829 feature #40782 [DependencyInjection] Add #[When(env: 'foo')] to skip autoregistering a class when the env doesn't match (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] Add `#[When(env: 'foo')]` to skip autoregistering a class when the env doesn't match

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This is a follow up of #40214, in order to conditionally auto-register classes.

By adding a `#[When(env: prod)]` annotation on a class, one can tell that a class should be skipped when the current env doesn't match the one declared in the attribute.

This saves from writing similar conditional configuration by using the per-env `services_prod.yaml` convention (+corresponding exclusion from `services.yaml`), or some logic in the Kernel.

Commits
-------

59c75bad7b [DI] add `#[When(env: 'foo')]` to skip autoregistering a class when the env doesn't match
2021-04-17 19:07:09 +02:00
Jan Schädlich
47088eb53a Add basic notifier tests 2021-04-17 17:51:43 +01:00
Fabien Potencier
791313b6a7 Fix typo 2021-04-17 18:36:24 +02:00
Jan Schädlich
a83c9fe79a [FrameworkBundle] Add missing notifier transport factories to framework extension 2021-04-17 17:36:35 +02:00
Wouter de Jong
0eebd9e5f3 feature #40840 [Security] Add passport to AuthenticationTokenCreatedEvent (scheb)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Security] Add passport to AuthenticationTokenCreatedEvent

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT

This is a follow-up to my previous PR #37359, which added `AuthenticationTokenCreatedEvent` to the new authenticator-based security system to inspect the security token before it becomes effective to the security system. It **adds the passport** that was used to generate that token to the event, so that it can be inspected as well.

Reasoning:
1) It makes the event more aligned with other security events (which are also providing the passport)
2) I see valid use-cases when you'd want to look into the passport/badges to decide if you'd want to make modifications to the security token. @seldaek mentioned to me in scheb/2fa#74 that he'd like to have the ability to add a badge from his custom authenticator class, which then influences 2fa being triggered or not. Having the passport in the event would make that a straight forward task.

I would like to add this to Symfony 5.3, since @wouterj plans to stabilize the authenticator security system for that release, so I believe this is worth adding it now rather than later. The constructor change could be considered a BC break, but since authenticator system is experimental, I believe it's fair to make that change now before declaring it "stable".

Commits
-------

74196e0750 Add passport to AuthenticationTokenCreatedEvent
2021-04-16 21:36:14 +02:00
Christian Scheb
74196e0750 Add passport to AuthenticationTokenCreatedEvent 2021-04-16 21:36:04 +02:00
Fabien Potencier
beeb3045e1 [Console] Add missing phpdocs to InputOption constants 2021-04-16 19:36:28 +02:00
Fabien Potencier
c4ea8a35fc Merge branch '5.2' into 5.x
* 5.2:
  [Console] : added phpdocs to InputOption constants
2021-04-16 19:35:46 +02:00
Fabien Potencier
e633845cf9 Merge branch '4.4' into 5.2
* 4.4:
  [Console] : added phpdocs to InputOption constants
2021-04-16 19:35:15 +02:00
Markus Staab
9f124f6278 [Console] : added phpdocs to InputOption constants 2021-04-16 19:32:19 +02:00
Nicolas Grekas
d7e059c05c Merge branch '5.2' into 5.x
* 5.2:
  [DoctrineBridge] Allow bundles to define a driver type "attribute"
  fix test SocketStreamTest for Windows
  Fix issue with RequestMatcher when attribute is a closure
  [PropertyInfo] Use the right context for methods defined in traits
2021-04-16 19:25:45 +02:00
Nicolas Grekas
9fe3cce0ca Merge branch '4.4' into 5.2
* 4.4:
  [DoctrineBridge] Allow bundles to define a driver type "attribute"
  fix test SocketStreamTest for Windows
  Fix issue with RequestMatcher when attribute is a closure
  [PropertyInfo] Use the right context for methods defined in traits
2021-04-16 19:25:34 +02:00
Nicolas Grekas
02fea49b7e Merge branch '5.2' into 5.x
* 5.2:
  [FrameworkBundle] Fix array controller link in debug:router
2021-04-16 19:22:18 +02:00
Nicolas Grekas
449c60f9aa bug #40802 [FrameworkBundle] Fix array controller link in debug:router (fancyweb)
This PR was merged into the 5.2 branch.

Discussion
----------

[FrameworkBundle] Fix array controller link in debug:router

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

`debug:router` is broken when you add a route in the Kernel (see https://symfony.com/doc/current/configuration/micro_kernel_trait.html) because `kernel` is not a class and triggers a `\ReflectionException`. The code in the exception handling always expect `$controller` to be a string.

Commits
-------

be964bdfa6 [FrameworkBundle] Fix array controller link in debug:router
2021-04-16 19:21:25 +02:00
Nicolas Grekas
32cce9f7b6 minor #40836 [Mailer] Fix SocketStreamTest for windows (a1812)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Fix SocketStreamTest for windows

| Q             | A
| ------------- | ---
| Branch?       |  4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? |no
| Tickets       | -
| License       | MIT
| Doc PR        | -

**How to reproduce**
PHP 8.0.3
PHPUnit 9.5.4

c:\php\php ./phpunit --bootstrap ./vendor/autoload.php --configuration ./phpunit.xml.dist --filter "/(SocketStreamTest::testSocketErrorNoConnection)( .*)?$/" --test-suffix SocketStreamTest.php ./src/Symfony/Component/Mailer/Tests/Transport/Smtp/Stream --testdox

Failed asserting that exception message 'Connection could not be established with host "ssl://localhost:9999": stream_socket_client(): Unable to connect to ssl://localhost:9999 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond)' matches '/Connection refused|unable to connect/'.

Commits
-------

a46fce402c fix test SocketStreamTest for Windows
2021-04-16 19:19:58 +02:00
Nicolas Grekas
549c097251 feature #40799 [FrameworkBundle] Add AbstractController::handleForm() helper (dunglas)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[FrameworkBundle] Add AbstractController::handleForm() helper

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/15217

Some libraries such as Turbo require to strictly follow the HTTP specification (and especially to use proper status codes) to deal with forms.

In https://github.com/symfony/symfony/pull/39843, I introduced a new `renderForm()` helper for this purpose. But I'm not very satisfied by it. The current approach has several problems:

1. It calls `$form->isValid()` two times, which may hurt performance
2. It sets the proper status code in case of validation error (422), but not for the redirection when the entity is created or updated (306). The user must do this manually (and so be aware of these HTTP subtleties).
3. It hides the verbosity of the Form component a bit, but I'm a sure that we can reduce it more

This PR proposes an alternative helper, `handleForm()`, which handles automatically 80% of the use cases, provide an extension point for the other 20%, and can also serve as a quick example for users to handle form in a custom way (by control-clicking on the function to see the code and copy/paste/adapt it).

* if the form is not submitted, the Twig template passed in $view is rendered and a 200 HTTP status code is set
* if the form is submitted but invalid, the Twig template passed in $view is rendered and 422 HTTP status code is set
* if the form is submitted and valid, the entity is saved (only if it is managed by Doctrine ORM), a 306 HTTP status code is set and the Location HTTP header is set to the value of $redirectUrl

Before (standard case):

```php
    #[Route('/{id}/edit', name: 'conference_edit', methods: ['GET', 'POST'])]
    public function edit(Request $request, Conference $conference): Response
    {
        $form = $this->createForm(ConferenceType::class, $conference);
        $form->handleRequest($request);

        $submitted = $form->isSubmitted();
        $valid = $submitted && $form->isValid();

        if ($valid) {
            $this->getDoctrine()->getManager()->flush();

            return $this->redirectToRoute('conference_index', [], Response::HTTP_SEE_OTHER);
        }

        $response = $this->render('conference/edit.html.twig', [
            'conference' => $conference,
            'form' => $form->createView(),
        ]);
        if ($submitted && !$valid) {
            $response->setStatusCode(Response::HTTP_UNPROCESSABLE_ENTITY);
        }

        return $response;
    }
```

With the new helper:

```php
    #[Route('/{id}/edit', name: 'conference_edit', methods: ['GET', 'POST'])]
    public function edit(Request $request, Conference $conference): Response
    {
        $form = $this->createForm(ConferenceType::class, $conference);
        return $this->handleForm(
            $request,
            $form,
            view: 'conference/edit.html.twig',
            redirectUrl: $this->generateUrl('conference_index')
        );
    }
```

Before (more advanced use case):

```php
    #[Route('/{id}/edit', name: 'conference_edit', methods: ['GET', 'POST'])]
    public function edit(Request $request, Conference $conference, HubInterface $hub): Response
    {
        $form = $this->createForm(ConferenceType::class, $conference);
        $form->handleRequest($request);

        $submitted = $form->isSubmitted();
        $valid = $submitted && $form->isValid();

        if ($valid) {
            $this->getDoctrine()->getManager()->flush();

            $hub->publish(
                new Update(
                    'conference:'.$conference->getId(),
                    $this->renderView('conference/edit.stream.html.twig', ['conference' => $conference])
                )
            );

            return $this->redirectToRoute('conference_index', [], Response::HTTP_SEE_OTHER);
        }

        $response = $this->render('conference/edit.html.twig', [
            'conference' => $conference,
            'form' => $form->createView(),
        ]);
        if ($submitted && !$valid) {
            $response->setStatusCode(Response::HTTP_UNPROCESSABLE_ENTITY);
        }

        return $response;
    }
```

With the new helper (more advanced case):

```php
    #[Route('/{id}/edit', name: 'conference_edit', methods: ['GET', 'POST'])]
    public function edit(Request $request, Conference $conference, HubInterface $hub): Response
    {
        $form = $this->createForm(ConferenceType::class, $conference);
        $response = $this->handleForm(
            $request,
            $form,
            view: 'conference/edit.html.twig',
            redirectUrl: $this->generateUrl('conference_index')
        );

        if ($response->isRedirection()) {
            $hub->publish(
                new Update(
                    'conference:' . $conference->getId(),
                    $this->renderView('conference/edit.stream.html.twig', ['conference' => $conference])
                )
            );
        }

        return $response;
    }
```

This also works without named parameters. I also considered passing a callback to be executed on success, but I'm happier with the current solution.

WDYT?

TODO:

* [x] update tests

Commits
-------

5228546066 [FrameworkBundle] Add AbstractController::handleForm() helper
2021-04-16 18:31:06 +02:00
Kévin Dunglas
5228546066 [FrameworkBundle] Add AbstractController::handleForm() helper 2021-04-16 18:30:58 +02:00
Nyholm
3a021a7fc4
bug #40793 [DoctrineBridge] Add support for a driver type "attribute" (beberlei)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] Add support for a driver type "attribute"

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| License       | MIT

Without this change its not possible to use attributes for mapping when they get released in ORM 2.9 over the next days. Otherwise we would need to copy three methods from the `AbstractDoctrineExtension` into the Bundle. See the DoctrineBundle PR that makes the full changes: https://github.com/doctrine/DoctrineBundle/pull/1322

Commits
-------

cecaa7815a [DoctrineBridge] Allow bundles to define a driver type "attribute"
2021-04-16 16:09:41 +02:00
Benjamin Eberlei
cecaa7815a [DoctrineBridge] Allow bundles to define a driver type "attribute" 2021-04-16 15:04:32 +02:00
Roman Martinuk
a46fce402c fix test SocketStreamTest for Windows 2021-04-16 15:10:02 +03:00
Kamil Kubicki
636dfc6b18 [Notifier] Microsoft Teams: JSON structure error fix for simple message
Code caused following error - 'Unable to post the Microsoft Teams message: ... Summary or Text is required. '. The structure of the message should contain the 'text' attribute instead of 'title'.
2021-04-16 09:28:03 +02:00
Nyholm
d5e8d6ed88
bug #40807 RequestMatcher issue when _controller is a closure (Plopix)
This PR was merged into the 4.4 branch.

Discussion
----------

RequestMatcher issue when `_controller` is a closure

| Q             | A
| ------------- | ---
| Branch?       |  4.4
| Bug fix?      |  yes
| New feature?  | no
| Deprecations? |  no
| License       | MIT

## Description

If the `matches` method of `RequestMatcher` is used on an attribute which is a closure it crashes.

##  How did we get it

On a project that is using FOS HTTP Cache, we have this configuration

```yaml
fos_http_cache:
    cache_control:
        rules:
     -
                match:
                    attributes: { _controller: ^App\\Controller\\.*::.* }
                headers:
                    overwrite: true
                    cache_control: { public: true, private: false, must_revalidate: true, s_maxage: 3600 }
```

Everything works fine unless you are reaching a controller that is a closure.
You get a
```TypeError: preg_match(): Argument #2 ($subject) must be of type string, Closure given``` which is to me logical.

## Proposed solution

Just testing the type of attribute value and return false before crashing `preg_match`

This PR adds a quick unit test to enforce this.

Commits
-------

66491238e3 Fix issue with RequestMatcher when attribute is a closure
2021-04-15 21:04:28 +02:00
Morel Sébastien
66491238e3
Fix issue with RequestMatcher when attribute is a closure 2021-04-15 08:06:12 -07:00
Oskar Stark
1ca10f5c57 feature #40646 [Notifier] Add MessageBird notifier bridge (StaffNowa)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Add MessageBird notifier bridge

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT
| Doc PR        | symfony/symfony-docs#15180
| Recipe PR   | symfony/recipes/pull/922

MessageBird notifier https://developers.messagebird.com/docs/conversations/send-messages-curl/

Commits
-------

761817ed81 [Notifier] Add MessageBird notifier bridge
2021-04-15 16:52:16 +02:00
Vasilij Dusko | CREATION
761817ed81 [Notifier] Add MessageBird notifier bridge 2021-04-15 16:52:10 +02:00
Thomas Calvet
be964bdfa6 [FrameworkBundle] Fix array controller link in debug:router 2021-04-15 13:20:37 +02:00
Nicolas Grekas
59c75bad7b [DI] add #[When(env: 'foo')] to skip autoregistering a class when the env doesn't match 2021-04-15 13:06:26 +02:00
Nicolas Grekas
236e61b620 bug #40811 [PropertyInfo] Use the right context for methods defined in traits (colinodell)
This PR was merged into the 4.4 branch.

Discussion
----------

[PropertyInfo] Use the right context for methods defined in traits

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34191
| License       | MIT
| Doc PR        |

Pull request #40175 only partially fixed #34191 - it solved the problem for properties used in traits but it did not address the same issue with methods.

I have therefore applied the same style of fix and confirmed it works properly with tests.

Commits
-------

c7e9493c5b [PropertyInfo] Use the right context for methods defined in traits
2021-04-14 19:13:01 +02:00
Nicolas Grekas
501c3104c7 minor #40790 [Intl] Switch from json to php resources (jderusse)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Intl] Switch from json to php resources

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #23545
| License       | MIT
| Doc PR        | -

take over #34214

Commits
-------

24bfc3bedd [Intl] Switch from json to php resources
2021-04-14 17:40:24 +02:00
Nicolas Grekas
f14b1bfffa bug #40801 [Routing] Fix supporting string "methods" and "schemes" on the Route annotation (fancyweb)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Routing] Fix supporting string "methods" and "schemes" on the Route annotation

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/40796
| License       | MIT
| Doc PR        | -

Commits
-------

b5f61c31e5 [Routing] Fix supporting string "methods" and "schemes" on the Route annotation
2021-04-14 17:38:59 +02:00
Nicolas Grekas
b1da7bd4af bug #40805 [Config] Don't regenerate the ConfigBuilders if they already exists (Nyholm)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Config] Don't regenerate the ConfigBuilders if they already exists

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes... or optimisation
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

When the user is trying to use the `Symfony\Config\AcmeConfig` ConfigBuilder, the `PhpFileLoader` will check if this class is loaded (ie `class_exists()`. Since it is normally generated and put in the `kernel.build_dir`, the class is not found by a PSR-4 class loader. So the `class_exists()` check will most likely fail. It will only return true if a third party bundle define `Symfony\Config\AcmeConfig` and make sure it is loaded with their composer.json. This is a great feature for third party bundles to be able to provide a config class.

However, if the class `Symfony\Config\AcmeConfig` does not exist, we try to generate it. Always... Which means that every time you rebuild the container, we generate these files.

This PR will do a check if `kernel.build_dir/Symfony/Config/AcmeConfig.php` exists first, and generate the file only if it is missing.

Commits
-------

88896e8d57 [Config] Don't regenerate the ConfigBuilders if they already exists
2021-04-14 17:38:30 +02:00
Nyholm
88896e8d57 [Config] Don't regenerate the ConfigBuilders if they already exists 2021-04-14 17:38:26 +02:00
Nicolas Grekas
3b108249a8 feature #40804 [Config][FrameworkBundle] Add CacheWarmer for ConfigBuilder (Nyholm)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Config][FrameworkBundle] Add CacheWarmer for ConfigBuilder

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? |
| Tickets       |
| License       | MIT
| Doc PR        |

Make sure ConfigBuilder exists before you write your first line of config.

This is similar to #40803

Commits
-------

c1d6c0e57a [Config][FrameworkBundle] Add CacheWarmer for ConfigBuilder
2021-04-14 17:37:13 +02:00
Nyholm
c1d6c0e57a [Config][FrameworkBundle] Add CacheWarmer for ConfigBuilder 2021-04-14 17:37:06 +02:00
Nicolas Grekas
48ae511da8 minor #40808 [DependencyInjection][Routing] Access environment in PHP config (Nyholm)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection][Routing] Access environment in PHP config

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? |
| Tickets       |
| License       | MIT
| Doc PR        |

This will allow me to write config like:

```php
use Symfony\Config\FrameworkConfig;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (FrameworkConfig $framework, ContainerConfigurator $container) {
    if ('test' === $container->env()) {
        $framework->test(true);
        $framework->session()->storageFactoryId('session.storage.mock_file');
    }
};
```

This PR will also revert parts of #40214. It is much simpler to maintain and write PHP config without `->when()`. Instead we add `ContainerConfigurator::env(): ?string` and `RoutingConfigurator::env(): ?string`.

```php

use App\Controller\BlogController;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

return function (RoutingConfigurator $routes) {
    if ($routes->env() === 'dev') {
        $routes->add('debug-stats', '/blog-debyg')
            ->controller([BlogController::class, 'debug'])
        ;
    }

    $routes->add('blog_list', '/blog')
        ->controller([BlogController::class, 'list'])
    ;
};
```

Commits
-------

11dfaa4742 [DependencyInjection][Routing] Access environment in PHP config
2021-04-14 17:36:30 +02:00
Nicolas Grekas
1a4bd73f0f minor #40809 Improve deprecation message for session (jderusse)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Improve deprecation message for session

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

The `session` service is not public since we deprecate it, which lead to headache when people migrate to 5.3:
When people expect the service to be public (like in tests), the service does not exist anymore (removed or inlined), it's now an alias to `.session.do-not-use` and deprecation telling how to migrate has not been triggered because the service has been removed / inlined.

This PR makes the `session` service/alias public, and also improves the deprecation message a little bit.

/cc @javiereguiluz , @wouterj

Commits
-------

b568768cec Improvide deprecation message for session
2021-04-14 17:35:25 +02:00
Robin Chalas
a58ccf7c45 Merge branch '5.2' into 5.x
* 5.2:
  [FrameworkBundle] Fix messenger.receiver_locator service definition
  Fix CS in IsbnValidator and IssnValidator
2021-04-14 15:13:13 +02:00
Robin Chalas
255b7b6fad Merge branch '4.4' into 5.2
* 4.4:
  [FrameworkBundle] Fix messenger.receiver_locator service definition
  Fix CS in IsbnValidator and IssnValidator
2021-04-14 15:12:03 +02:00
Robin Chalas
615bcaef08 [FrameworkBundle] Fix messenger.receiver_locator service definition 2021-04-14 15:03:08 +02:00
Nyholm
11dfaa4742
[DependencyInjection][Routing] Access environment in PHP config 2021-04-14 13:04:33 +02:00
Guilliam Xavier
dc90c195e3
Fix CS in IsbnValidator and IssnValidator 2021-04-14 11:41:13 +02:00
Nyholm
6e02d8b392
feature #40814 Remove the experimental flag from the authenticator system 🚀 (chalasr)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Remove the experimental flag from the authenticator system 🚀

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | todo

Here we go.

Commits
-------

a2f5693c5e Remove experimental flag from the authenticator system 🚀
2021-04-14 11:29:30 +02:00
Nyholm
b2f269e430
feature #40690 [Form] Add support for sorting fields (yceruto)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Form] Add support for sorting fields

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #5827
| License       | MIT
| Doc PR        | TODO

This PR adds a new `priority` option used later to sort all fields in order of importance instead of simply numerical order, i.e. fields with higher priority will be rendered first, fields with lower priority will be rendered last. The default priority would be "0" for all fields. Fields with equal priority will keep the original order (stable sorting).

History of previous proposals and discussions: #3452, #4254, #5827, #6111, #11241

This kind of feature has been abandoned in the past because complex proposals, and somehow rejected because ideally we should do the sorting at the view level ([customizing form](https://symfony.com/doc/current/form/form_customization.html) themes or layout templates) and it's true for most cases (the simple ones I think) but the fact is that it's often quite complex to accomplish that way, mainly for [dynamic forms](https://symfony.com/doc/current/form/dynamic_form_modification.html).

Let's focus the following analysis on explaining *why* and *when* the `priority` option could save us a lot of time, getting rid of cumbersome workarounds with templates to change the rendering order *only*.

---

A common example could be the building of a multi-steps form with a convenient type hierarchy and including fields dynamically based on the data. Let's take this sample:

![image](https://user-images.githubusercontent.com/2028198/113465635-a5a81180-9403-11eb-839f-3a32d5f84f47.png)

```php
class WorkflowType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        // get current enabled transitions from the workflow definition...

        foreach ($enabledTransitions as $transitionName) {
            $builder->add($transitionName, SubmitType::class, ['attr' => ['value' => $transitionName]]);
        }
    }
}

class PersonRegistrationType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('firstName')
            ->add('lastName');

        $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
            $person = $event->getData();

            if ($person->isLegalType()) {
                $event->getForm()->add('company');
            }
        });
    }

    public function getParent()
    {
        return WorkflowType::class;
    }
}
```
These classes model the required form. However, according to the form building process and taken into account that the underlaying person data was set with "legal" type (from the previous step), this will be the rendering result:
```html
<button type="submit" name="form[register]" value="register">Register</button> {# wrong place #}
<input name="form[first_name]">
<input name="form[last_name]">
<input name="form[company]">  {# wrong place #}
```
Now, taking the view customization path to fix the order, you likely will face some problems regarding to:
 - How do I render the dynamic submit buttons at the bottom?
 - How can the specific form fields be rendered in the correct order if they vary from step to step? (being it a generic template)
 - if you solve the previous questions, you will also need to check if the company field is defined or not before rendering it in the right order.

There could be more and different problems depending on the context and you can find workarounds using the block prefixes system to customize each step block theme, but to me it's enough to think about other alternatives.

On the other side, using the `priority` option, the solution is quite easy. Setting the right priority value will guarantee the right rendering order:
```php
// ...
$builder->add($transitionName, SubmitType::class, ['priority' => -1, // ...]);

// ...
$event->getForm()->add('company', null, ['priority' => 1]);
```
That's ! There is no need to customize templates at all when you only need to change the fields order.

This way, these fields are being pre-defined in the order they will be rendered at view level. This sorting process will take place on `$form->createView()` method, just after `buildView()` and before `finishView()` calls.

Could we reconsider the usefulness of this feature? please.

Cheers!

Commits
-------

62650bbdc7 [Form] Add support for sorting fields
2021-04-14 11:13:37 +02:00
Yonel Ceruto
62650bbdc7
[Form] Add support for sorting fields 2021-04-14 11:13:30 +02:00
Nyholm
0e9652a4bc [FrameworkBundle] Add argument KernelInterface to BuildDebugContainerTrait::getContainerBuilder() 2021-04-14 10:59:53 +02:00
Robin Chalas
a2f5693c5e Remove experimental flag from the authenticator system 🚀 2021-04-14 10:47:21 +02:00
Oskar Stark
cc29772236 feature #40691 [Notifier] Add SmsBiuras notifier bridge (StaffNowa)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Add SmsBiuras notifier bridge

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT
| Doc PR        | symfony/symfony-docs#15219
| Recipe PR   | symfony/recipes/pull/932

Sms Biuras notifier bridge

Commits
-------

79572b2728 [Notifier] Add SmsBiuras notifier bridge
2021-04-14 09:30:21 +02:00
Vasilij Dusko
79572b2728 [Notifier] Add SmsBiuras notifier bridge 2021-04-14 09:30:16 +02:00
Thomas Calvet
b5f61c31e5 [Routing] Fix supporting string "methods" and "schemes" on the Route annotation 2021-04-14 09:19:53 +02:00
Laurent VOULLEMIER
9bf4a24a6e [Routing] Fix localized paths 2021-04-14 09:00:25 +02:00
Colin O'Dell
c7e9493c5b
[PropertyInfo] Use the right context for methods defined in traits 2021-04-13 18:23:01 -04:00
Jérémy Derussé
b568768cec
Improvide deprecation message for session 2021-04-13 22:31:53 +02:00
Jérémy Derussé
24bfc3bedd
[Intl] Switch from json to php resources 2021-04-13 21:38:10 +02:00
Nicolas Grekas
dd919a7233 feature #40406 [DependencyInjection] Autowire arguments using attributes (derrabus, nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] Autowire arguments using attributes

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | TODO

This PR allows us to bind arguments via attributes. This mechanism is enabled for tagged iterators and service locators for now.

To receive an iterator with all services tagged with `my_tag`:

```php
use Symfony\Component\DependencyInjection\Attribute\TaggedIterator;

class MyService
{
    public function __construct(
        #[TaggedIterator('my_tag')]
        private iterator $taggedServices,
    ) {
    }
}
```

To receive a locator with all services tagged with `my_tag`:

```php
use Psr\Container\ContainerInterface;
use Symfony\Component\DependencyInjection\Attribute\TaggedLocator;

class MyService
{
    public function __construct(
        #[TaggedLocator('my_tag')]
        private ContainerInterface $taggedServices,
    ) {
    }
}
```

Commits
-------

91fbc90238 Autowire arguments using attributes
b86aa3d068 [DependencyInjection] Bind constructor arguments via attributes
2021-04-13 19:01:37 +02:00
Nicolas Grekas
87d031c808 feature #40155 [Messenger] Support Redis Cluster (nesk)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Messenger] Support Redis Cluster

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #38264
| License       | MIT
| Doc PR        | symfony/symfony-docs#14956

This PR brings support for Redis Cluster in the Messenger component:

- The first commit _Support RedisCluster instance_ allows to pass a `RedisCluster` object when instanciating the `Connection` class, which brings support for Redis Cluster without any friction.
- The second commit _Support multiple hosts DSN for Redis Cluster_ is more opiniated and brings a DSN format to configure a Redis Cluster from `config/packages/messenger.yaml`.

Instanciating `Connection` with a `RedisCluster` object:

```php
$redis = new \RedisCluster(null, ['host-01:6379', 'host-02:6379', 'host-03:6379', 'host-04:6379']);
$connection = new Connection([], [], [], $redis);
```

Configuring a Redis Cluster from YAML:

```yaml
// config/packages/messenger.yaml

framework:
    messenger:
            metadata:
                default: 'redis://host-01:6379,redis://host-02:6379,redis://host-03:6379'
                lazy: 'redis://host-01:6379?lazy=1,redis://host-02:6379,redis://host-03:6379'

                # Configuration will be `lazy = true` and `auto_setup = true`
                multipleConfig: 'redis://host-01:6379?lazy=1&auto_setup=false,redis://host-02:6379,redis://host-03:6379?auto_setup=true'
```

This format allows to define multiple hosts for a Redis Cluster and still contains valid URLs. Custom configuration is still supported, it can be specified on only one of the URLs in the DSN (see `lazy` above). If the user provides multiple configurations on different URLs, they are simply merged with the following code and if an option is defined multiple times then the latest takes precedence (see `multipleConfig` above).

I understand the way the DSN is handled could not suit you. Please, if you close this PR only for the DSN part, just tell me and I will make a new PR with only the first commit.

Commits
-------

04530fb2d7 [Messenger] Support Redis Cluster
2021-04-13 19:00:15 +02:00
Johann Pardanaud
04530fb2d7 [Messenger] Support Redis Cluster 2021-04-13 19:00:09 +02:00
Nicolas Grekas
44bb6918ad feature #40600 [Config][DependencyInjection] Add configuration builder for writing PHP config (Nyholm)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Config][DependencyInjection] Add configuration builder for writing PHP config

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/15181

I've spent most part of today to generate this PR. It is far from complete but it is ready for review.

This PR will build classes and store them in the build_dir. The classes will help you write PHP config. It will basically generate an array for you.

### Before

```php
// config/packages/security.php
<?php

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $container) {
  $array = [
        'firewalls' => [
            'main' => [
                'pattern' => '^/*',
                'lazy' => true,
                'anonymous' => [],
            ],
        ],
        'access_control' => [
            [
                'path' => '^/user',
                'roles' => [
                    0 => 'ROLE_USER',
                ],
            ],
            [
                'path' => '^/admin',
                'roles' => 'ROLE_ADMIN',
            ],
        ],
        'role_hierarchy' => [
            'ROLE_ADMIN' => ['ROLE_USER'],
            'ROLE_SUPER_ADMIN' => ['ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH',
            ],
        ],
    ];

    $container->extension('security', $array);
}
```

### After
```php
// config/packages/security.php
<?php

use Symfony\Config\SecurityConfig;

return static function (SecurityConfig $security) {
    $security
        ->roleHierarchy('ROLE_ADMIN', ['ROLE_USER'])
        ->roleHierarchy('ROLE_SUPER_ADMIN', ['ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'])
        ->accessControl()
            ->path('^/user')
            ->role('ROLE_USER');

    $security->accessControl(['path' => '^/admin', 'roles' => 'ROLE_ADMIN']);
    $security->firewall('main')
        ->pattern('^/*')
        ->lazy(true)
        ->anonymous();

};
```

### About autogeneration

This PR is generating the extension's `ConfigBuilder`s when they are first used. Since the PR is already very large, I prefer to follow up with additional PRs to include a cache warmer and command to rebuild the `ConfigBuilder`s.

The generated `ConfigBuilder` uses a "ucfirst() camelCased" extension alias. If the alias is `acme_foo` the root `ConfigBuilder` will be `Symfony\Config\AcmeFooConfig`.

The recommended way of using this class is:

```php
// config/packages/acme_foo.php
use Symfony\Config\AcmeFooConfig;

return static function (AcmeFooConfig $foo) {
  // ...
  // No need to return
}
```

One may also init the class directly, But this will not help you with generation or autoloading

```php
// config/packages/acme_foo.php
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $container) {
  $foo = new \Symfony\Config\AcmeFooConfig();
  // ...
  $container->extension('acme_foo', $foo->toArray());
}
```

**I do think we should only talk about the first way**

If a third party bundle like this idea and want to provide their own `ConfigBuilder`, they have two options:

1) Create the class `Symfony\Config\TheBundleConfig` themselves and make sure they configure composer to autoload that file and that the class implements `ConfigBuilderInterface`. We will never regenerate a file that already exists.

2) Create any class implementing `ConfigBuilderInterface` and ask their users to use that class in their config in the same way they would use `Symfony\Config\TheBundleConfig`.

The first way is obviously the smoothest way of doing things.

### BC

There is a great discussion about backwards compatibility for the generated files. We can assure that the class generator don't introduce a BC break with our tests. However, if the bundle changes their configuration definition it may break BC. Things like renaming, changing type or changing a single value to array is obvious BC breaks, however, these can be fixed in the config definition with normalisation.

The generator does not support normalisation. It is way way more complicated to reverse engineer that. I think a future update could fix this in one of two ways:
1) Add extra definition rules to help the class generator
2) Allow the bundle to patch part of the generated code

I hate BC breaks as much as the next person, but all the BC breaks in the generated classes will be caught when building the container (not at runtime), so I am fine with not having a 100% complete solution for this issue in the initial PR.

### Other limitations

If a bundle is using a custom extension alias, then we cannot guess it.. so a user have to use a cache warmer because we cannot generate the `ConfigBuilder` on the fly.

### TODO

- [x] Add tests
- [x] Update changelog
- [x] Write documentation

-------------

The generated code can be found in this example app: https://github.com/Nyholm/sf-issue-40600/tree/main/var/cache/dev/Symfony/Config

Commits
-------

460b46f730 [Config][DependencyInjection] Add configuration builder for writing PHP config
2021-04-13 18:59:17 +02:00
Nyholm
460b46f730 [Config][DependencyInjection] Add configuration builder for writing PHP config 2021-04-13 18:59:11 +02:00
Alexander M. Turek
48a191ca5f Merge branch '5.2' into 5.x
* 5.2:
  [WebProfiler] Use ControllerReference instead of URL in twig render()
  [Serializer][Validator] Update some phpDoc relative to "getters"
  Update README.md
  [SecurityBundle] Empty line starting with dash under "access_control" causes all rules to be skipped
  [Cache] Apply NullAdapter as Null Object
2021-04-13 16:18:23 +02:00
Alexander M. Turek
255283cb24 Merge branch '4.4' into 5.2
* 4.4:
  [Serializer][Validator] Update some phpDoc relative to "getters"
  Update README.md
  [SecurityBundle] Empty line starting with dash under "access_control" causes all rules to be skipped
  [Cache] Apply NullAdapter as Null Object
2021-04-13 16:17:49 +02:00
Alexander M. Turek
ade71f0404 bug #40791 [WebProfilerBundle] Use ControllerReference instead of URL in twig render() (Foxprodev)
This PR was merged into the 5.2 branch.

Discussion
----------

[WebProfilerBundle] Use ControllerReference instead of URL in twig render()

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40709
| License       | MIT
| Doc PR        |

Use `ControllerReference` instead of `UrlGenerator`'s URL. Helps to deal with different baseUrl

Feel free to help me with some advice. Thank you in advance

Commits
-------

f2ee8bc7ae [WebProfiler] Use ControllerReference instead of URL in twig render()
2021-04-13 16:13:45 +02:00
Wouter de Jong
c69cc3f2e6 minor #40792 [Security] Stop using a shared changelog for our security packages (Nyholm)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Security] Stop using a shared changelog for our security packages

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

I understand there are historical reasons for why our four security packages share a changelog. However, I dont believe it makes much sense moving forward.

I suggest that ~~6.0~~ will start using separate changelogs.

#### Update

Lets start in 5.4 for the reasons explained by Christophe

Commits
-------

0b1103ae48 [Security] Stop using a shared changelog for our security packages
2021-04-13 14:08:41 +02:00
Nyholm
0b1103ae48 [Security] Stop using a shared changelog for our security packages 2021-04-13 14:08:26 +02:00
Fabien Potencier
3bfd7bb909 minor #40788 [Security] [LoginLink] remove experimental (jrushlow)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Security] [LoginLink] remove experimental

| Q             | A
| ------------- | ---
| Branch?       | 5.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | tbd

Symfony's new security Login Link functionality is no longer experimental as of 5.3

Commits
-------

f2842f26e7 [Security][LoginLink] remove experimental
2021-04-13 14:01:00 +02:00
Jesse Rushlow
f2842f26e7
[Security][LoginLink] remove experimental 2021-04-13 07:45:04 -04:00
Javier Eguiluz
65f7408c61 Fixed the deprecation message about Master/Main requests 2021-04-13 13:27:06 +02:00
Grégoire Pineau
02704e9983 feature #40171 [Workflow] Add Mermaid.js dumper (eFrane)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Workflow] Add Mermaid.js dumper

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | #40165
| License       | MIT
| Doc PR        | symfony/symfony-docs#15102

Mermaid is - next to PlantUML - one of the most popular simple graphing solutions. This workflow dumper mirrors the feature set of the PlantUML dumper except that Mermaid does not currently support colored transitions.

**Things I need help with:**

- ~I basically tried to copy the code style of the surrounding files and hope everything is conforming. Please let me know if I missed something.~ I see, that's the magic of fabbot. Nice. ❤️
- There are currently no tests for the different graph direction constants, I can add those, just did not see value in doing so yet.
- I am unsure how to integrate this with the current documentation. This however is likely better discussed in the corresponding issue (see above).

Commits
-------

ada6f7d315 [Workflow] Add Mermaid.js dumper
2021-04-13 10:42:52 +02:00
eFrane
ada6f7d315 [Workflow] Add Mermaid.js dumper 2021-04-13 10:42:35 +02:00
Nicolas Grekas
0a32a7df19 minor #40779 [DependencyInjection] Allow calling custom processors directly on EnvConfigurator (jvasseur)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] Allow calling custom processors directly on EnvConfigurator

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

This is a proposition of addition to the feature added by https://github.com/symfony/symfony/pull/40682 to allow calling custom processors in the same way we call builtin ones. This is not perfect since it doesn't allow auto-completion for these custom methods but I think this provides a cleaner API for custom processors.

Commits
-------

1d008f76da Allow calling custom processors directly on EnvConfigurator
2021-04-13 09:57:59 +02:00
Foxprodev
f2ee8bc7ae [WebProfiler] Use ControllerReference instead of URL in twig render() 2021-04-13 10:28:22 +03:00
Fabien Potencier
ff0cf61278 feature #40761 [MonologBridge] Reset loggers on workers (l-vo)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[MonologBridge] Reset loggers on workers

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

This PR tries to solve some problems with buffered handlers (FingerCrossed) in workers.

Let's consider the default configuration (`stop_buffering: true`):
- When the threshold is crossed, all logs are flushed. Logs for the current message but also logs of previous messages in the buffer. Although buffer is limited `buffer_size`, it's a shame to keep logs of previous messages.
- When the threshold is crossed, buffering is disabled. So finger crossed configuration is not used anymore, all the logs are flushed as soon as they are written.

Then with (`stop_buffering: false`) (why isn't this the default configuration ?)
- It's a bit better since buffering isn't disabled when the threshold is crossed
- Like with `stop_buffering: true`, logs of previous messages are kept in memory

In a similar way of `DoctrineClearEntityManagerWorkerSubscriber`, this PR adds a `ResetLoggersWorkerSubscribber` to reset resettable loggers.

Integration in Monolog bundle: symfony/monolog-bundle#403

Commits
-------

1d2f7f1f87 [Messenger] Reset loggers on workers
2021-04-13 08:43:12 +02:00
Laurent VOULLEMIER
1d2f7f1f87 [Messenger] Reset loggers on workers 2021-04-13 08:42:46 +02:00
Fabien Potencier
3f42c08abd minor #40786 [Serializer][Validator] Update some phpDoc relative to "getters" (guilliamxavier)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Serializer][Validator] Update some phpDoc relative to "getters"

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yesish (phpDoc unaccurate after code updates)
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

5046500deb [Serializer][Validator] Update some phpDoc relative to "getters"
2021-04-13 08:32:45 +02:00
Guilliam Xavier
5046500deb [Serializer][Validator] Update some phpDoc relative to "getters" 2021-04-13 08:32:41 +02:00
Fabien Potencier
b8b29012da minor #40770 Update README.md (94noni)
This PR was merged into the 4.4 branch.

Discussion
----------

Update README.md

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes as doc
| Tickets       | see desc
| License       | MIT
| Doc PR        | .

Related to https://packagist.org/packages/symfony/web-server-bundle/stats
Also I do have a question, do Symfony uses the https://getcomposer.org/doc/04-schema.md#abandoned feature?
It can be useful I think

I’ve seen many differents way, inside the repo readme, via github repo description with [DEPRECATED], even marking the repo as readonly
IMHO a similar aproach should be done for all packages of the organisation :)

Commits
-------

37b19d9c06 Update README.md
2021-04-13 08:31:04 +02:00
Antoine Makdessi
37b19d9c06 Update README.md 2021-04-13 08:30:55 +02:00
Fabien Potencier
64cc54835d feature #40785 [Security] Deprecate using UsageTrackingTokenStorage outside the request-response cycle (wouterj)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Security] Deprecate using UsageTrackingTokenStorage outside the request-response cycle

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | yes
| Tickets       | Fix #40778
| License       | MIT
| Doc PR        | -

Currently, you get an "There is currently no session available" exception when using the `security.token_storage` service outside the main request-response cycle (e.g. in a `kernel.terminate` listener). This PR deprecates such usage and requires developers to update their definitions to explicitly use `security.untracked_token_storage` instead.

A different solution would be to silently disable tracking in these cases, but I think that might create some unnecessary technical debt.

Commits
-------

7452476156 [Security] Fix UsageTrackingTokenStorage outside the request cycle
2021-04-13 08:27:23 +02:00
Wouter de Jong
7452476156 [Security] Fix UsageTrackingTokenStorage outside the request cycle 2021-04-13 08:27:14 +02:00
Fabien Potencier
40b4ff8aae feature #40718 [Messenger] Add X-Ray trace header support to the SQS transport (WaylandAce)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Messenger] Add X-Ray trace header support to the SQS transport

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

aws documentation: https://docs.aws.amazon.com/xray/latest/devguide/xray-services-sqs.html

Commits
-------

5fa7ff9541 [Messenger] Added X-Ray trace header support to the SQS transport
2021-04-13 08:23:30 +02:00
Alexander M. Turek
e1f2e81306 bug #40330 [SecurityBundle] Empty line starting with dash under "access_control" causes all rules to be skipped (monteiro)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Empty line starting with dash under "access_control" causes all rules to be skipped

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #40235 ... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

When the IDE by mistake puts an empty line in `access_control` in security.yaml there is no warning that we have an empty row, making the rest of routes defined, to be ignored and possible to be accessed by anyone that can authenticate no matter the role.

# How to reproduce the issue

- git clone git@github.com:monteiro/symfony-issue-40235.git
- composer install
- symfony server:start
- open 127.0.0.1:8000/admin with username: "john_user" and password "123456"
- Since that user has only ROLE_USER should not be able to access the route... but because there is an empty line in "access_control" in `security.yaml`, "by mistake" it is possible to access the protected `ROLE_ADMIN` route.

Commits
-------

ee26ce5987 [SecurityBundle] Empty line starting with dash under "access_control" causes all rules to be skipped
2021-04-12 16:25:43 +02:00
Hugo Monteiro
ee26ce5987 [SecurityBundle] Empty line starting with dash under "access_control" causes all rules to be skipped 2021-04-12 16:25:37 +02:00
Alexander M. Turek
8c43fac84c bug #40780 [Cache] Apply NullAdapter as Null Object (roukmoute)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Cache] Apply NullAdapter as Null Object

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix https://github.com/symfony/symfony/issues/40753
| License       | MIT
<!--| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

There is a problem with the NullAdapter if I have to add an expression to work:

```php
$adapter = new NullAdapter();
$item = new CacheItem();
$item->set('FooBar');
if (!$adapter->save($item) && !($adapter instanceof NullAdapter)) {
    throw new Exception('Uoh oh');
}
```

So the goal here is to modify the methods that are causing a problem to behave as a Null Object.

Commits
-------

f6818eb7ac [Cache] Apply NullAdapter as Null Object
2021-04-12 16:23:06 +02:00
Mathias STRASSER
f6818eb7ac [Cache] Apply NullAdapter as Null Object 2021-04-12 16:22:57 +02:00
Jérôme Vasseur
1d008f76da Allow calling custom processors directly on EnvConfigurator
Add magic __call method to EnvConfigurator to allow calling custom
processors as methods instead of using the custom method.
2021-04-12 11:09:21 +02:00
Oskar Stark
0f6d5079cb [Notifier] Inject Mailer instead of service locator for FakeSms and FakeChat 2021-04-12 11:05:06 +02:00
Nicolas Grekas
5c660f7554 Merge branch '5.2' into 5.x
* 5.2:
  [HttpKernel] Minor fixes and tweaks in the Symfony Welcome Page
  Revert "minor #40768 [HttpClient] [PHPDoc] Fix 2 remaining return mixed (fancyweb)"
2021-04-12 10:56:19 +02:00
Nicolas Grekas
c3b4e81c23 Merge branch '4.4' into 5.2
* 4.4:
  [HttpKernel] Minor fixes and tweaks in the Symfony Welcome Page
  Revert "minor #40768 [HttpClient] [PHPDoc] Fix 2 remaining return mixed (fancyweb)"
2021-04-12 10:50:37 +02:00
Nicolas Grekas
e05b4efec2 minor #40777 [HttpKernel] Minor fixes and tweaks in the Symfony Welcome Page (javiereguiluz)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Minor fixes and tweaks in the Symfony Welcome Page

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | (not needed)

The current "Welcome Page" has a minor issue related to CSS flexbox. See how the "debug mode" text looks in smaller screens:

![before](https://user-images.githubusercontent.com/73419/114359439-4620d300-9b74-11eb-85c6-ee7afdb937df.png)

The solution is to wrap the contents in a HTML element such as `<p>`, but this PR also does some other minor tweaks. This is how it'd look now:

![after](https://user-images.githubusercontent.com/73419/114359535-5cc72a00-9b74-11eb-86c4-07fba89b8e8f.png)

Commits
-------

ee49cfe2b9 [HttpKernel] Minor fixes and tweaks in the Symfony Welcome Page
2021-04-12 10:48:29 +02:00
Javier Eguiluz
ee49cfe2b9 [HttpKernel] Minor fixes and tweaks in the Symfony Welcome Page 2021-04-12 10:48:24 +02:00
Nicolas Grekas
99e77492f2 [DependencyInjection] improve phpdoc for registerAttributeForAutoconfiguration() 2021-04-12 09:43:00 +02:00
Nicolas Grekas
afea0a0dc2 Revert "minor #40768 [HttpClient] [PHPDoc] Fix 2 remaining return mixed (fancyweb)"
This reverts commit 40d7315202, reversing
changes made to 4e904ec108.
2021-04-12 08:52:04 +02:00
Alexander M. Turek
364742f18c Merge branch '5.2' into 5.x
* 5.2:
  [HttpClient][PHPDoc] Fix 2 remaining return mixed
  [Cache] [FrameworkBundle] Fix logging for TagAwareAdapter
  [Route] Better inline requirements and defaults parsing
  Simplified condition and removed unused code from AbstractSessionListener::onKernelRequest
  [PhpUnitBridge] Fix phpunit symlink on Windows
  [Yaml] Fixed infinite loop when parser goes through an additional and invalid closing tag
  [Form] Fix 'invalid_message' use in multiple ChoiceType
2021-04-12 01:07:08 +02:00
Alexander M. Turek
86c9c3b0f8 Merge branch '4.4' into 5.2
* 4.4:
  [HttpClient][PHPDoc] Fix 2 remaining return mixed
  [Cache] [FrameworkBundle] Fix logging for TagAwareAdapter
  [Route] Better inline requirements and defaults parsing
  Simplified condition and removed unused code from AbstractSessionListener::onKernelRequest
  [PhpUnitBridge] Fix phpunit symlink on Windows
  [Yaml] Fixed infinite loop when parser goes through an additional and invalid closing tag
2021-04-12 00:55:21 +02:00
Nicolas Grekas
91fbc90238 Autowire arguments using attributes 2021-04-11 23:05:41 +02:00
Alexander M. Turek
b86aa3d068 [DependencyInjection] Bind constructor arguments via attributes 2021-04-11 23:04:00 +02:00
Wouter de Jong
e4cedfa21a [TwigBundle] Require TwigBridge 5.3 for SerializerExtension 2021-04-11 22:22:16 +02:00
Nicolas Grekas
cb0b07e8c1 feature #40682 [DependencyInjection] Add env() and EnvConfigurator in the PHP-DSL (fancyweb)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] Add env() and EnvConfigurator in the PHP-DSL

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Recently, I have been using env var processors a lot. This is a proposition to improve the DX a bit when you use the PHP-DSL to configure services.

Firstly, I am "annoyed" by the fact that I can do `param('my_param')` but not `env('MY_ENV')`.

Secondly, long chains of env var processors (eg: `%env(default:my_param:key:path:url:MY_ENV_VAR)` have two issues:
- you must construct and read them in "reverse"
- some env var processor are actually composed of 2 parts (key:path), you don't distinguish them easily from the rest

Before:
```php
->arg('$myArg', '%env(default:my_param:key:path:url:MY_ENV_VAR)%')
```

After:
```php
->arg(
    '$myArg',
    env('MY_ENV_VAR')
        ->url()
        ->key('path')
        ->default('my_param')
)
```

Custom env var processor would be callable with `->custom('my_custom_env_var_processor')` or you could extend the configurator and add your own methods.

WDYT?

Commits
-------

5f0fe3235f [DependencyInjection] Add env() and EnvConfigurator in the PHP-DSL
2021-04-11 19:27:24 +02:00
Nicolas Grekas
40d7315202 minor #40768 [HttpClient] [PHPDoc] Fix 2 remaining return mixed (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] [PHPDoc] Fix 2 remaining return mixed

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Two cases I forgot in https://github.com/symfony/symfony/pull/40728 😕

Commits
-------

97a43e1dab [HttpClient][PHPDoc] Fix 2 remaining return mixed
2021-04-11 19:25:56 +02:00
Thomas Calvet
97a43e1dab [HttpClient][PHPDoc] Fix 2 remaining return mixed 2021-04-11 19:17:27 +02:00
Thomas Calvet
6b0beca36f [Cache] [FrameworkBundle] Fix logging for TagAwareAdapter 2021-04-11 19:05:34 +02:00
Foxprodev
2a8c94a871 [Route] Better inline requirements and defaults parsing
Remove ! symbol from requirements and defaults array keys in Route class. Leave ! symbol in Route compiled path for correct token creation
Added some inline route settings tests
2021-04-11 14:59:39 +02:00
Nicolas Grekas
4a8ea4094f bug #40754 [PhpUnitBridge] Fix phpunit symlink on Windows (johnstevenson)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Fix phpunit symlink on Windows

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

If the symlink to `.phpunit/phpunit` already exists, unlink is called to remove it. But this fails on Windows (because it is a directory and requires `rmdir`), which in turn causes the subsequent `symlink` call to fail (because it already exists).

Additionally, creating symlinks on Windows requires Administrator permissions (generally), so `.phpunit/phpunit` can never be created for ordinary Users.

This PR uses a junction instead of a symlink on Windows. It also fixes some issues with stderror output and adds some argument escaping.

Commits
-------

ff8093246b [PhpUnitBridge] Fix phpunit symlink on Windows
2021-04-11 14:54:19 +02:00
StefanoCappellini
d344b8d6cb Simplified condition and removed unused code from AbstractSessionListener::onKernelRequest 2021-04-11 14:47:37 +02:00
Robin Chalas
b40eac2e78 feature #40145 [Security] Rework the remember me system (wouterj)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Security] Rework the remember me system

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fixes part of #39308
| License       | MIT
| Doc PR        | tbd

As I said in #39308, I want to change the remember me system in Symfony 5.3. The remember me system has a couple big "problems":

1. **It's hardwired into some Security classes** like `ContextListener`. The `RememberMeFactory` adds a `setRememberMe()` method call to the DI config and the context listener calls methods on this. This is very coupled, instead of the decoupled nature of the rest of security.
2. **Conditional conditions are combined with cookie creation in one class**. This is especially hard in e.g. 2FA (where setting the cookie should be done after 2FA is completed, which is currently near impossible as it's directly bound to the conditional of being called after logging in).

The changes
---

* The first commits harden the current functional test suite of remember me, to avoid breaking it.
* I discovered a lot of similarity between remember me tokens and login links. That's why I've extracted the shared logic into a generic `SignatureHasher` in the 3rd commit.
* I then remodelled `RememberMeAuthenticator` to the login link system, which I think improves a lot and at least improves problem (2) - as the conditionals (`RememberMeAuthenticator`) is split from the cookie creation (`RememberMeHandlerInterface`).
* Finally, I added a new event (`TokenDeauthenticatedEvent`) to the `ContextListener` to avoid direct coupling - solving problem (1).

This removes any usage of remember me services, which can be deprecated along with the rest of the security system.

Usage
---

As with the authenticator manager: **Nothing changes in the configuration**

Usage of persistent token providers has been improved. First, configuration is provided (setting up services is no longer needed):
```yaml
# before
services:
    Symfony\Bridge\Doctrine\Security\RememberMe\DoctrineTokenProvider:
        autowire: true

security:
    firewalls:
        main:
            remember_me:
                # ...
                token_provider: 'Symfony\Bridge\Doctrine\Security\RememberMe\DoctrineTokenProvider'

# after
security:
    firewalls:
        main:
            remember_me:
                # ...
                token_provider:
                    doctrine: true
```

Furthermore, a schema listener is created. Whenever the doctrine token provider is used, `make:migration`/`doctrine:schema:update` will automatically create the required table.

Some advanced usage of Remember me is also improved a lot (there is no real "before" here, consider looking at scheb/2fa to get an idea of the before). A few use-cases I took into account:

* If you ever need to **programmatically create a remember me cookie**, you can autowire `RememberMeHandlerInterface` and use `createRememberMeCookie($user)`. This will make sure the remember me cookie is set on the final response (using the `ResponseListener`)
* The `RememberMeListener` previously was responsible for both determining if a cookie must be set and setting the cookie. This is now split in 2 listeners (checking is done by `RememberMeConditionsListener`). If `RememberMeBadge` is enabled, the cookie is set and otherwise it isn't. This allows e.g. SchebTwoFactorBundle to create a listener that catches whether remember me was requested, but suppress it until the 2nd factor is completed.

Todo
---

* [x] Update UPGRADE and CHANGELOG
* [x] Show before/after examples
* [x] Investigate the conditional event registering of `ContextListener`. This forces to inject both the firewall and the global event dispatcher at the moment.
* Make sure old remember me tokens still function. As remember me tokens are long lived, we may need to provide backwards compatibility for at least Symfony 6.x. **Update: it was decided to not include this for now: https://github.com/symfony/symfony/pull/40145#issuecomment-785819607**

cc `@scheb` `@weaverryan` as you both initiated this PR by sharing the problems with the current design.

Commits
-------

15670419d4 [Security] Rework the remember me system
2021-04-11 14:47:25 +02:00
Wouter de Jong
15670419d4 [Security] Rework the remember me system 2021-04-11 14:47:19 +02:00
Nyholm
d37f158a88
[Notifier][Bridge] Remove hidden dependency on HttpFoundation 2021-04-11 10:41:01 +02:00
Pavel Kirpitsov
5fa7ff9541 [Messenger] Added X-Ray trace header support to the SQS transport 2021-04-10 00:55:17 +03:00
John Stevenson
ff8093246b [PhpUnitBridge] Fix phpunit symlink on Windows 2021-04-09 15:31:01 +01:00
Fabien Potencier
0f96ac7484 feature #40695 [Console] Deprecate Helper::strlen() for width() and length() (Nyholm)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Console] Deprecate Helper::strlen() for width() and length()

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | yes
| Deprecations? | yes
| Tickets       | Follow up form #40698
| License       | MIT
| Doc PR        |

This PR will deprecated `Helper::strlen()` since it is actually calculating the width. I remove the `@internal` on `Helper::width()` and a `Helper::length()`. I will also deprecate `Helper::strlenWithoutDecoration()` because you should use `Helper::removeDecoration()` instead.

Commits
-------

3c24aa9d47 [Console] Deprecate Helper::strlen() for width() and length()
2021-04-09 11:54:19 +02:00
Nyholm
3c24aa9d47 [Console] Deprecate Helper::strlen() for width() and length() 2021-04-09 11:54:15 +02:00
Nyholm
3a14868473
bug #40660 [Form] Fix 'invalid_message' use in multiple ChoiceType (alexandre-daubois)
This PR was merged into the 5.2 branch.

Discussion
----------

[Form] Fix 'invalid_message' use in multiple ChoiceType

| Q             | A
| ------------- | ---
| Branch?       | 5.2<!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #40636 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 5.x.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->

`invalid_message` option were not take into account anymore since v5.2.4. This PR intends to fix this. The option `invalid_message` is now passed to the `POST_SUBMIT` callback, for multiple ChoiceType.

Commits
-------

f2516840c8 [Form] Fix 'invalid_message' use in multiple ChoiceType
2021-04-09 10:33:08 +02:00
Nyholm
ed576b2554
bug #40707 [Yaml] Fixed infinite loop when parser goes through an additional and invalid closing tag (alexandre-daubois)
This PR was merged into the 4.4 branch.

Discussion
----------

[Yaml] Fixed infinite loop when parser goes through an additional and invalid closing tag

| Q             | A
| ------------- | ---
| Branch?       | 4.4 and above
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #40706 <!-- 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 -->

Instead of letting the parser goes in an infinite loop because it can't get the right closing tag, throw an exception when the additional and invalid closing tag is found

Commits
-------

d5f8c887a2 [Yaml] Fixed infinite loop when parser goes through an additional and invalid closing tag
2021-04-09 10:22:27 +02:00
Nyholm
1d8ad1d2ce
minor #40735 [Notifier] LightSMS duplicated $errorCode variable fix (StaffNowa)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Notifier] LightSMS duplicated $errorCode variable fix

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40712, #40733
| License       | MIT
| Doc PR        | -

Removed duplicated variable $errorCode.

Many thanks for:
@OskarStark, @jderusse and special thanks for @chalasr for fast rebase course at night :)))

Commits
-------

867769ede4 [Notifier] LightSMS duplicated $errorCode variable fix
2021-04-08 15:38:09 +02:00
Vasilij Dusko
867769ede4
[Notifier] LightSMS duplicated $errorCode variable fix 2021-04-08 15:38:03 +02:00
Oskar Stark
ddb48bb391 minor #40737 [Notifier] Added missing changelog (Nyholm)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Added missing changelog

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

I found this to be missing

Commits
-------

41198cccb5 [Notifier] Added missing changelog
2021-04-08 12:43:56 +02:00
Alexandre Daubois
7888f8930d [Security] Fixed missing badges argument for method authenticateUser 2021-04-08 12:34:40 +02:00
Robin Chalas
251ce63347 Merge branch '5.2' into 5.x
* 5.2:
  [PHPDoc] Fix some union type cases
2021-04-08 12:31:48 +02:00
Robin Chalas
59f97179e8 Merge branch '4.4' into 5.2
* 4.4:
  [PHPDoc] Fix some union type cases
2021-04-08 12:27:02 +02:00
Nyholm
41198cccb5
[Notifier] Added missing changelog 2021-04-08 11:51:11 +02:00
Fabien Potencier
491265f1fa bug #40736 [Notifier] Fix LightSms package name (fabpot)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Fix LightSms package name

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

As the namespace is LightSms and not Lightsms.

Commits
-------

2d80665a4a [Notifier] Fix LightSms package name
2021-04-08 11:46:46 +02:00
Nyholm
3977d7a634
feature #40486 [Security] Add concept of required passport badges (wouterj)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Security] Add concept of required passport badges

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | n
| Tickets       | Fix #39305
| License       | MIT
| Doc PR        | tbd

A badge on a passport is a critical security element, it determines which security checks are run during authentication. Using the `required_badges` setting, applications can make sure the expected security checks are run.

Commits
-------

01c3bf9604 [Security] Add concept of required passport badges
2021-04-08 11:39:40 +02:00
Fabien Potencier
2d80665a4a [Notifier] Fix LightSms package name 2021-04-08 11:36:44 +02:00
idetox
013d56d489 [Notifier] Add notifier for Microsoft Teams 2021-04-08 09:54:58 +02:00
Nyholm
e2f430dfb4
minor #40728 [PHPDoc] Fix some union type cases (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[PHPDoc] Fix some union type cases

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

While working on https://github.com/symfony/symfony/issues/40154, I discovered some PHPDoc issues, I'm going to comment in the review. Upper branches will need some fixes too.

Commits
-------

dd1481642b [PHPDoc] Fix some union type cases
2021-04-08 09:40:10 +02:00
Fabien Potencier
30b73c7575 feature #40710 [Serializer] Construct annotations using named arguments (derrabus)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Serializer] Construct annotations using named arguments

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | N/A
| License       | MIT
| Doc PR        | Not needed

This is the same as #40266, but applied to the serializer annotations.

This PR proposes to bump the `doctrine/annotations` library to 1.12 to gain access to its emulation layer for named arguments. Furthermore, constructing any of the serializer's annotation classes the old way by passing an array of parameters is deprecated.

### Reasons for this change

The constructors of our annotation classes have become unnecessarily complicated because we have to support two ways of calling them:
* An array of parameters, passed as first argument, because that's the default behavior `doctrine/annotations`.
* A set of named arguments because that's how PHP 8 attributes work.

Since we can now tell the Doctrine annotation reader to use named arguments as well, we can simplify the constructors of our annotations significantly.

### Drawback

After this change, there is no easy way anymore to construct instances of most of the annotation classes directly on PHP 7. The PR has been built under the assumption that instances of this class are usually created using either Doctrine annotations or a PHP 8 attribute. Thus, most applications should be unaffected by this change.

Commits
-------

c11666264d [Serializer] Construct annotations using named arguments
2021-04-08 08:57:14 +02:00
Fabien Potencier
8fc4c1bf3b Merge branch '5.2' into 5.x
* 5.2:
  Add test.
  [Console] Add Helper::strwidth() and Helper::strlength()
  Update README.md
2021-04-08 08:54:07 +02:00
Fabien Potencier
74056a70be bug #40698 [Console] Add Helper::width() and Helper::length() (Nyholm, grasmash)
This PR was merged into the 5.2 branch.

Discussion
----------

[Console] Add Helper::width() and Helper::length()

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Close #40697 Fix #40634, fix #40635
| License       | MIT
| Doc PR        |

This PR will add add a Helper::strwidth() and a Helper::strlength(). Same with with the Helper::strlenWithoutDecoration(). It does not deprecate anything. That is done in #40695

With this PR we dont have to revert the emoji issue (ie close #40697)

FYI @grasmash, I used your tests from #40635

Commits
-------

d9ea4c597c Add test.
dc02ab3d74 [Console] Add Helper::strwidth() and Helper::strlength()
2021-04-08 08:53:22 +02:00
Matthew Grasmick
d9ea4c597c Add test. 2021-04-08 08:53:10 +02:00
Nyholm
dc02ab3d74 [Console] Add Helper::strwidth() and Helper::strlength() 2021-04-08 08:53:10 +02:00
Fabien Potencier
9966e980e6 minor #40730 [Notifier] [CS] [5.x] Replace easy occurrences of ?: with ?? (fancyweb)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] [CS] [5.x] Replace easy occurrences of ?: with ??

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

https://github.com/symfony/symfony/pull/40729 on 5.x

Commits
-------

726075c177 [CS] [5.x] Replace easy occurrences of ?: with ??
2021-04-08 08:36:31 +02:00
Vasilij Dusko
0b1a450194 * LightSmsTransport.php 2021-04-08 01:08:46 +03:00
Thomas Calvet
726075c177 [CS] [5.x] Replace easy occurrences of ?: with ?? 2021-04-07 18:47:35 +02:00
Alexander M. Turek
fe9b188e28 Merge branch '5.2' into 5.x
* 5.2:
  [CS] [5.2] Replace easy occurrences of ?: with ??
2021-04-07 18:44:23 +02:00
Thomas Calvet
3f28f2ac31 [CS] [5.2] Replace easy occurrences of ?: with ?? 2021-04-07 18:27:53 +02:00
Thomas Calvet
dd1481642b [PHPDoc] Fix some union type cases 2021-04-07 18:22:29 +02:00
Alexander M. Turek
855aab243d Merge branch '5.2' into 5.x
* 5.2:
  [CS] Replace easy occurences of ?: with ??
2021-04-07 18:09:00 +02:00
Alexander M. Turek
b64ae4d419 Merge branch '4.4' into 5.2
* 4.4:
  [CS] Replace easy occurences of ?: with ??
2021-04-07 18:07:52 +02:00
Alexander M. Turek
47f3c4e52d Merge branch '5.2' into 5.x
* 5.2:
  Avoid warning with Xdebug 3 with develop mode disabled
2021-04-07 17:57:56 +02:00
Alexander M. Turek
945942020c Merge branch '4.4' into 5.2
* 4.4:
  Avoid warning with Xdebug 3 with develop mode disabled
2021-04-07 17:57:33 +02:00
Thomas Calvet
959d3d976c [CS] Replace easy occurences of ?: with ?? 2021-04-07 17:47:03 +02:00
Oskar Stark
0cc982c251 minor #40712 [Notifier]  Simplify LightSms implementation (jderusse)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier]  Simplify LightSms implementation

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

/cc @OskarStark

Commits
-------

1240e9f551 [notifier] Simplify lightsms implementation
2021-04-07 08:36:17 +02:00
Kévin Dunglas
eaae4500f4
[FrameworkBundle] Fix fragment.uri_generator definition 2021-04-06 16:17:34 +02:00
Jérémy Derussé
1240e9f551
[notifier] Simplify lightsms implementation 2021-04-06 14:01:04 +02:00
Thomas Calvet
5f0fe3235f [DependencyInjection] Add env() and EnvConfigurator in the PHP-DSL 2021-04-06 13:54:30 +02:00
Oskar Stark
0ce156c484 [Notifier] [FakeChat] Added the bridge 2021-04-06 12:38:02 +02:00
Oskar Stark
71a407da29 feature #40607 [Notifier] Add LightSms notifier bridge (Vasilij Dusko, StaffNowa)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Add LightSms notifier bridge

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT
| Doc PR        | symfony/symfony-docs/pull/15178
| Recipe PR | https://github.com/symfony/recipes/pull/921

LightSms notifier https://github.com/D4DLab/lightsms-notifier

Commits
-------

37c665eb5c * LightSmsTransport.php - make fabbot happy
68a12fa4f4 * fix tests
f1f83b9e5c * LightSmsTransport.php - use query string parameters
026dcd97a9 * LightSmsTransport.php - isset
2a9ac2d92a * LightSmsTransport.php - fix
4213564be1 * composer.json - fix Fabien comment from another pull request #40646
21e972a69e * coding standard
bea5256cc2 * type cast. On success lightsms return error code like string. On error return integer.
9b2e2d0b4a * type cast. On success lightsms return error code like string. On error return integer.
0d7488b10a * type cast. On success lightsms return error code like string. On error return integer.
9a832ef595 * LightSmsTransport.php - via mistake removed www which return (Closing direction to the user). Removed additional isset which in reality not needed. Added new method which allow to return "unknown error" and throw exception if not successfully
178d9c2a5a * pull request #40696
95e82f6ef1 Update LightSmsTransport.php
a197deeed1 * LightSmsTransport.php - better to remove if we do not have it?
83d259832b * Coding Standard patch
1ff97e410a * LightSmsTransport.php - build signature and use http_build_query, timestamp int
1c993b7224 * ERROR_CODES -> int * www. - bug * isset validate ['error']
1b59a7d47e * LightSmsTransport.php - string param
58ac708d0f * LightSmsTransport.php - return back www (without will not work). Now fail tests
b9f9ff8c94 * LightSmsTransport.php - tests fail
265f776394 * LightSmsTransport.php - issue with Symfony\Component\Notifier\Bridge\LightSms\Tests\LightSmsTransportTest
23a446a2e1 * LightSmsTransport.php - issue with Symfony\Component\Notifier\Bridge\LightSms\Tests\LightSmsTransportTest
08235e5a3c * LightSmsTransport.php - bug fix
80ef5ba565 * LightSmsTransport.php - Unable to send the SMS: Closing direction to the user
08b0729751 Update LightSmsTransport.php
7180c1f400 Update LightSmsTransport.php
f16b4d2aa2 * phone changed to from
7f13dbf711 * sender changed to from
e20ef1ed35 * LightSmsTransport.php - change + to 00
b0e64b9250 * LightSmsTransport.php - not ok throw exception
fc13bb27e2 * LightSmsTransport.php - changed login for validation (the same like we have all places)
5d2e6928f3 * LightSmsTransport.php - escape phone number
8620e828a7 * LightSmsTransport.php - move timestamp
66c34baf03 Update README.md
2e0e1d733d Update README.md
7b51e0dd7f Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
079406ed3d Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
0e41bc9186 Update src/Symfony/Component/Notifier/Bridge/LightSms/Tests/LightSmsTransportFactoryTest.php
3d0d79cfe2 Update src/Symfony/Component/Notifier/Bridge/LightSms/Tests/LightSmsTransportFactoryTest.php
e0a68bd0ac Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
1b073c2366 Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
b0891be0b2 Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
49b4780f40 Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
b2e46387b7 Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
c02dbbd963 Update src/Symfony/Component/Notifier/Bridge/LightSms/README.md
9f89014d94 Update src/Symfony/Component/Notifier/Bridge/LightSms/README.md
5e54dfe475 * LightSmsTransport.php - quick fix for private constant.
3cbbc85e43 * HOST split into two parts
9e1809e6ae * small changes
febff4613d Update src/Symfony/Component/Notifier/Bridge/LightSms/LICENSE
4a11b945a3 * github account author
728a3e2450 * Transport.php - missing use
ce41756a6c * notifier_transports.php - Coding Standard
d1ccd46e75 * Attached file changes which are required to run the lightsms notifier
a0fae7dc4a * tests
15686c0851 * LightSmsTransport.php - Coding Standard
2f65b92cba * LightSmsTransport.php - Coding Standard
6792535a52 * composer.json - requirements bug fix
167f325f40 * LightSmsTransport.php - logic error
be8f994fca * LightSmsTransport.php - return type
f2ba226b46 * LightSmsTransport.php - bug fix
b075c0eae2 * LightSms notifier
2021-04-06 12:32:50 +02:00
Robin Chalas
de143497ff minor #40671 [Notifier] Mercure bridge: bump mercure dependency to 0.5 (azjezz, mtarld)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Mercure bridge: bump mercure dependency to 0.5

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/15179

Bump Mercure bridge's `symfony/mercure` dependency to 0.5 to deal with hubs instead of publishers.

---
To be able to use `HandlerRegistry::all` method, this PR needs https://github.com/symfony/mercure/pull/50 to be merged and released.

Commits
-------

498f96f1a8 Drop support of mercure:^0.4
d3306fdc92 add support for symfony/mercure:^0.5
2021-04-06 12:24:06 +02:00
Vasilij Dusko | CREATION
37c665eb5c * LightSmsTransport.php - make fabbot happy 2021-04-06 13:22:50 +03:00
Vasilij Dusko | CREATION
68a12fa4f4 * fix tests 2021-04-06 13:18:17 +03:00
Vasilij Dusko | CREATION
f1f83b9e5c * LightSmsTransport.php - use query string parameters 2021-04-06 13:12:05 +03:00
Vasilij Dusko | CREATION
026dcd97a9 * LightSmsTransport.php - isset 2021-04-06 13:09:30 +03:00
Vasilij Dusko | CREATION
2a9ac2d92a * LightSmsTransport.php - fix 2021-04-06 13:06:59 +03:00
Mathias Arlaud
498f96f1a8 Drop support of mercure:^0.4 2021-04-06 11:32:33 +02:00
Christian Flothmann
e357dbb173 bug #40679 [Debug][ErrorHandler] Avoid warning with Xdebug 3 with develop mode disabled (Jean85)
This PR was merged into the 4.4 branch.

Discussion
----------

[Debug][ErrorHandler] Avoid warning with Xdebug 3 with develop mode disabled

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40677
| License       | MIT

As reported in #40677, this fix is needed when Xdebug 3 is enabled but its `develop` mode is off.

Commits
-------

0e0639b129 Avoid warning with Xdebug 3 with develop mode disabled
2021-04-06 09:22:26 +02:00
Alexander M. Turek
c11666264d [Serializer] Construct annotations using named arguments 2021-04-05 19:03:11 +02:00
Alexander M. Turek
3ca3de50c3 Merge branch '5.2' into 5.x
* 5.2:
  improve dx and document auth exception
2021-04-05 17:16:47 +02:00
Wouter de Jong
2ad08d5a02 minor #40672 [Security] [Passport] improve dx and document AuthenticationException (jrushlow)
This PR was merged into the 5.2 branch.

Discussion
----------

[Security] [Passport] improve dx and document AuthenticationException

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | tbd

`Passport::getUser()` (Instance of `UserPassportInterface::class`) throws an `AuthenticationException::class`
 if a user does not exist. Let's document that for better DX and visibility.

Use case:

- User login w/ a `username` that does not exist (custom json authenticator)
- Attempt Authentication...
- Auth failed `LoginFailureEvent` dispatched
- snippet below:
```php
// Userland\LoginFailureEventSubscriber::class

public function dispatchFailure(LoginFailureEvent $event): void
{
   $user = $event->getPassport()->getUser();

   $message = new UserlandMessage($user);

  $this->messageBus->dispatch($message);
}
```
- `401` status is returned.

The above subscriber fails silently because a `UsernameNotFoundException` was ultimately thrown from `UserBadge::getUser()`.

Commits
-------

97ceba0f5d improve dx and document auth exception
2021-04-05 14:32:26 +02:00
Vasilij Dusko
4213564be1 * composer.json - fix Fabien comment from another pull request #40646 2021-04-05 15:00:41 +03:00
Alexandre Daubois
d5f8c887a2 [Yaml] Fixed infinite loop when parser goes through an additional and invalid closing tag
Instead of letting the parser goes in an infinite loop, throw an exception when the additional and invalid is found
2021-04-05 12:16:45 +02:00
Wouter de Jong
01c3bf9604 [Security] Add concept of required passport badges
A badge on a passport is a critical security element, it determines which
security checks are run during authentication. Using the `required_badges`
setting, applications can make sure the expected security checks are run.
2021-04-05 11:07:23 +02:00
Oskar Stark
712100924d minor #40696 [Mailer][Notifier] added missing gitattributes and gitignore (iamvar)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Mailer][Notifier] added missing gitattributes and gitignore

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| License       | MIT

just added missing .gitattributes and .gitignore to be consistent with other components

Commits
-------

00ac6d4b45 added missing gitattributes and gitignore
2021-04-04 17:37:30 +02:00
Alexander M. Turek
51c0c5a1bf Merge branch '5.2' into 5.x
* 5.2:
  added missing gitattributes and gitignore
  allow CurlHttpClient on Windows
  [Security] Mark ExpiredLoginLinkStorage as experimental
  remove references to "Silex"
2021-04-04 14:44:25 +02:00
Alexander M. Turek
58fa56f359 Merge branch '4.4' into 5.2
* 4.4:
  allow CurlHttpClient on Windows
  remove references to "Silex"
2021-04-04 14:43:53 +02:00
Alexander M. Turek
09866a3b76 minor #40693 [Security] Mark ExpiredLoginLinkStorage as experimental (Nyholm)
This PR was merged into the 5.2 branch.

Discussion
----------

[Security] Mark ExpiredLoginLinkStorage as experimental

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

We missed marking this as experimental together with the other "LoginLink" features.

This PR follows the discussion in https://github.com/symfony/symfony/pull/40145/files#r589072524

Commits
-------

76a88f2211 [Security] Mark ExpiredLoginLinkStorage as experimental
2021-04-04 14:42:57 +02:00
Vasilij Dusko
21e972a69e * coding standard 2021-04-04 10:54:22 +03:00
Vasilij Dusko
bea5256cc2 * type cast. On success lightsms return error code like string. On error return integer. 2021-04-04 10:53:00 +03:00
Vasilij Dusko
9b2e2d0b4a * type cast. On success lightsms return error code like string. On error return integer. 2021-04-04 10:52:47 +03:00
Vasilij Dusko
0d7488b10a * type cast. On success lightsms return error code like string. On error return integer. 2021-04-04 10:51:01 +03:00
Vasilij Dusko
9a832ef595 * LightSmsTransport.php - via mistake removed www which return (Closing direction to the user). Removed additional isset which in reality not needed. Added new method which allow to return "unknown error" and throw exception if not successfully 2021-04-04 10:48:58 +03:00
Vasilij Dusko
178d9c2a5a * pull request #40696 2021-04-04 10:26:24 +03:00
iamvar
b455de0cbf added missing gitattributes and gitignore 2021-04-03 22:22:42 +03:00
Enrico
6609a175f2
allow CurlHttpClient on Windows 2021-04-03 19:46:18 +02:00
iamvar
00ac6d4b45 added missing gitattributes and gitignore 2021-04-03 14:22:18 +03:00
Nyholm
76a88f2211
[Security] Mark ExpiredLoginLinkStorage as experimental 2021-04-03 11:49:32 +02:00
Roman Martinuk
99e742991b
remove references to "Silex" 2021-04-02 15:57:07 +02:00
Alessandro Lai
0e0639b129
Avoid warning with Xdebug 3 with develop mode disabled 2021-04-02 09:50:12 +02:00
Fabien Potencier
bb1e1e58ae bug #40641 LoginLink create get Request Locale (roromix)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

LoginLink create get Request Locale

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT
| Doc PR        | symfony/symfony-docs#15163

While writing the documentation for PR#40153 I noticed that the RequestContext :: fromRequest method does not add the '_locale' parameter automaticaly. This new pull request to set _locale parameter to the RequestContext.

Commits
-------

433d76bfe1 LoginLink create get Request Locale
2021-04-02 08:14:28 +02:00
roromix
433d76bfe1 LoginLink create get Request Locale 2021-04-02 08:14:21 +02:00
Vasilij Duško
95e82f6ef1
Update LightSmsTransport.php
remove dump die
2021-04-02 06:31:20 +03:00
Alexander M. Turek
28ac2c7f56 Remove unused import 2021-04-01 20:14:42 +02:00
Jesse Rushlow
97ceba0f5d
improve dx and document auth exception 2021-04-01 11:29:25 -04:00
Vasilij Dusko | CREATION
a197deeed1 * LightSmsTransport.php - better to remove if we do not have it? 2021-04-01 13:58:54 +03:00
Nicolas Grekas
3f0f21c361 Merge branch '5.2' into 5.x
* 5.2:
  fixed parser
  Fixed bugs found by psalm
  [FrameworkBundle] Dont store cache misses on warmup
  fix test
  Update references to the ContainerConfigurator
  [Translation] Remove file added back from a bad merge
  Fix sleep value
  [Cache] skip storing failure-to-save as misses in ArrayAdapter
  [Validator] Delete obsolete statement in Regex::getHtmlPattern() phpDoc
  [FrameworkBundle] Remove author comments for configuration and extension
  [Stopwatch] Document new "name" property of StopwatchEvent
  [DependencyInjection] Fix "url" env var processor behavior when the url has no path
  Fixed support for nodes not extending BaseNode
  [FrameworkBundle] dont access the container to configure http_cache
  add missing queue_name to find(id) in doctrine messenger transport
  [Config][FrameworkBundle] Hint to use PHP 8+ or to install Annotations to use attributes/annots
  [Serializer] AbstractNormalizer force null for non-optional nullable constructor parameter denormalization when not present in input
2021-04-01 12:43:52 +02:00
Nicolas Grekas
b5d1cbcd97 Merge branch '4.4' into 5.2
* 4.4:
  fixed parser
  Fixed bugs found by psalm
  [FrameworkBundle] Dont store cache misses on warmup
  [Cache] skip storing failure-to-save as misses in ArrayAdapter
  [Validator] Delete obsolete statement in Regex::getHtmlPattern() phpDoc
  [FrameworkBundle] Remove author comments for configuration and extension
  [DependencyInjection] Fix "url" env var processor behavior when the url has no path
  Fixed support for nodes not extending BaseNode
  add missing queue_name to find(id) in doctrine messenger transport
  [Serializer] AbstractNormalizer force null for non-optional nullable constructor parameter denormalization when not present in input
2021-04-01 12:42:13 +02:00
Vasilij Dusko | CREATION
83d259832b * Coding Standard patch 2021-04-01 13:35:26 +03:00
Vasilij Dusko | CREATION
1ff97e410a * LightSmsTransport.php - build signature and use http_build_query, timestamp int 2021-04-01 13:33:34 +03:00
Roman Martinuk
31b0472331 fixed parser 2021-04-01 12:32:13 +02:00
Nicolas Grekas
f651ce6f5a bug #40610 Fixed bugs found by psalm (Nyholm)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Fixed bugs found by psalm

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

When running psalm for branch 4.4, we get around 1500 errors. I browsed though them all and here is a small PR with the actual bugs I think should be fixed.

I'll make review comments about them below.

Commits
-------

0a0cd7a274 Fixed bugs found by psalm
2021-04-01 12:24:18 +02:00
Nyholm
0a0cd7a274 Fixed bugs found by psalm 2021-04-01 12:24:12 +02:00
Nicolas Grekas
bd90627814 bug #40603 [Config] Fixed support for nodes not extending BaseNode (Nyholm)
This PR was merged into the 4.4 branch.

Discussion
----------

[Config] Fixed support for nodes not extending BaseNode

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Too many times we assume that a `NodeInterface` extends `BaseNode`. This PR adds a small test with a new `CustomNodeDefinition` and `CustomNode` that implements `NodeInterface`.

Commits
-------

68276562c3 Fixed support for nodes not extending BaseNode
2021-04-01 12:23:12 +02:00
Nicolas Grekas
4d23fec021 bug #40658 [RateLimiter] Fix sleep value (jderusse)
This PR was merged into the 5.2 branch.

Discussion
----------

[RateLimiter] Fix sleep value

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40656
| License       | MIT
| Doc PR        |

sleep vs usleep

Commits
-------

cf66399399 Fix sleep value
2021-04-01 12:20:53 +02:00
Nicolas Grekas
cc7d1264c8 bug #40645 [FrameworkBundle] Dont store cache misses on warmup (Nyholm)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Dont store cache misses on warmup

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #38694
| License       | MIT
| Doc PR        | symfony/symfony-docs#15172

When we are warming the annotation cache, we are reading all annotation into an `ArrayAdapter`. When we are done we move the values to a `PhpArrayAdapter` to store them in a file.

@Seldaek [found out](https://github.com/symfony/symfony/issues/38694#issuecomment-810501066) that when you are using a custom constraint with a `Symfony\Component\Validator\Constraints\Callback`, there is a strange error like:

> Can use "yield from" only with arrays and Traversables

That is because the `Closure` in the `Symfony\Component\Validator\Constraints\Callback` cannot be serialised and saved to cache. But since the `ArrayAdapter` is also [storing misses as null](https://github.com/symfony/symfony/pull/35362), the null values are understood as real values.

When all values are moved to the `PhpArrayAdapter` and we ask the cache for a value (via Doctrine's `CacheProvider`), it will return `null` as a value instead of `false` as a cache miss. And `null` is not something one could "yield from".

Commits
-------

27a22b34af [FrameworkBundle] Dont store cache misses on warmup
2021-04-01 12:17:55 +02:00
Nyholm
27a22b34af [FrameworkBundle] Dont store cache misses on warmup 2021-04-01 12:17:49 +02:00
Nicolas Grekas
993f8093db minor #40669 [Notifier] [FakeSms] Add missing LICENSE and .gitattributes file (OskarStark)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] [FakeSms] Add missing LICENSE and .gitattributes file

| 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       |  | License       | MIT
| Doc PR        |

cc @nicolas-grekas

Commits
-------

4704f4ef1f [Notifier] [FakeSms] Add missing LICENSE and .gitattributes file
2021-04-01 12:14:44 +02:00
Vasilij Dusko | CREATION
1c993b7224 * ERROR_CODES -> int
* www. - bug
* isset validate ['error']
2021-04-01 13:12:34 +03:00
Christian Flothmann
3de5b38cea fix test 2021-04-01 12:10:12 +02:00
Nyholm
095f382a44
minor #40604 Improve ExtractorInterface phpdoc (VincentLanglet)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

Improve ExtractorInterface phpdoc

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| 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 -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 5.x.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->

I think this phpdoc can be improved

Commits
-------

255b608d6d Improve ExtractorInterface phpdoc
2021-04-01 12:02:30 +02:00
Vincent Langlet
255b608d6d
Improve ExtractorInterface phpdoc 2021-04-01 12:02:24 +02:00
Oskar Stark
4704f4ef1f [Notifier] [FakeSms] Add missing LICENSE and .gitattributes file 2021-04-01 11:58:08 +02:00
Alexandre Daubois
f2516840c8 [Form] Fix 'invalid_message' use in multiple ChoiceType 2021-04-01 11:51:11 +02:00
lerminou
6990829c2e Update references to the ContainerConfigurator
follows: e4598c2b4f
2021-04-01 10:56:15 +02:00
Nicolas Grekas
882f845c6b minor #40649 [FrameworkBundle] Remove author comments for configuration and extension (Nyholm)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Remove author comments for configuration and extension

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

I really don't want to step on anyones toes. I'm also super grateful for all the time, effort and energy these contributors (and everybody else) have given to Symfony.

The `@author` tags should represent "who knows the most about this class" or to give the original author some kind of credit (more visible than `git blame`).

The FrameworkBundle's `Configuration` and `FrameworkExtension` classes are a bit special. Fist because they are well known by most recurring contributors. They are also thousands of lines long and many many users have added a line or two. The `FrameworkExtension` have over 50 people that currently authored more than 5 lines. The named authors combined have about that 12% and 25% in `Configuration` and `FrameworkExtension` respectively.

I do like the `@author` tag, but for the reasons above, I don't think they make sense for these classes.

Commits
-------

f19d72aa07 [FrameworkBundle] Remove author comments for configuration and extension
2021-04-01 10:46:32 +02:00
Nicolas Grekas
6f4b0a3715 bug #40667 [Messenger] fix deprecation layer in AbstractFailedMessagesCommand (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Messenger] fix deprecation layer in AbstractFailedMessagesCommand

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Added in #38468, spotted in #40643

Commits
-------

079cb31b7e [Messenger] fix deprecation layer in AbstractFailedMessagesCommand
2021-04-01 10:44:28 +02:00
Nicolas Grekas
079cb31b7e [Messenger] fix deprecation layer in AbstractFailedMessagesCommand 2021-04-01 10:27:23 +02:00
Nicolas Grekas
11db9cd250 minor #40643 Use symfony/deprecation-contracts instead of trigger_error (andrew-demb)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Use symfony/deprecation-contracts instead of trigger_error

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes <!-- 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 -->

As `symfony/deprecation-contracts` added to requirements with PR #40468, we can update `trigger_error` call in favor reusing deprecation abstractions

Commits
-------

1acc296773 Use symfony/deprecation-contracts instead of trigger_error
2021-04-01 10:19:34 +02:00
Andrii Dembitskyi
1acc296773 Use symfony/deprecation-contracts instead of trigger_error 2021-04-01 10:19:26 +02:00
Nicolas Grekas
4a8c0b14db [Translation] Remove file added back from a bad merge 2021-04-01 10:15:21 +02:00
Nyholm
ac54ad750b
minor #40650 [Validator] Delete obsolete statement in Regex::getHtmlPattern() phpDoc (guilliamxavier)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Delete obsolete statement in Regex::getHtmlPattern() phpDoc

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #12235
| License       | MIT
| Doc PR        |

The original issue was #5307 (`match=false` not handled in `getHtmlPattern()`).
Then #5382 patched it to return null (rather than an incorrect result) and inserted a statement and a "todo" in the phpDoc.
Later (but still years ago) #12235 properly implemented pattern inversion, but only removed the "todo"; this PR removes the statement.

Commits
-------

3bdf8d7238 [Validator] Delete obsolete statement in Regex::getHtmlPattern() phpDoc
2021-04-01 09:42:19 +02:00
Vasilij Dusko | CREATION
1b59a7d47e * LightSmsTransport.php - string param 2021-04-01 08:41:55 +03:00
Nyholm
990b51ba0a
bug #40629 [DependencyInjection] Fix "url" env var processor behavior when the url has no path (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Fix "url" env var processor behavior when the url has no path

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Before:
```yaml
MY_URL_ENV_VAR=http://symfony.com
%env(key:path:url:MY_URL_ENV_VAR)% --> false
```

After:
```yaml
MY_URL_ENV_VAR=http://symfony.com
%env(key:path:url:MY_URL_ENV_VAR)% --> null
```

Returning `false` for the path prevents me from using the `default` env var processor that is triggered only for `''` and `null`.
(`%env(default:my_fallback_param:key:path:url:MY_URL_ENV_VAR)%`)

BTW, with PHP 8, it actually works because `substr(null, 1)` behavior changed (see https://3v4l.org/oHf6l).

Commits
-------

2876cf9cc6 [DependencyInjection] Fix "url" env var processor behavior when the url has no path
2021-03-31 21:58:59 +02:00
Jérémy Derussé
cf66399399
Fix sleep value 2021-03-31 21:55:39 +02:00
Nyholm
f963ae476a
minor #40657 [Notifier] add missing LICENSE file for SpotHit (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] add missing LICENSE file for SpotHit

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

f4c28cbfc5 [Notifier] add missing LICENSE file for SpotHit
2021-03-31 21:48:03 +02:00
Nyholm
2ceb35a805
bug #40655 [Cache] skip storing failure-to-save as misses in ArrayAdapter (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] skip storing failure-to-save as misses in ArrayAdapter

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #38694
| License       | MIT
| Doc PR        | -

In addition to #40645

Commits
-------

ba6698795c [Cache] skip storing failure-to-save as misses in ArrayAdapter
2021-03-31 21:20:27 +02:00
Nicolas Grekas
f4c28cbfc5 [Notifier] add missing LICENSE file for SpotHit 2021-03-31 18:35:27 +02:00
Nicolas Grekas
ba6698795c [Cache] skip storing failure-to-save as misses in ArrayAdapter 2021-03-31 17:30:10 +02:00
Fabien Potencier
f6159038ed feature #40576 [Mime] Remove @internal from Headers methods (VincentLanglet)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Mime] Remove @internal from Headers methods

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- 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 -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 5.x.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->

I don't understand why the methods
- `Headers::getHeaderBody()`
- `Headers::setHeaderBody()`
- `Headers::getHeaderParameter()`
- `Headers::setHeaderParameter()`
are marked as internal.

They are already used by others libraries, like
a6c3fa9aea/Transport/MandrillApiTransport.php (L92)
a6c3fa9aea/Transport/MandrillApiTransport.php (L99)

The implementation shouldn't change so they could be under the BC promise.
Plus they are useful, and I don't see any other way that reimplementing the method if we want to do something like
```
->getHeaderParameter('Content-Disposition', 'name')
```

Commits
-------

592fb13456 Remove internal annotation
2021-03-31 13:46:29 +02:00
Guilliam Xavier
3bdf8d7238
[Validator] Delete obsolete statement in Regex::getHtmlPattern() phpDoc 2021-03-31 11:00:59 +02:00
Nyholm
f19d72aa07
[FrameworkBundle] Remove author comments for configuration and extension 2021-03-31 10:59:36 +02:00
Oskar Stark
0b13575df5 [Notifier] [FakeSms] Change DSN to be more realistic 2021-03-31 09:19:44 +02:00
Robin Chalas
3154509985 feature #40575 [FrameworkBundle][HttpKernel][TwigBridge] Add an helper to generate fragments URL (dunglas)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[FrameworkBundle][HttpKernel][TwigBridge] Add an helper to generate fragments URL

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix n/a
| License       | MIT
| Doc PR        | todo

This PR adds a new helper to generate raw fragment URL. Fragments will be useful to generate lazy frames with Symfony UX Turbo (https://github.com/symfony/ux/pull/64). This will also be convenient when using hinclude, ESI etc in case you want full control over the generated HTML.
This is also more in sync with the new best practices we apply in the form component (generate the HTML by yourself instead of using Twig helpers hiding the HTML elements).

Example:

```html
<turbo-frame id="set_aside_tray" src="{{ fragment_uri(controller('Symfony\Bundle\FrameworkBundle\Controller', {template: "foo.html.twig"})) }}">
  <img src="/icons/spinner.gif">
</turbo-frame>
```

Commits
-------

5d29d76612 [FrameworkBundle][HttpKernel][TwigBridge] Add an helper to generate fragments URL
2021-03-30 16:47:58 +02:00
Kévin Dunglas
5d29d76612 [FrameworkBundle][HttpKernel][TwigBridge] Add an helper to generate fragments URL 2021-03-30 16:47:49 +02:00
Robin Chalas
7327919e9e feature #38468 Messenger multiple failed transports (monteiro)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

Messenger multiple failed transports

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #34911
| License       | MIT
| Doc PR        | symfony/symfony-docs#13489
<!--
https://github.com/symfony/symfony-docs/pull/13489 Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch master.
-->

## Strategy applied

- Pass a map of transports and failed transports to the `SendFailedMessageToFailureTransportListener`. This way we re-use the same listener.
- Local failed transport has more priority than a global failed transport defined.

## Configuration example

```yaml
# config/packages/messenger.yaml
framework:
    # no need to set failed transport globally if I want a specific behaviour per transport.
    failure_transport: failed # all transports have this failed transport
    messenger:
        transports:
            failed: 'doctrine://default?queue_name=failed'
            failed_important: 'doctrine://default?queue_name=failed_important'
            async:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                failure_transport: failed # takes precedence over the global defined "failed_transport"
                retry_strategy:
                    max_retries: 3
                    delay: 1000
                    multiplier: 2
            async_no_failure_transport: # it will use the global defined transport if no one is defined.
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                retry_strategy:
                    max_retries: 3
                    delay: 1000
                    multiplier: 2
            async_send_specific_failure_queue:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                failed_transport: failed_important # takes precedence over the global defined "failed_transport"
                retry_strategy:
                    max_retries: 3
                    delay: 1000
                    multiplier: 2
```

You can test this feature easily on a [demo project](https://github.com/monteiro/messenger-multiple-failed-transports-pr34979). Just follow the [README](https://github.com/monteiro/messenger-multiple-failed-transports-pr34979).

**More information on issue #34911**

## What needs to be done so this can be merged:
- [x] validate strategy
- [ ] update src/**/CHANGELOG.md files
- [x] update tests to cover all cases
- [x] create doc PR

Commits
-------

5810b6c378 Messenger multiple failed transports
2021-03-30 16:29:57 +02:00
Hugo Monteiro
5810b6c378 Messenger multiple failed transports 2021-03-30 16:28:46 +02:00
Vasilij Dusko | CREATION
58ac708d0f * LightSmsTransport.php - return back www (without will not work). Now fail tests 2021-03-30 13:18:00 +03:00
Vasilij Dusko | CREATION
b9f9ff8c94 * LightSmsTransport.php - tests fail 2021-03-30 09:17:45 +03:00
Vasilij Dusko | CREATION
265f776394 * LightSmsTransport.php - issue with Symfony\Component\Notifier\Bridge\LightSms\Tests\LightSmsTransportTest 2021-03-30 09:15:57 +03:00
Vasilij Dusko | CREATION
23a446a2e1 * LightSmsTransport.php - issue with Symfony\Component\Notifier\Bridge\LightSms\Tests\LightSmsTransportTest 2021-03-30 09:14:59 +03:00
Vasilij Dusko | CREATION
08235e5a3c * LightSmsTransport.php - bug fix 2021-03-30 08:09:56 +03:00
Vasilij Dusko | CREATION
80ef5ba565 * LightSmsTransport.php - Unable to send the SMS: Closing direction to the user 2021-03-30 08:07:02 +03:00
Robin Chalas
e16be83f91 bug #40522 [Serializer] Allow AbstractNormalizer to use null for non-optional nullable constructor parameters without default value (Pierre Rineau)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] Allow AbstractNormalizer to use null for non-optional nullable constructor parameters without default value

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40511
| License       | MIT

Serializer component AbstractNormalizer attemps to guess constructor parameters, and falls back using default values when possible. Yet, it misses one use case: nullable non-optional parameter with value not being present in incoming input, case in which null is a valid value, not the default one, yet still valid.

This PR introduce a two-line fix that forcefully set null as value for missing from input non-optional nullable constructor parameters values.

Commits
-------

d29e433ae8 [Serializer] AbstractNormalizer force null for non-optional nullable constructor parameter denormalization when not present in input
2021-03-30 00:36:11 +02:00
Robin Chalas
5dad871833 bug #40595 add missing queue_name to find(id) in doctrine messenger transport (monteiro)
This PR was merged into the 4.4 branch.

Discussion
----------

add missing queue_name to find(id) in doctrine messenger transport

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT

This bug was noticed by @weaverryan when reviewing the PR: https://github.com/symfony/symfony/pull/38468 related to multiple failure transports.

Commits
-------

bb26a92826 add missing queue_name to find(id) in doctrine messenger transport
2021-03-30 00:15:30 +02:00
Vasilij Duško
08b0729751
Update LightSmsTransport.php 2021-03-29 19:37:44 +03:00
Vasilij Duško
7180c1f400
Update LightSmsTransport.php 2021-03-29 19:26:20 +03:00
Krystian Marcisz
de43e36a2c [Stopwatch] Document new "name" property of StopwatchEvent 2021-03-29 17:28:41 +02:00
Robin Chalas
481222f545 minor #40586 [Config][FrameworkBundle] Hint to use PHP 8+ or to install Annotations for using attributes/annots (dunglas)
This PR was merged into the 5.2 branch.

Discussion
----------

[Config][FrameworkBundle] Hint to use PHP 8+ or to install Annotations for using attributes/annots

…s to use attributes/annots

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | See https://github.com/symfony/recipes/pull/916
| License       | MIT
| Doc PR        | n/a

Improve the error message to hint that you can upgrade to PHP 8 instead of using `doctrine/annotations`.

Commits
-------

af6f3c2c08 [Config][FrameworkBundle] Hint to use PHP 8+ or to install Annotations to use attributes/annots
2021-03-29 17:18:19 +02:00