Commit Graph

43253 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
Jesse Rushlow
97ceba0f5d
improve dx and document auth exception 2021-04-01 11:29:25 -04: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
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
Christian Flothmann
3de5b38cea fix test 2021-04-01 12:10:12 +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
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
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
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
ba6698795c [Cache] skip storing failure-to-save as misses in ArrayAdapter 2021-03-31 17:30:10 +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
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
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
Thomas Calvet
2876cf9cc6 [DependencyInjection] Fix "url" env var processor behavior when the url has no path 2021-03-29 15:11:05 +02:00
Nyholm
68276562c3
Fixed support for nodes not extending BaseNode 2021-03-29 12:55:05 +02:00
Nicolas Grekas
8aa6818322 [FrameworkBundle] dont access the container to configure http_cache 2021-03-29 10:37:12 +02:00
Fabien Potencier
d6020a95f5 Bump Symfony version to 5.2.7 2021-03-29 07:20:15 +02:00
Fabien Potencier
4217e4c4cc Update VERSION for 5.2.6 2021-03-29 07:16:58 +02:00