* 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
* 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
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
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.
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
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
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
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
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
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
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`
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()`
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
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
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
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