Commit Graph

32725 Commits

Author SHA1 Message Date
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
Oskar Stark
5572bab94d [Notifier] [FakeSms] Use correct namespace 2021-03-29 14:17:30 +02:00
Oskar Stark
c14d189ba5 feature #39949 [Notifier] [FakeSms] Add the bridge (JamesHemery)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Notifier] [FakeSms] Add the bridge

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

@OskarStark Bridge added :)

Commits
-------

351065e774 [Notifier] [FakeSms] Add the bridge
2021-03-29 14:05:03 +02:00
James Hemery
351065e774 [Notifier] [FakeSms] Add the bridge 2021-03-29 14:04:56 +02:00
Wouter de Jong
8afd7a3765 [Security] Rename UserInterface::getUsername() to getUserIdentifier() 2021-03-28 22:24:55 +02:00
Robin Chalas
c469ea6fff Merge branch '5.2' into 5.x
* 5.2:
  [Security] Use more concrete user classes in tests
  fix docblock
2021-03-28 19:35:24 +02:00
Wouter de Jong
631408b757 [Security] Use more concrete user classes in tests 2021-03-28 19:23:00 +02:00
Nyholm
5545755b58
minor #40611 [HttpKernel] fix docblock (xabbuh)
This PR was merged into the 5.2 branch.

Discussion
----------

[HttpKernel] fix docblock

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

Commits
-------

73999b8a3a fix docblock
2021-03-28 18:31:18 +02:00
Wouter de Jong
f30c103cb6 Merge branch '5.2' into 5.x
* 5.2:
  Use concrete user related classes in the tests
  [Filesystem] Fix dumpFile() method call
2021-03-28 16:57:18 +02:00
Wouter de Jong
b5f0f7bb82 Merge branch '4.4' into 5.2
* 4.4:
  [Filesystem] Fix dumpFile() method call
2021-03-28 16:30:26 +02:00
Wouter de Jong
89d9de2077 Use concrete user related classes in the tests
This allows the tests to automatically adapt for changes in the UserInterface
and UserProviderInterface in 5.x
2021-03-28 16:18:37 +02:00
Christian Flothmann
73999b8a3a fix docblock 2021-03-28 15:55:03 +02:00
sebpacz
2b33d4af65 [Filesystem] Fix dumpFile() method call 2021-03-28 11:59:32 +02:00
Christian Flothmann
9139f774af Merge branch '5.2' into 5.x
* 5.2:
  fix merge
2021-03-28 11:59:21 +02:00
Christian Flothmann
d33973bbbe fix merge 2021-03-28 11:59:03 +02:00
Christian Flothmann
42a56528e9 Merge branch '5.2' into 5.x
* 5.2:
  skip intl dependent tests if the extension is missing
  make DateCaster tests timezone-agnostic
  error if the input string couldn't be parsed as a date
  IntegerType: Always use en for IntegerToLocalizedStringTransformer Fixes #40456
  Uses the correct assignment action for console options depending if they are short or long
  [HttpKernel] ConfigDataCollector to return known data without the need of a Kernel
  [HttpClient] fix using stream_copy_to_stream() with responses cast to php streams
  FIx Trying to clone an uncloneable object of class
2021-03-28 11:44:11 +02:00
Christian Flothmann
6e1015fbca Merge branch '4.4' into 5.2
* 4.4:
  skip intl dependent tests if the extension is missing
  make DateCaster tests timezone-agnostic
  error if the input string couldn't be parsed as a date
  IntegerType: Always use en for IntegerToLocalizedStringTransformer Fixes #40456
  Uses the correct assignment action for console options depending if they are short or long
  [HttpKernel] ConfigDataCollector to return known data without the need of a Kernel
  [HttpClient] fix using stream_copy_to_stream() with responses cast to php streams
  FIx Trying to clone an uncloneable object of class
2021-03-28 11:42:18 +02:00
Christian Flothmann
71da904de0 skip intl dependent tests if the extension is missing 2021-03-28 10:05:52 +02:00
Fabien Potencier
84bbfb36c9 Fix CS 2021-03-28 08:39:13 +02:00
Fabien Potencier
8081d97994 minor #40585 [Serializer] Nicer ExtraAttributesException message for single attribute (finwe)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Serializer] Nicer ExtraAttributesException message for single attribute

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

This PR changes wording of ExtraAttributesException message in case there is only one extra attribute:

Before
----
    Extra attributes are not allowed ("foo", "bar" are unknown).
    Extra attributes are not allowed ("foo" are unknown).

After:
----

    Extra attributes are not allowed ("foo", "bar" are unknown).
    Extra attributes are not allowed ("foo" is unknown).

Commits
-------

1ba6a2cf50 [Serializer] Nicer ExtraAttributesException message for single attribute
2021-03-28 08:38:24 +02:00
Fabien Potencier
5666a45a02 bug #40598 [Form] error if the input string couldn't be parsed as a date (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form] error if the input string couldn't be parsed as a date

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

When the Intl polyfill is used instead of the PHP intl extension, the
intl_get_error_code() function always returns 0 no matter if the input
string could be parsed.

Commits
-------

5ce5300da3 error if the input string couldn't be parsed as a date
2021-03-28 08:36:08 +02:00
Fabien Potencier
9889c492d7 bug #40587 [HttpClient] fix using stream_copy_to_stream() with responses cast to php streams (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix using stream_copy_to_stream() with responses cast to php streams

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

Commits
-------

cf1404a30b [HttpClient] fix using stream_copy_to_stream() with responses cast to php streams
2021-03-28 08:32:58 +02:00
Stefano Arlandini
1ef44ae7c6 [Cache] Support a custom serializer in the ApcuAdapter class 2021-03-28 08:28:53 +02:00
Nyholm
0d99f93eaf
minor #40599 [VarDumper] make DateCaster tests timezone-agnostic (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] make DateCaster tests timezone-agnostic

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

Commits
-------

bfef4546d3 make DateCaster tests timezone-agnostic
2021-03-27 22:10:44 +01:00
Christian Flothmann
bfef4546d3 make DateCaster tests timezone-agnostic 2021-03-27 20:49:03 +01:00
Christian Flothmann
5ce5300da3 error if the input string couldn't be parsed as a date
When the Intl polyfill is used instead of the PHP intl extension, the
intl_get_error_code() function always returns 0 no matter if the input
string could be parsed.
2021-03-27 18:05:23 +01:00
Christian Flothmann
d0875a9287 bug #40510 [Form] IntegerType: Always use en for IntegerToLocalizedStringTransformer (Warxcell)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form] IntegerType: Always use en for IntegerToLocalizedStringTransformer

Fixes #40456

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

Commits
-------

83b836dbc9 IntegerType: Always use en for IntegerToLocalizedStringTransformer Fixes #40456
2021-03-26 15:31:20 +01:00
Warxcell
83b836dbc9 IntegerType: Always use en for IntegerToLocalizedStringTransformer
Fixes #40456
2021-03-26 12:41:55 +02:00
Roberto Nygaard
d0a3c538f4 Uses the correct assignment action for console options depending if they are short or long 2021-03-26 10:23:24 +01:00
Nyholm
a863e2fe8d
bug #40535 [HttpKernel] ConfigDataCollector to return known data without the need of a Kernel (topikito)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpKernel] ConfigDataCollector to return known data without the need of a Kernel

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

Sets `$this->data` with information that can be known without the need of a `Kernel`.

Commits
-------

d919f2ce83 [HttpKernel] ConfigDataCollector to return known data without the need of a Kernel
2021-03-25 19:50:57 +01:00
Roberto Nygaard
d919f2ce83
[HttpKernel] ConfigDataCollector to return known data without the need of a Kernel 2021-03-25 19:50:37 +01:00
Nicolas Grekas
cf1404a30b [HttpClient] fix using stream_copy_to_stream() with responses cast to php streams 2021-03-25 18:52:07 +01:00
Matěj Humpál
1ba6a2cf50
[Serializer] Nicer ExtraAttributesException message for single attribute 2021-03-25 18:21:49 +01:00
Jan Rosier
0144d0a151 The $algorithms array is only used when $algorithm is set 2021-03-25 17:57:36 +01:00
Robin Chalas
532f4aaa8e [Security] Move the badges resolution check to AuthenticatorManager 2021-03-24 13:36:59 +01:00
Nicolas Grekas
16f3fc1e55 minor #40568 Fix Trying to clone an uncloneable object of class (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix Trying to clone an uncloneable object of class

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

Since `ext-redis: 5.3..3`, the `\Redis` class is not cloneable anymore (https://github.com/phpredis/phpredis/commit/cd05a344).
PHPUnit 7.5 (used byt PHP 7.1) clones objects provided by the dataprovier, when they are cloneable.
To check if an object is cloneable, it use the `Reflexion::isCloneable` method and check if the `__clone` method is public.

The issue is, the Class generated by `createMock` is cloneable, which leads to an exception such as:
> Trying to clone an uncloneable object of class Mock_Redis_b2f171b3

This PR fake replaces the mock by a real instance of the class.

Commits
-------

f67dab95e2 FIx Trying to clone an uncloneable object of class
2021-03-24 09:42:51 +01:00
Jérémy Derussé
f67dab95e2
FIx Trying to clone an uncloneable object of class 2021-03-24 09:30:27 +01:00
Nicolas Grekas
314ef9fb88 [Security/Http] conflict with symfony/security-bundle < 5.3 2021-03-23 22:56:56 +01:00
Nicolas Grekas
c9a8c6ff60 Fix tests 2021-03-23 22:40:36 +01:00
Benjamin Cremer
f4e50fb1c7 [HttpFoundation] Add support for mysql unix_socket and charset in PdoSessionHandler::buildDsnFromUrl 2021-03-23 22:32:01 +01:00
Nicolas Grekas
3bf6798031 feature #40153 [Security] LoginLink with specific locale (roromix)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Security] LoginLink with specific locale

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

I have added the possibility to create a login link for a specific locale. It's useful when we want generate a link for an other user who isn't in the same locale of us.

Commits
-------

50673c5321 [Security] LoginLink with specific locale
2021-03-23 22:14:39 +01:00
Roromix
50673c5321 [Security] LoginLink with specific locale 2021-03-23 22:14:25 +01:00
Nicolas Grekas
4e3ae2d58e feature #40489 [Serializer] Add a Custom End Of Line in CSV File (xfifix)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Serializer] Add a Custom End Of Line in CSV File

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

Commits
-------

20f03677e3 [Serializer] Add a Custom End Of Line in CSV File
2021-03-23 22:11:04 +01:00
Nicolas Grekas
7f640123cb feature #40554 [Contracts] Add TranslatorInterface::getLocale() (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Contracts] Add `TranslatorInterface::getLocale()`

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

As discussed in https://github.com/symfony/symfony/issues/40380

Commits
-------

45d9a36794 [Contracts/Translation] Add `TranslatorInterface::getLocale()`
2021-03-23 22:10:30 +01:00
Nicolas Grekas
45b53fee14 feature #40556 Add #[As-prefix] to service attributes (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Add `#[As-prefix]` to service attributes

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

This PR renames all existing attributes with the `As` prefix, as I proposed several times already.

This should help autocompletion, and it's required to not collide with existing class names (eg the `Command` class, but also the old `Controller` class, etc.)

I think this `As` prefix is a convention for the better.

Commits
-------

4f1318963a Add `#[As-prefix]` to service attributes
2021-03-23 22:09:38 +01:00
Nicolas Grekas
ea58a157e1 Merge branch '5.2' into 5.x
* 5.2:
  [travis] remove cache of composer.lock for deps=low
  Fix comment with typo
2021-03-23 22:05:31 +01:00