This PR was merged into the 5.2 branch.
Discussion
----------
[Security] Use concrete UserInterface and UserProviderInterface classes in the tests
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | n/a
Fixes failing deps=high builds in #40403
Commits
-------
89d9de2077 Use concrete user related classes in the tests
This PR was merged into the 4.4 branch.
Discussion
----------
[Filesystem] Fix dumpFile() method call
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | ?
| New feature? | no
| Deprecations? | no
| Tickets | ---
| License | MIT
| Doc PR | ---
The dumpFile() method in the Filesystem component takes two arguments (filename and content). I found a test with the third argument set to null.
Commits
-------
2b33d4af65 [Filesystem] Fix dumpFile() method call
* 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
* 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
This PR was merged into the 4.4 branch.
Discussion
----------
[Form] skip intl dependent tests if the extension is missing
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
71da904de0 skip intl dependent tests if the extension is missing
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
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
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
This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
[Cache] Support a custom serializer in the ApcuAdapter class
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#40523
| License | MIT
| Doc PR | n/a
Unlike some other cache adapters like the one for Redis, the APCu adapter does not support a custom serializer. Even though most things can be stored as-is in this cache, some others like resources cannot
Commits
-------
1ef44ae7c6 [Cache] Support a custom serializer in the ApcuAdapter class
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
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.
This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
[TwigBridge] add tailwindcss form layout
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | todo
Per @weaverryan's [call to action on twitter](https://twitter.com/weaverryan/status/1369654724107067392) and slack discussion.
It's been tricky to create a generic form layout for tailwind as it's a css *utility framework* and has an unlimited number of ways to style forms. With tailwindcss 2.0, the tailwind team released an [official form plugin](https://github.com/tailwindlabs/tailwindcss-forms) that provides form element reset/normalization that looks decent out of the box. This PR is an attempt to piggy-back on this plugin to provide a minimal Symfony form layout for tailwind. The goal is to have your forms look good in a tailwind/Symfony app with no customization (but of course allow customization as desired).
This layout **requires** tailwindcss 2 and the form plugin.
I followed the ["unstyled" demo](https://tailwindcss-forms.vercel.app/) for the form plugin as a style guide. Here is a screenshot of this layout used in [a demo Symfony app](https://github.com/kbond/symfony-tailwind) with several common form types (I'll try to keep this updated as I update the PR):
![New-Post](https://user-images.githubusercontent.com/127811/112684961-3d2cc380-8e4a-11eb-8e43-0c08d2eecd7a.png)
Some notes about the layout:
1. I tried to use as few tailwind classes as possible and avoid color (primary exception being the error color).
2. I decided on a mobile-first approach so out of the box, it will look decent on any device and drastically reduces the number of css classes/assumptions.
3. While other layouts merge classes passed by the user, I opted to replace. This ensures the user doesn't have to _undo_ the class decisions made by this layout. I also discovered "undoing" doesn't work as I expected anyway: `class="mt-1 mt-0"`, `mt-1` "wins" as `mt-1` comes later in the compiled stylesheet.
4. For the _low level_ blocks, I extracted the classes into their own "variables" (`row_class`, `widget_class`, `label_class`, `help_class`, `error_item_class`) to make it easier to extend and customize the layout. Note the `widget_disabled_class`/`widget_errors_class` variables: these are added even if you've overridden the `widget_class` variable.
### Customization
Customizing is especially important for this layout. Here are the two ways:
1. Twig form functions:
```twig
{{ form_row(form.title, {
row_class: 'my row classes',
label_class: 'my label classes',
error_item_class: 'my error item classes',
widget_class: 'my widget classes',
widget_disabled_class: 'my disabled widget classes',
widget_errors_class: 'my widget with error classes',
}) }}
```
2. Project specific form layout:
```twig
{% use 'tailwind_2_layout.html.twig' %}
{%- block form_row -%}
{%- set row_class = row_class|default('my row classes') -%}
{{- parent() -}}
{%- endblock form_row -%}
{%- block widget_attributes -%}
{%- set widget_class = widget_class|default('my widget classes') -%}
{%- set widget_disabled_class = widget_disabled_class|default('my disabled widget classes') -%}
{%- set widget_errors_class = widget_errors_class|default('my widget with error classes') -%}
{{- parent() -}}
{%- endblock widget_attributes -%}
{%- block form_label -%}
{%- set label_class = label_class|default('my label classes') -%}
{{- parent() -}}
{%- endblock form_label -%}
{%- block form_help -%}
{%- set help_class = help_class|default('my label classes') -%}
{{- parent() -}}
{%- endblock form_help -%}
{%- block form_errors -%}
{%- set error_item_class = error_item_class|default('my error item classes') -%}
{{- parent() -}}
{%- endblock form_errors -%}
```
#### Customization POC/Demo
With this custom form theme:
```twig
{%- block form_label -%}
{%- set label_class = label_class|default('block text-gray-500 uppercase tracking-wider text-sm font-bold') -%}
{{- parent() -}}
{%- endblock -%}
{%- block widget_attributes -%}
{%- set widget_class = widget_class|default('mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50') -%}
{{- parent() -}}
{%- endblock -%}
{%- block checkbox_widget -%}
{%- set widget_class = widget_class|default('mr-2 rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-offset-0 focus:ring-indigo-200 focus:ring-opacity-50') -%}
{{- parent() -}}
{%- endblock -%}
{%- block checkbox_label -%}
{%- set label_class = label_class|default('block text-gray-800') -%}
{{- block('form_label') -}}
{%- endblock -%}
```
The above example looks like this:
![New-Post (3)](https://user-images.githubusercontent.com/127811/112705040-657ce800-8e73-11eb-965f-de289e9b978a.png)
Commits
-------
3719a409b6 [TwigBridge] add tailwindcss form layout
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
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
Uses the correct assignment action for console options depending if they are short or long
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40590
| License | MIT
| Doc PR | -
Checks if the option is short or long, and assigns the corresponding "glue" for the assignment.
Commits
-------
d0a3c538f4 Uses the correct assignment action for console options depending if they are short or long
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
This PR was merged into the 5.3-dev branch.
Discussion
----------
[PasswordHasher] The $algorithms array is only used when $algorithm is set
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Small tweak
Commits
-------
0144d0a151 The $algorithms array is only used when $algorithm is set
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
This PR was merged into the 5.3-dev branch.
Discussion
----------
[HttpFoundation] Add support for mysql unix_socket and charset in PdoSessionHandler::buildDsnFromUrl
| 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 https://github.com/symfony/symfony/issues/40290
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Commits
-------
f4e50fb1c7 [HttpFoundation] Add support for mysql unix_socket and charset in PdoSessionHandler::buildDsnFromUrl
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
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