Commit Graph

51053 Commits

Author SHA1 Message Date
Fabien Potencier
9e8f2e7db6 Update VERSION for 4.4.14 2020-09-27 06:25:44 +02:00
Fabien Potencier
5e81cb7c7b Update CHANGELOG for 4.4.14 2020-09-27 06:25:32 +02:00
Fabien Potencier
2abc465335 Merge branch '5.1'
* 5.1:
  Fix wrong merge
2020-09-27 06:23:47 +02:00
Fabien Potencier
46e609b262 Fix wrong merge 2020-09-27 06:23:37 +02:00
Fabien Potencier
9a774ede48 Bump Symfony version to 3.4.46 2020-09-27 06:03:03 +02:00
Fabien Potencier
acaf962168
Merge pull request #38311 from fabpot/release-3.4.45
released v3.4.45
2020-09-27 05:47:15 +02:00
Fabien Potencier
bc38373380 Update VERSION for 3.4.45 2020-09-27 05:46:58 +02:00
Fabien Potencier
0022465b97 Update CONTRIBUTORS for 3.4.45 2020-09-27 05:46:54 +02:00
Fabien Potencier
17ceb6e73e Update CHANGELOG for 3.4.45 2020-09-27 05:46:13 +02:00
Fabien Potencier
6ca92258d7 Merge branch '5.1'
* 5.1:
  [ErrorHandler] Return false directly and remove unused variable
  [OptionsResolver] Assert that the error type is valid in deprecations test
  [OptionsResolver] Fix deprecation message access
  [HttpClient] Allow bearer token with colon
  [Form] Fix custom formats deprecation with HTML5 widgets
  [Translator] Optional Intl dependency
  [Contracts][Translation] Optional Intl dependency
  [ErrorHandler] Escape JSON encoded log context
  update missing translations arabic
  [Yaml] simplify the test
  fix test by letting mock throw the actual expected exception
2020-09-27 05:44:38 +02:00
Fabien Potencier
5685496974 Merge branch '4.4' into 5.1
* 4.4:
  [ErrorHandler] Return false directly and remove unused variable
  [OptionsResolver] Assert that the error type is valid in deprecations test
  [HttpClient] Allow bearer token with colon
  [Form] Fix custom formats deprecation with HTML5 widgets
  [Translator] Optional Intl dependency
  [Contracts][Translation] Optional Intl dependency
  [ErrorHandler] Escape JSON encoded log context
  update missing translations arabic
  [Yaml] simplify the test
  fix test by letting mock throw the actual expected exception
2020-09-27 05:44:28 +02:00
Fabien Potencier
55a450d827 Merge branch '3.4' into 4.4
* 3.4:
  update missing translations arabic
  [Yaml] simplify the test
  fix test by letting mock throw the actual expected exception
2020-09-27 05:36:23 +02:00
Fabien Potencier
a6aa08e166 feature #38296 [lock] Provides default implementation when store does not supports the behavior (jderusse)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[lock] Provides default implementation when store does not supports the behavior

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

All stores does not provide the same behaviors. Some are blocking, some allows shared Locks, ...
Issue is: When people use `lock` to use a behavior that is not supported by the store, they get an `UnsuportedException`, but they don't have any way to know if the store supports or not the behavior they want to use.

ie: when using the FrameworkBundle
```yaml
framework:
    lock: '%env(LOCK_DSN)%'
```
User (or bundle) can't use safely `$lock->acquire(true)` or `$lock->acquireRead()`.

Given it's very easy to provide an fallback implementation to those behavior, this PR
- use fallback implementation when store does not support the behavior
- deprecate the RetryTillSaveStore (not needed anymore)

Commits
-------

575b391b9b [lock] Provides default implementation when store does not supports the behavior
2020-09-27 05:25:42 +02:00
Jérémy Derussé
575b391b9b [lock] Provides default implementation when store does not supports the behavior 2020-09-27 05:25:36 +02:00
Fabien Potencier
934b125dff feature #38298 [Notifier] Add Sendinblue notifier. (ptondereau)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Notifier] Add Sendinblue notifier.

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

Add Sendinblue SMS notifier bridge.

Commits
-------

e7300a8580 Add Sendinblue notifier.
2020-09-27 05:14:32 +02:00
Pierre Tondereau
e7300a8580 Add Sendinblue notifier. 2020-09-26 11:58:00 +02:00
Fabien Potencier
9e4f511cbf Fix CS 2020-09-26 07:31:43 +02:00
Fabien Potencier
013bbcc23e minor #38303 [Messenger] Fix misleading comment about time-limit (sylfabre)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Messenger] Fix misleading comment about time-limit

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

The current explanation of the time-limit option of the `messenger:consume` command is misleading as it lets you think that this is an enforced hard limit.

For instance, you may think that a command started with `--time-limit=10` will stop once 10 seconds are elapsed, no matter what.

Actually, two things happen:
- Once 10 seconds have elapsed, then the worker won't receive and handle any other message
- The worker will keep running until the currently handled message is fully handled so it can last way longer than 10 seconds, then it will stop.

I'm not sure this is behavior is actually a bug or not, but the current documentation does not describe the current behavior

Commits
-------

21176646e9 [Messenger] Fix misleading comment about time-limit
2020-09-26 07:30:40 +02:00
Fabien Potencier
ffb7f0e36f minor #38304 [Translation] Allow Translatable objects to be used as strings (tgalopin)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Translation] Allow Translatable objects to be used as strings

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

Allow Translatable objects to be used as strings.

Commits
-------

0ba206420e [Translation] Allow Translatable objects to be used as strings
2020-09-26 07:28:36 +02:00
Fabien Potencier
6a5571552f Fix CS 2020-09-26 07:26:20 +02:00
Fabien Potencier
02d879f693 feature #38305 [PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION (stevegrunwell)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | none
| License       | MIT
| Doc PR        | symfony/symfony-docs#14286

This PR adds support for the `SYMFONY_MAX_PHPUNIT_VERSION` environment variable, letting users set the **maximum** version of PHPUnit to be considered when running the PHPUnit Bridge.

The use case here comes from testing WordPress using the library; as of the time of this ticket, [WordPress' core test suite does not yet support PHPUnit 8.x](https://core.trac.wordpress.org/ticket/46149). As a result, trying to run the WordPress core test suite with PHPUnit Bridge results in the following error under PHP 7.2 or newer:

> **Error:** Looks like you're using PHPUnit 8.3.5. WordPress requires at least PHPUnit 5.4 and is currently only compatible with PHPUnit up to 7.x.
Please use the latest PHPUnit version from the 7.x branch.

In this use case, the developer testing against WordPress would set `SYMFONY_MAX_PHPUNIT_VERSION=7.5` in their environment (or `phpunit.xml` file) and the PHPUnit Bridge would never go *above* that version (but would still be free to, for instance, load PHPUnit 6 when running under PHP 7.0).

Commits
-------

7877a5b488 [PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION
2020-09-26 07:25:33 +02:00
Steve Grunwell
7877a5b488 [PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION 2020-09-25 14:59:28 -04:00
Titouan Galopin
0ba206420e [Translation] Allow Translatable objects to be used as strings 2020-09-25 18:10:29 +02:00
Sylvain Fabre
21176646e9 [Messenger] Fix misleading comment about time-limit 2020-09-25 15:58:44 +02:00
Nicolas Grekas
6bb0ef4f52 minor #38299 [ErrorHandler] Return false directly and remove unused variable (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Return false directly and remove unused variable

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

To return true, $type and $log both need to be true. But to enter the condition, one of them has to be false.

I also spotted an unused variable below so I removed it.

Commits
-------

3933957d1a [ErrorHandler] Return false directly and remove unused variable
2020-09-25 11:42:25 +02:00
Thomas Calvet
3933957d1a [ErrorHandler] Return false directly and remove unused variable 2020-09-25 10:51:35 +02:00
Fabien Potencier
f71d8cfabb minor #38294 [OptionsResolver] Assert that the error type is valid in deprecations test (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[OptionsResolver] Assert that the error type is valid in deprecations test

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

A change in the code could cause a warning for example and still produce the expected number of errors and the expected last error. Checking the type of the error is a little bit better. The best would be to check all the expected deprecations one by one, maybe later? 😄

Commits
-------

926d18f2f9 [OptionsResolver] Assert that the error type is valid in deprecations test
2020-09-25 08:00:01 +02:00
Fabien Potencier
44bd82cb2d bug #38291 [OptionsResolver] Fix deprecation message access (fancyweb)
This PR was merged into the 5.1 branch.

Discussion
----------

[OptionsResolver] Fix deprecation message access

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

`$this->deprecated[$option]` cannot be a string, it's always an array.

Commits
-------

232af423aa [OptionsResolver] Fix deprecation message access
2020-09-25 07:58:26 +02:00
Fabien Potencier
e6dcf9bc03 bug #38292 Register the binary types as well (jdelaune)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Register the binary types as well

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

Binary versions were not working since they weren't registered

Commits
-------

96a0e5fca1 Register the binary types as well
2020-09-25 07:57:25 +02:00
Jordan de Laune
96a0e5fca1 Register the binary types as well 2020-09-25 07:57:18 +02:00
Thomas Calvet
926d18f2f9 [OptionsResolver] Assert that the error type is valid in deprecations test 2020-09-24 18:40:22 +02:00
Thomas Calvet
232af423aa [OptionsResolver] Fix deprecation message access 2020-09-24 18:12:55 +02:00
Fabien Potencier
713f30efaf feature #38288 [DomCrawler] Add assertFormValue() in WebTestCase (mnapoli)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[DomCrawler] Add `assertFormValue()` in `WebTestCase`

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

Add new assertions for checking form values, to use in functional tests.

Example:

```php
    public function testForm()
    {
        $this->visit('/edit-form');

        self::assertNoFormValue('#form', 'activateMembership'); // checkboxes don't have values when unchecked
        self::assertFormValue('#form', 'trialPeriod', '15');

        $this->client->submitForm('Save', [
            'activateMembership' => 'on',
            'trialPeriod' => '7',
        ]);

        self::assertResponseIsSuccessful();
        self::assertFormValue('#form', 'activateMembership', 'on');
        self::assertFormValue('#form', 'trialPeriod', '7');
    }
```

I resorted to using the `->form()` API because:

- checking the value of checkboxes was not possible today via existing assertions (I opened #38287 for that)
- checking the value of selects was impossible using CSS selectors (as far as I know), but possible with the `->form()` helper

Commits
-------

c3e0336596 [DomCrawler] Add `assertFormValue()` and `assertNoFormValue()` in `WebTestCase`
2020-09-24 17:08:30 +02:00
Matthieu Napoli
c3e0336596 [DomCrawler] Add assertFormValue() and assertNoFormValue() in WebTestCase 2020-09-24 17:08:19 +02:00
Fabien Potencier
af90e1e286 feature #38287 [DomCrawler] Add checkbox assertions for functional tests (mnapoli)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[DomCrawler] Add checkbox assertions for functional tests

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

Add new assertions for checkboxes, to use in functional tests.

Example:

```php
    public function testAssertCheckboxChecked()
    {
        $this->visit('/edit-form');

        $this->client->submitForm('Save', [
            'activateMembership' => 'on',
        ]);

        self::assertResponseIsSuccessful();
        // Check that the field is checked after the form was submitted
        self::assertCheckboxChecked('activateMembership');
    }
```

This wasn't possible to achieve with the existing `self::assertInputValueSame()` assertion.

Commits
-------

f26758e1c0 [DomCrawler] Add `assertCheckboxChecked()`
2020-09-24 17:01:52 +02:00
Fabien Potencier
2bdcf4ac8f feature #36326 [Validator] Add invalid datetime message in Range validator (przemyslaw-bogusz)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Validator] Add invalid datetime message in Range validator

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

When the validated value is invalid (it isn't a number nor a datetime), but `min` or `max` option indicate that the `Range` constraint is being used to validate a datetime, the displayed message will be `This value should be a valid datetime` instead of `This value should be a valid number`. This PR replaces #35998.

Commits
-------

c77730699e [Validator] Add invalid datetime message in Range validator
2020-09-24 16:49:32 +02:00
Przemysław Bogusz
c77730699e [Validator] Add invalid datetime message in Range validator 2020-09-24 16:49:16 +02:00
Fabien Potencier
59f712475b feature #38243 [HttpKernel] Auto-register kernel as an extension (HypeMC)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpKernel] Auto-register kernel as an extension

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

Symfony already supports having the kernel as an extension. This is evident by the fact that the [`config:dump-reference` and `debug:config`](https://github.com/symfony/symfony/pull/36186) commands check whether the kernel implements the `ExtensionInterface`. Nonetheless, it's still required to register the kernel manually as an extension.

With this PR the kernel will be automatically registered as an extension if it implements the `ExtensionInterface`. This is the same logic as when the kernel implements the `CompilerPassInterface`.

Commits
-------

9c34980869 Auto-register kernel as an extension
2020-09-24 16:31:11 +02:00
Fabien Potencier
5c48235e71 feature #38277 [Mailer] Added Sendinblue bridge (drixs6o9)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Mailer] Added Sendinblue bridge

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT
| Doc PR        | [https://github.com/symfony/symfony-docs/pull/14272](https://github.com/symfony/symfony-docs/pull/14272)
| Recipe | [https://github.com/symfony/recipes/pull/822](https://github.com/symfony/recipes/pull/822)

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

N.B. I had a little help from [Pierre TONDEREAU](https://github.com/ptondereau) for the API.

Commits
-------

836a20350b [Mailer] Added Sendinblue bridge
2020-09-24 16:10:39 +02:00
drixs6o9
836a20350b [Mailer] Added Sendinblue bridge 2020-09-24 16:10:25 +02:00
Fabien Potencier
6e9949b9b2 feature #35956 [Form] Added "html5" option to both MoneyType and PercentType (romaricdrigon)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Form] Added "html5" option to both MoneyType and PercentType

| Q             | A
| ------------- | ---
| Branch?       | master for features
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |  -
| License       | MIT
| Doc PR        | TBD

Hello,

In the same way that [NumberType](https://symfony.com/doc/current/reference/forms/types/number.html) offers a `html5` option to render a `number` input instead of a `text` input, this PR adds the same option to both `MoneyType` and `PercentType`. Number inputs offer a better UI, especially on mobile (specific keyboard), and they accept extra HTML attributes, such as `max=100`, which are quite useful.

The challenge is that `number` inputs need a "raw" value, nor formatted nor localized.
Format is described here https://www.w3.org/TR/html51/sec-forms.html#date-time-and-number-formats (non-normative, but tested on a few browsers). It matches number formatting for `en` locale (which is great, since it is the one provided by Symfony Intl polyflil), without grouping.

Implementation was done in a manner similar to `NumberType` for `MoneyType`.
`PercentType` required to modify `PercentToLocalizedStringTransformer` too.

As a bonus, `PercentType` had no tests at all, I added a few.

I wanted to get some feedback on the idea first, remaining steps:
 - update `CHANGELOG.md`
 - update the doc

Commits
-------

f7312a48ea [Form] Added "html5" option to both MoneyType and PercentType
2020-09-24 15:56:19 +02:00
Fabien Potencier
2e819f3ba9 Revert "feature #33381 [Form] dispatch submit events for disabled forms too (xabbuh)"
This reverts commit dc63d712ab, reversing
changes made to 59ae592909.
2020-09-24 15:50:42 +02:00
Romaric Drigon
f7312a48ea [Form] Added "html5" option to both MoneyType and PercentType 2020-09-24 15:48:47 +02:00
Nicolas Grekas
caab0f1b4f bug #38248 [HttpClient] Allow bearer token with colon (stephanvierkant)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpClient] Allow bearer token with colon

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

The JetBrains Hub (YouTrack API) creates tokens with a `perm:` prefix. This doesn't work right now, because HttpClient doesn't allow a colon in the bearer token.

As far as I can see, there is no reason to disallow the use of the semicolon in the bearer token, so this PR fixes it.

Example of a token: `perm:c3RlcGhhbg==.NTUtMw==.NiZw16agafhsQAShTvclhb78hyJh2H`

Commits
-------

82ed1ec20a [HttpClient] Allow bearer token with colon
2020-09-24 15:25:52 +02:00
Stephan Vierkant
82ed1ec20a [HttpClient] Allow bearer token with colon 2020-09-24 15:25:24 +02:00
Fabien Potencier
9e7e2a87c9 bug #37837 [Form] Fix custom formats deprecation with HTML5 widgets (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form] Fix custom formats deprecation with HTML5 widgets

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

1. The options resolver only show the deprecations for user defined (overidden) options.
2. The default value of the `html5` option is enough to pass the logical condition of the callback.

That means that only setting the `format` option (like in the reproducer) does not trigger the deprecation while it should. I think we need a feature in the options resolver component to handle those kind of cases 🤷‍♂️

Meanwhile, we can fix the issue by "deprecating" all the concerned options of the logical condition of the callback.

Commits
-------

d28182f99b [Form] Fix custom formats deprecation with HTML5 widgets
2020-09-24 12:57:15 +02:00
Fabien Potencier
aa5d0ea829 feature #38269 [String] allow passing null to string functions (kbond)
This PR was submitted for the 5.1 branch but it was merged into the 5.2-dev branch instead.

Discussion
----------

[String] allow passing null to string functions

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #38260
| License       | MIT
| Doc PR        | n/a

I also added a default value for `s` to match the other functions.

Commits
-------

f20a318f37 [String] allow passing null to string functions
2020-09-24 11:57:29 +02:00
Kevin Bond
f20a318f37 [String] allow passing null to string functions 2020-09-24 11:57:23 +02:00
Fabien Potencier
d635390a39 bug #38273 Always require SQL comment hint (lexthink)
This PR was merged into the 5.2-dev branch.

Discussion
----------

Always require SQL comment hint

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

The `GuidType` does not always return true, because it is mapped to the native uuid type if available. But `AbstractBinaryUidType` and `AbstractUidType`  are not mapped like that, so they always requires the comment hint to avoid issues when diffing the schema (the DB introspection would detect a `GuidType` and so a change would be needed).

Commits
-------

33e78b43a4 Always require SQL comment hint
2020-09-24 11:54:29 +02:00
Thomas Calvet
d28182f99b [Form] Fix custom formats deprecation with HTML5 widgets 2020-09-24 11:52:40 +02:00