Commit Graph

44241 Commits

Author SHA1 Message Date
Nicolas Grekas
5c660f7554 Merge branch '5.2' into 5.x
* 5.2:
  [HttpKernel] Minor fixes and tweaks in the Symfony Welcome Page
  Revert "minor #40768 [HttpClient] [PHPDoc] Fix 2 remaining return mixed (fancyweb)"
2021-04-12 10:56:19 +02:00
Nicolas Grekas
c3b4e81c23 Merge branch '4.4' into 5.2
* 4.4:
  [HttpKernel] Minor fixes and tweaks in the Symfony Welcome Page
  Revert "minor #40768 [HttpClient] [PHPDoc] Fix 2 remaining return mixed (fancyweb)"
2021-04-12 10:50:37 +02:00
Nicolas Grekas
e05b4efec2 minor #40777 [HttpKernel] Minor fixes and tweaks in the Symfony Welcome Page (javiereguiluz)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Minor fixes and tweaks in the Symfony Welcome Page

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

The current "Welcome Page" has a minor issue related to CSS flexbox. See how the "debug mode" text looks in smaller screens:

![before](https://user-images.githubusercontent.com/73419/114359439-4620d300-9b74-11eb-85c6-ee7afdb937df.png)

The solution is to wrap the contents in a HTML element such as `<p>`, but this PR also does some other minor tweaks. This is how it'd look now:

![after](https://user-images.githubusercontent.com/73419/114359535-5cc72a00-9b74-11eb-86c4-07fba89b8e8f.png)

Commits
-------

ee49cfe2b9 [HttpKernel] Minor fixes and tweaks in the Symfony Welcome Page
2021-04-12 10:48:29 +02:00
Javier Eguiluz
ee49cfe2b9 [HttpKernel] Minor fixes and tweaks in the Symfony Welcome Page 2021-04-12 10:48:24 +02:00
Nicolas Grekas
99e77492f2 [DependencyInjection] improve phpdoc for registerAttributeForAutoconfiguration() 2021-04-12 09:43:00 +02:00
Nicolas Grekas
afea0a0dc2 Revert "minor #40768 [HttpClient] [PHPDoc] Fix 2 remaining return mixed (fancyweb)"
This reverts commit 40d7315202, reversing
changes made to 4e904ec108.
2021-04-12 08:52:04 +02:00
Alexander M. Turek
364742f18c Merge branch '5.2' into 5.x
* 5.2:
  [HttpClient][PHPDoc] Fix 2 remaining return mixed
  [Cache] [FrameworkBundle] Fix logging for TagAwareAdapter
  [Route] Better inline requirements and defaults parsing
  Simplified condition and removed unused code from AbstractSessionListener::onKernelRequest
  [PhpUnitBridge] Fix phpunit symlink on Windows
  [Yaml] Fixed infinite loop when parser goes through an additional and invalid closing tag
  [Form] Fix 'invalid_message' use in multiple ChoiceType
2021-04-12 01:07:08 +02:00
Alexander M. Turek
86c9c3b0f8 Merge branch '4.4' into 5.2
* 4.4:
  [HttpClient][PHPDoc] Fix 2 remaining return mixed
  [Cache] [FrameworkBundle] Fix logging for TagAwareAdapter
  [Route] Better inline requirements and defaults parsing
  Simplified condition and removed unused code from AbstractSessionListener::onKernelRequest
  [PhpUnitBridge] Fix phpunit symlink on Windows
  [Yaml] Fixed infinite loop when parser goes through an additional and invalid closing tag
2021-04-12 00:55:21 +02:00
Nicolas Grekas
91fbc90238 Autowire arguments using attributes 2021-04-11 23:05:41 +02:00
Alexander M. Turek
b86aa3d068 [DependencyInjection] Bind constructor arguments via attributes 2021-04-11 23:04:00 +02:00
Wouter de Jong
e4cedfa21a [TwigBundle] Require TwigBridge 5.3 for SerializerExtension 2021-04-11 22:22:16 +02:00
Nicolas Grekas
cb0b07e8c1 feature #40682 [DependencyInjection] Add env() and EnvConfigurator in the PHP-DSL (fancyweb)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] Add env() and EnvConfigurator in the PHP-DSL

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

Recently, I have been using env var processors a lot. This is a proposition to improve the DX a bit when you use the PHP-DSL to configure services.

Firstly, I am "annoyed" by the fact that I can do `param('my_param')` but not `env('MY_ENV')`.

Secondly, long chains of env var processors (eg: `%env(default:my_param:key:path:url:MY_ENV_VAR)` have two issues:
- you must construct and read them in "reverse"
- some env var processor are actually composed of 2 parts (key:path), you don't distinguish them easily from the rest

Before:
```php
->arg('$myArg', '%env(default:my_param:key:path:url:MY_ENV_VAR)%')
```

After:
```php
->arg(
    '$myArg',
    env('MY_ENV_VAR')
        ->url()
        ->key('path')
        ->default('my_param')
)
```

Custom env var processor would be callable with `->custom('my_custom_env_var_processor')` or you could extend the configurator and add your own methods.

WDYT?

Commits
-------

5f0fe3235f [DependencyInjection] Add env() and EnvConfigurator in the PHP-DSL
2021-04-11 19:27:24 +02:00
Nicolas Grekas
40d7315202 minor #40768 [HttpClient] [PHPDoc] Fix 2 remaining return mixed (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] [PHPDoc] Fix 2 remaining return mixed

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

Two cases I forgot in https://github.com/symfony/symfony/pull/40728 😕

Commits
-------

97a43e1dab [HttpClient][PHPDoc] Fix 2 remaining return mixed
2021-04-11 19:25:56 +02:00
Thomas Calvet
97a43e1dab [HttpClient][PHPDoc] Fix 2 remaining return mixed 2021-04-11 19:17:27 +02:00
Thomas Calvet
6b0beca36f [Cache] [FrameworkBundle] Fix logging for TagAwareAdapter 2021-04-11 19:05:34 +02:00
Foxprodev
2a8c94a871 [Route] Better inline requirements and defaults parsing
Remove ! symbol from requirements and defaults array keys in Route class. Leave ! symbol in Route compiled path for correct token creation
Added some inline route settings tests
2021-04-11 14:59:39 +02:00
Nicolas Grekas
4a8ea4094f bug #40754 [PhpUnitBridge] Fix phpunit symlink on Windows (johnstevenson)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Fix phpunit symlink on Windows

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

If the symlink to `.phpunit/phpunit` already exists, unlink is called to remove it. But this fails on Windows (because it is a directory and requires `rmdir`), which in turn causes the subsequent `symlink` call to fail (because it already exists).

Additionally, creating symlinks on Windows requires Administrator permissions (generally), so `.phpunit/phpunit` can never be created for ordinary Users.

This PR uses a junction instead of a symlink on Windows. It also fixes some issues with stderror output and adds some argument escaping.

Commits
-------

ff8093246b [PhpUnitBridge] Fix phpunit symlink on Windows
2021-04-11 14:54:19 +02:00
StefanoCappellini
d344b8d6cb Simplified condition and removed unused code from AbstractSessionListener::onKernelRequest 2021-04-11 14:47:37 +02:00
Robin Chalas
b40eac2e78 feature #40145 [Security] Rework the remember me system (wouterj)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Security] Rework the remember me system

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fixes part of #39308
| License       | MIT
| Doc PR        | tbd

As I said in #39308, I want to change the remember me system in Symfony 5.3. The remember me system has a couple big "problems":

1. **It's hardwired into some Security classes** like `ContextListener`. The `RememberMeFactory` adds a `setRememberMe()` method call to the DI config and the context listener calls methods on this. This is very coupled, instead of the decoupled nature of the rest of security.
2. **Conditional conditions are combined with cookie creation in one class**. This is especially hard in e.g. 2FA (where setting the cookie should be done after 2FA is completed, which is currently near impossible as it's directly bound to the conditional of being called after logging in).

The changes
---

* The first commits harden the current functional test suite of remember me, to avoid breaking it.
* I discovered a lot of similarity between remember me tokens and login links. That's why I've extracted the shared logic into a generic `SignatureHasher` in the 3rd commit.
* I then remodelled `RememberMeAuthenticator` to the login link system, which I think improves a lot and at least improves problem (2) - as the conditionals (`RememberMeAuthenticator`) is split from the cookie creation (`RememberMeHandlerInterface`).
* Finally, I added a new event (`TokenDeauthenticatedEvent`) to the `ContextListener` to avoid direct coupling - solving problem (1).

This removes any usage of remember me services, which can be deprecated along with the rest of the security system.

Usage
---

As with the authenticator manager: **Nothing changes in the configuration**

Usage of persistent token providers has been improved. First, configuration is provided (setting up services is no longer needed):
```yaml
# before
services:
    Symfony\Bridge\Doctrine\Security\RememberMe\DoctrineTokenProvider:
        autowire: true

security:
    firewalls:
        main:
            remember_me:
                # ...
                token_provider: 'Symfony\Bridge\Doctrine\Security\RememberMe\DoctrineTokenProvider'

# after
security:
    firewalls:
        main:
            remember_me:
                # ...
                token_provider:
                    doctrine: true
```

Furthermore, a schema listener is created. Whenever the doctrine token provider is used, `make:migration`/`doctrine:schema:update` will automatically create the required table.

Some advanced usage of Remember me is also improved a lot (there is no real "before" here, consider looking at scheb/2fa to get an idea of the before). A few use-cases I took into account:

* If you ever need to **programmatically create a remember me cookie**, you can autowire `RememberMeHandlerInterface` and use `createRememberMeCookie($user)`. This will make sure the remember me cookie is set on the final response (using the `ResponseListener`)
* The `RememberMeListener` previously was responsible for both determining if a cookie must be set and setting the cookie. This is now split in 2 listeners (checking is done by `RememberMeConditionsListener`). If `RememberMeBadge` is enabled, the cookie is set and otherwise it isn't. This allows e.g. SchebTwoFactorBundle to create a listener that catches whether remember me was requested, but suppress it until the 2nd factor is completed.

Todo
---

* [x] Update UPGRADE and CHANGELOG
* [x] Show before/after examples
* [x] Investigate the conditional event registering of `ContextListener`. This forces to inject both the firewall and the global event dispatcher at the moment.
* Make sure old remember me tokens still function. As remember me tokens are long lived, we may need to provide backwards compatibility for at least Symfony 6.x. **Update: it was decided to not include this for now: https://github.com/symfony/symfony/pull/40145#issuecomment-785819607**

cc `@scheb` `@weaverryan` as you both initiated this PR by sharing the problems with the current design.

Commits
-------

15670419d4 [Security] Rework the remember me system
2021-04-11 14:47:25 +02:00
Wouter de Jong
15670419d4 [Security] Rework the remember me system 2021-04-11 14:47:19 +02:00
Nyholm
d37f158a88
[Notifier][Bridge] Remove hidden dependency on HttpFoundation 2021-04-11 10:41:01 +02:00
Pavel Kirpitsov
5fa7ff9541 [Messenger] Added X-Ray trace header support to the SQS transport 2021-04-10 00:55:17 +03:00
John Stevenson
ff8093246b [PhpUnitBridge] Fix phpunit symlink on Windows 2021-04-09 15:31:01 +01:00
Fabien Potencier
0f96ac7484 feature #40695 [Console] Deprecate Helper::strlen() for width() and length() (Nyholm)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Console] Deprecate Helper::strlen() for width() and length()

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | yes
| Deprecations? | yes
| Tickets       | Follow up form #40698
| License       | MIT
| Doc PR        |

This PR will deprecated `Helper::strlen()` since it is actually calculating the width. I remove the `@internal` on `Helper::width()` and a `Helper::length()`. I will also deprecate `Helper::strlenWithoutDecoration()` because you should use `Helper::removeDecoration()` instead.

Commits
-------

3c24aa9d47 [Console] Deprecate Helper::strlen() for width() and length()
2021-04-09 11:54:19 +02:00
Nyholm
3c24aa9d47 [Console] Deprecate Helper::strlen() for width() and length() 2021-04-09 11:54:15 +02:00
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
Nyholm
ed576b2554
bug #40707 [Yaml] Fixed infinite loop when parser goes through an additional and invalid closing tag (alexandre-daubois)
This PR was merged into the 4.4 branch.

Discussion
----------

[Yaml] Fixed infinite loop when parser goes through an additional and invalid closing tag

| Q             | A
| ------------- | ---
| Branch?       | 4.4 and above
| 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 #40706 <!-- 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 -->

Instead of letting the parser goes in an infinite loop because it can't get the right closing tag, throw an exception when the additional and invalid closing tag is found

Commits
-------

d5f8c887a2 [Yaml] Fixed infinite loop when parser goes through an additional and invalid closing tag
2021-04-09 10:22:27 +02:00
Nyholm
1d8ad1d2ce
minor #40735 [Notifier] LightSMS duplicated $errorCode variable fix (StaffNowa)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Notifier] LightSMS duplicated $errorCode variable fix

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

Removed duplicated variable $errorCode.

Many thanks for:
@OskarStark, @jderusse and special thanks for @chalasr for fast rebase course at night :)))

Commits
-------

867769ede4 [Notifier] LightSMS duplicated $errorCode variable fix
2021-04-08 15:38:09 +02:00
Vasilij Dusko
867769ede4
[Notifier] LightSMS duplicated $errorCode variable fix 2021-04-08 15:38:03 +02:00
Oskar Stark
ddb48bb391 minor #40737 [Notifier] Added missing changelog (Nyholm)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Added missing changelog

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

I found this to be missing

Commits
-------

41198cccb5 [Notifier] Added missing changelog
2021-04-08 12:43:56 +02:00
Alexandre Daubois
7888f8930d [Security] Fixed missing badges argument for method authenticateUser 2021-04-08 12:34:40 +02:00
Robin Chalas
251ce63347 Merge branch '5.2' into 5.x
* 5.2:
  [PHPDoc] Fix some union type cases
2021-04-08 12:31:48 +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
41198cccb5
[Notifier] Added missing changelog 2021-04-08 11:51:11 +02:00
Fabien Potencier
491265f1fa bug #40736 [Notifier] Fix LightSms package name (fabpot)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Fix LightSms package name

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

As the namespace is LightSms and not Lightsms.

Commits
-------

2d80665a4a [Notifier] Fix LightSms package name
2021-04-08 11:46:46 +02:00
Nyholm
3977d7a634
feature #40486 [Security] Add concept of required passport badges (wouterj)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Security] Add concept of required passport badges

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

A badge on a passport is a critical security element, it determines which security checks are run during authentication. Using the `required_badges` setting, applications can make sure the expected security checks are run.

Commits
-------

01c3bf9604 [Security] Add concept of required passport badges
2021-04-08 11:39:40 +02:00
Fabien Potencier
2d80665a4a [Notifier] Fix LightSms package name 2021-04-08 11:36:44 +02:00
idetox
013d56d489 [Notifier] Add notifier for Microsoft Teams 2021-04-08 09:54:58 +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
30b73c7575 feature #40710 [Serializer] Construct annotations using named arguments (derrabus)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Serializer] Construct annotations using named arguments

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

This is the same as #40266, but applied to the serializer annotations.

This PR proposes to bump the `doctrine/annotations` library to 1.12 to gain access to its emulation layer for named arguments. Furthermore, constructing any of the serializer's annotation classes the old way by passing an array of parameters is deprecated.

### Reasons for this change

The constructors of our annotation classes have become unnecessarily complicated because we have to support two ways of calling them:
* An array of parameters, passed as first argument, because that's the default behavior `doctrine/annotations`.
* A set of named arguments because that's how PHP 8 attributes work.

Since we can now tell the Doctrine annotation reader to use named arguments as well, we can simplify the constructors of our annotations significantly.

### Drawback

After this change, there is no easy way anymore to construct instances of most of the annotation classes directly on PHP 7. The PR has been built under the assumption that instances of this class are usually created using either Doctrine annotations or a PHP 8 attribute. Thus, most applications should be unaffected by this change.

Commits
-------

c11666264d [Serializer] Construct annotations using named arguments
2021-04-08 08:57:14 +02:00
Fabien Potencier
8fc4c1bf3b Merge branch '5.2' into 5.x
* 5.2:
  Add test.
  [Console] Add Helper::strwidth() and Helper::strlength()
  Update README.md
2021-04-08 08:54:07 +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
Fabien Potencier
9966e980e6 minor #40730 [Notifier] [CS] [5.x] Replace easy occurrences of ?: with ?? (fancyweb)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] [CS] [5.x] Replace easy occurrences of ?: with ??

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

https://github.com/symfony/symfony/pull/40729 on 5.x

Commits
-------

726075c177 [CS] [5.x] Replace easy occurrences of ?: with ??
2021-04-08 08:36:31 +02:00
Vasilij Dusko
0b1a450194 * LightSmsTransport.php 2021-04-08 01:08:46 +03:00
Thomas Calvet
726075c177 [CS] [5.x] Replace easy occurrences of ?: with ?? 2021-04-07 18:47:35 +02:00
Alexander M. Turek
fe9b188e28 Merge branch '5.2' into 5.x
* 5.2:
  [CS] [5.2] Replace easy occurrences of ?: with ??
2021-04-07 18:44:23 +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
855aab243d Merge branch '5.2' into 5.x
* 5.2:
  [CS] Replace easy occurences of ?: with ??
2021-04-07 18:09:00 +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
47f3c4e52d Merge branch '5.2' into 5.x
* 5.2:
  Avoid warning with Xdebug 3 with develop mode disabled
2021-04-07 17:57:56 +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
Oskar Stark
0cc982c251 minor #40712 [Notifier]  Simplify LightSms implementation (jderusse)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier]  Simplify LightSms implementation

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

/cc @OskarStark

Commits
-------

1240e9f551 [notifier] Simplify lightsms implementation
2021-04-07 08:36:17 +02:00
Kévin Dunglas
eaae4500f4
[FrameworkBundle] Fix fragment.uri_generator definition 2021-04-06 16:17:34 +02:00
Jérémy Derussé
1240e9f551
[notifier] Simplify lightsms implementation 2021-04-06 14:01:04 +02:00
Thomas Calvet
5f0fe3235f [DependencyInjection] Add env() and EnvConfigurator in the PHP-DSL 2021-04-06 13:54:30 +02:00
Oskar Stark
0ce156c484 [Notifier] [FakeChat] Added the bridge 2021-04-06 12:38:02 +02:00
Oskar Stark
71a407da29 feature #40607 [Notifier] Add LightSms notifier bridge (Vasilij Dusko, StaffNowa)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Add LightSms notifier bridge

| 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 -->
| License       | MIT
| Doc PR        | symfony/symfony-docs/pull/15178
| Recipe PR | https://github.com/symfony/recipes/pull/921

LightSms notifier https://github.com/D4DLab/lightsms-notifier

Commits
-------

37c665eb5c * LightSmsTransport.php - make fabbot happy
68a12fa4f4 * fix tests
f1f83b9e5c * LightSmsTransport.php - use query string parameters
026dcd97a9 * LightSmsTransport.php - isset
2a9ac2d92a * LightSmsTransport.php - fix
4213564be1 * composer.json - fix Fabien comment from another pull request #40646
21e972a69e * coding standard
bea5256cc2 * type cast. On success lightsms return error code like string. On error return integer.
9b2e2d0b4a * type cast. On success lightsms return error code like string. On error return integer.
0d7488b10a * type cast. On success lightsms return error code like string. On error return integer.
9a832ef595 * LightSmsTransport.php - via mistake removed www which return (Closing direction to the user). Removed additional isset which in reality not needed. Added new method which allow to return "unknown error" and throw exception if not successfully
178d9c2a5a * pull request #40696
95e82f6ef1 Update LightSmsTransport.php
a197deeed1 * LightSmsTransport.php - better to remove if we do not have it?
83d259832b * Coding Standard patch
1ff97e410a * LightSmsTransport.php - build signature and use http_build_query, timestamp int
1c993b7224 * ERROR_CODES -> int * www. - bug * isset validate ['error']
1b59a7d47e * LightSmsTransport.php - string param
58ac708d0f * LightSmsTransport.php - return back www (without will not work). Now fail tests
b9f9ff8c94 * LightSmsTransport.php - tests fail
265f776394 * LightSmsTransport.php - issue with Symfony\Component\Notifier\Bridge\LightSms\Tests\LightSmsTransportTest
23a446a2e1 * LightSmsTransport.php - issue with Symfony\Component\Notifier\Bridge\LightSms\Tests\LightSmsTransportTest
08235e5a3c * LightSmsTransport.php - bug fix
80ef5ba565 * LightSmsTransport.php - Unable to send the SMS: Closing direction to the user
08b0729751 Update LightSmsTransport.php
7180c1f400 Update LightSmsTransport.php
f16b4d2aa2 * phone changed to from
7f13dbf711 * sender changed to from
e20ef1ed35 * LightSmsTransport.php - change + to 00
b0e64b9250 * LightSmsTransport.php - not ok throw exception
fc13bb27e2 * LightSmsTransport.php - changed login for validation (the same like we have all places)
5d2e6928f3 * LightSmsTransport.php - escape phone number
8620e828a7 * LightSmsTransport.php - move timestamp
66c34baf03 Update README.md
2e0e1d733d Update README.md
7b51e0dd7f Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
079406ed3d Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
0e41bc9186 Update src/Symfony/Component/Notifier/Bridge/LightSms/Tests/LightSmsTransportFactoryTest.php
3d0d79cfe2 Update src/Symfony/Component/Notifier/Bridge/LightSms/Tests/LightSmsTransportFactoryTest.php
e0a68bd0ac Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
1b073c2366 Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
b0891be0b2 Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
49b4780f40 Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
b2e46387b7 Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
c02dbbd963 Update src/Symfony/Component/Notifier/Bridge/LightSms/README.md
9f89014d94 Update src/Symfony/Component/Notifier/Bridge/LightSms/README.md
5e54dfe475 * LightSmsTransport.php - quick fix for private constant.
3cbbc85e43 * HOST split into two parts
9e1809e6ae * small changes
febff4613d Update src/Symfony/Component/Notifier/Bridge/LightSms/LICENSE
4a11b945a3 * github account author
728a3e2450 * Transport.php - missing use
ce41756a6c * notifier_transports.php - Coding Standard
d1ccd46e75 * Attached file changes which are required to run the lightsms notifier
a0fae7dc4a * tests
15686c0851 * LightSmsTransport.php - Coding Standard
2f65b92cba * LightSmsTransport.php - Coding Standard
6792535a52 * composer.json - requirements bug fix
167f325f40 * LightSmsTransport.php - logic error
be8f994fca * LightSmsTransport.php - return type
f2ba226b46 * LightSmsTransport.php - bug fix
b075c0eae2 * LightSms notifier
2021-04-06 12:32:50 +02:00
Robin Chalas
de143497ff minor #40671 [Notifier] Mercure bridge: bump mercure dependency to 0.5 (azjezz, mtarld)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Mercure bridge: bump mercure dependency to 0.5

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/15179

Bump Mercure bridge's `symfony/mercure` dependency to 0.5 to deal with hubs instead of publishers.

---
To be able to use `HandlerRegistry::all` method, this PR needs https://github.com/symfony/mercure/pull/50 to be merged and released.

Commits
-------

498f96f1a8 Drop support of mercure:^0.4
d3306fdc92 add support for symfony/mercure:^0.5
2021-04-06 12:24:06 +02:00
Vasilij Dusko | CREATION
37c665eb5c * LightSmsTransport.php - make fabbot happy 2021-04-06 13:22:50 +03:00
Vasilij Dusko | CREATION
68a12fa4f4 * fix tests 2021-04-06 13:18:17 +03:00
Vasilij Dusko | CREATION
f1f83b9e5c * LightSmsTransport.php - use query string parameters 2021-04-06 13:12:05 +03:00
Vasilij Dusko | CREATION
026dcd97a9 * LightSmsTransport.php - isset 2021-04-06 13:09:30 +03:00
Vasilij Dusko | CREATION
2a9ac2d92a * LightSmsTransport.php - fix 2021-04-06 13:06:59 +03:00
Mathias Arlaud
498f96f1a8 Drop support of mercure:^0.4 2021-04-06 11:32:33 +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
Alexander M. Turek
c11666264d [Serializer] Construct annotations using named arguments 2021-04-05 19:03:11 +02:00
Alexander M. Turek
3ca3de50c3 Merge branch '5.2' into 5.x
* 5.2:
  improve dx and document auth exception
2021-04-05 17:16:47 +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
Vasilij Dusko
4213564be1 * composer.json - fix Fabien comment from another pull request #40646 2021-04-05 15:00:41 +03:00
Alexandre Daubois
d5f8c887a2 [Yaml] Fixed infinite loop when parser goes through an additional and invalid closing tag
Instead of letting the parser goes in an infinite loop, throw an exception when the additional and invalid is found
2021-04-05 12:16:45 +02:00
Wouter de Jong
01c3bf9604 [Security] Add concept of required passport badges
A badge on a passport is a critical security element, it determines which
security checks are run during authentication. Using the `required_badges`
setting, applications can make sure the expected security checks are run.
2021-04-05 11:07:23 +02:00
Oskar Stark
712100924d minor #40696 [Mailer][Notifier] added missing gitattributes and gitignore (iamvar)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Mailer][Notifier] added missing gitattributes and gitignore

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

just added missing .gitattributes and .gitignore to be consistent with other components

Commits
-------

00ac6d4b45 added missing gitattributes and gitignore
2021-04-04 17:37:30 +02:00
Alexander M. Turek
51c0c5a1bf Merge branch '5.2' into 5.x
* 5.2:
  added missing gitattributes and gitignore
  allow CurlHttpClient on Windows
  [Security] Mark ExpiredLoginLinkStorage as experimental
  remove references to "Silex"
2021-04-04 14:44:25 +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
Vasilij Dusko
21e972a69e * coding standard 2021-04-04 10:54:22 +03:00
Vasilij Dusko
bea5256cc2 * type cast. On success lightsms return error code like string. On error return integer. 2021-04-04 10:53:00 +03:00
Vasilij Dusko
9b2e2d0b4a * type cast. On success lightsms return error code like string. On error return integer. 2021-04-04 10:52:47 +03:00
Vasilij Dusko
0d7488b10a * type cast. On success lightsms return error code like string. On error return integer. 2021-04-04 10:51:01 +03:00
Vasilij Dusko
9a832ef595 * LightSmsTransport.php - via mistake removed www which return (Closing direction to the user). Removed additional isset which in reality not needed. Added new method which allow to return "unknown error" and throw exception if not successfully 2021-04-04 10:48:58 +03:00
Vasilij Dusko
178d9c2a5a * pull request #40696 2021-04-04 10:26:24 +03: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
iamvar
00ac6d4b45 added missing gitattributes and gitignore 2021-04-03 14:22:18 +03: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
Fabien Potencier
bb1e1e58ae bug #40641 LoginLink create get Request Locale (roromix)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

LoginLink create get Request Locale

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

While writing the documentation for PR#40153 I noticed that the RequestContext :: fromRequest method does not add the '_locale' parameter automaticaly. This new pull request to set _locale parameter to the RequestContext.

Commits
-------

433d76bfe1 LoginLink create get Request Locale
2021-04-02 08:14:28 +02:00
roromix
433d76bfe1 LoginLink create get Request Locale 2021-04-02 08:14:21 +02:00
Vasilij Duško
95e82f6ef1
Update LightSmsTransport.php
remove dump die
2021-04-02 06:31:20 +03:00
Alexander M. Turek
28ac2c7f56 Remove unused import 2021-04-01 20:14:42 +02:00
Jesse Rushlow
97ceba0f5d
improve dx and document auth exception 2021-04-01 11:29:25 -04:00
Vasilij Dusko | CREATION
a197deeed1 * LightSmsTransport.php - better to remove if we do not have it? 2021-04-01 13:58:54 +03:00
Nicolas Grekas
3f0f21c361 Merge branch '5.2' into 5.x
* 5.2:
  fixed parser
  Fixed bugs found by psalm
  [FrameworkBundle] Dont store cache misses on warmup
  fix test
  Update references to the ContainerConfigurator
  [Translation] Remove file added back from a bad merge
  Fix sleep value
  [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
  [Stopwatch] Document new "name" property of StopwatchEvent
  [DependencyInjection] Fix "url" env var processor behavior when the url has no path
  Fixed support for nodes not extending BaseNode
  [FrameworkBundle] dont access the container to configure http_cache
  add missing queue_name to find(id) in doctrine messenger transport
  [Config][FrameworkBundle] Hint to use PHP 8+ or to install Annotations to use attributes/annots
  [Serializer] AbstractNormalizer force null for non-optional nullable constructor parameter denormalization when not present in input
2021-04-01 12:43:52 +02: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
Vasilij Dusko | CREATION
83d259832b * Coding Standard patch 2021-04-01 13:35:26 +03:00
Vasilij Dusko | CREATION
1ff97e410a * LightSmsTransport.php - build signature and use http_build_query, timestamp int 2021-04-01 13:33:34 +03: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
Nicolas Grekas
993f8093db minor #40669 [Notifier] [FakeSms] Add missing LICENSE and .gitattributes file (OskarStark)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] [FakeSms] Add missing LICENSE and .gitattributes file

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? |  no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       |  | License       | MIT
| Doc PR        |

cc @nicolas-grekas

Commits
-------

4704f4ef1f [Notifier] [FakeSms] Add missing LICENSE and .gitattributes file
2021-04-01 12:14:44 +02:00
Vasilij Dusko | CREATION
1c993b7224 * ERROR_CODES -> int
* www. - bug
* isset validate ['error']
2021-04-01 13:12:34 +03:00
Christian Flothmann
3de5b38cea fix test 2021-04-01 12:10:12 +02:00
Nyholm
095f382a44
minor #40604 Improve ExtractorInterface phpdoc (VincentLanglet)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

Improve ExtractorInterface phpdoc

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- 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
-->

I think this phpdoc can be improved

Commits
-------

255b608d6d Improve ExtractorInterface phpdoc
2021-04-01 12:02:30 +02:00
Vincent Langlet
255b608d6d
Improve ExtractorInterface phpdoc 2021-04-01 12:02:24 +02:00
Oskar Stark
4704f4ef1f [Notifier] [FakeSms] Add missing LICENSE and .gitattributes file 2021-04-01 11:58:08 +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
6f4b0a3715 bug #40667 [Messenger] fix deprecation layer in AbstractFailedMessagesCommand (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Messenger] fix deprecation layer in AbstractFailedMessagesCommand

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

Added in #38468, spotted in #40643

Commits
-------

079cb31b7e [Messenger] fix deprecation layer in AbstractFailedMessagesCommand
2021-04-01 10:44:28 +02:00
Nicolas Grekas
079cb31b7e [Messenger] fix deprecation layer in AbstractFailedMessagesCommand 2021-04-01 10:27:23 +02:00
Nicolas Grekas
11db9cd250 minor #40643 Use symfony/deprecation-contracts instead of trigger_error (andrew-demb)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Use symfony/deprecation-contracts instead of trigger_error

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | - <!-- 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 -->

As `symfony/deprecation-contracts` added to requirements with PR #40468, we can update `trigger_error` call in favor reusing deprecation abstractions

Commits
-------

1acc296773 Use symfony/deprecation-contracts instead of trigger_error
2021-04-01 10:19:34 +02:00
Andrii Dembitskyi
1acc296773 Use symfony/deprecation-contracts instead of trigger_error 2021-04-01 10:19:26 +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
Vasilij Dusko | CREATION
1b59a7d47e * LightSmsTransport.php - string param 2021-04-01 08:41:55 +03: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
f963ae476a
minor #40657 [Notifier] add missing LICENSE file for SpotHit (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] add missing LICENSE file for SpotHit

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

Commits
-------

f4c28cbfc5 [Notifier] add missing LICENSE file for SpotHit
2021-03-31 21:48:03 +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
f4c28cbfc5 [Notifier] add missing LICENSE file for SpotHit 2021-03-31 18:35:27 +02:00
Nicolas Grekas
ba6698795c [Cache] skip storing failure-to-save as misses in ArrayAdapter 2021-03-31 17:30:10 +02:00
Fabien Potencier
f6159038ed feature #40576 [Mime] Remove @internal from Headers methods (VincentLanglet)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Mime] Remove @internal from Headers methods

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- 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
-->

I don't understand why the methods
- `Headers::getHeaderBody()`
- `Headers::setHeaderBody()`
- `Headers::getHeaderParameter()`
- `Headers::setHeaderParameter()`
are marked as internal.

They are already used by others libraries, like
a6c3fa9aea/Transport/MandrillApiTransport.php (L92)
a6c3fa9aea/Transport/MandrillApiTransport.php (L99)

The implementation shouldn't change so they could be under the BC promise.
Plus they are useful, and I don't see any other way that reimplementing the method if we want to do something like
```
->getHeaderParameter('Content-Disposition', 'name')
```

Commits
-------

592fb13456 Remove internal annotation
2021-03-31 13:46:29 +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
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
Vasilij Dusko | CREATION
58ac708d0f * LightSmsTransport.php - return back www (without will not work). Now fail tests 2021-03-30 13:18:00 +03:00
Vasilij Dusko | CREATION
b9f9ff8c94 * LightSmsTransport.php - tests fail 2021-03-30 09:17:45 +03:00
Vasilij Dusko | CREATION
265f776394 * LightSmsTransport.php - issue with Symfony\Component\Notifier\Bridge\LightSms\Tests\LightSmsTransportTest 2021-03-30 09:15:57 +03:00
Vasilij Dusko | CREATION
23a446a2e1 * LightSmsTransport.php - issue with Symfony\Component\Notifier\Bridge\LightSms\Tests\LightSmsTransportTest 2021-03-30 09:14:59 +03:00
Vasilij Dusko | CREATION
08235e5a3c * LightSmsTransport.php - bug fix 2021-03-30 08:09:56 +03:00
Vasilij Dusko | CREATION
80ef5ba565 * LightSmsTransport.php - Unable to send the SMS: Closing direction to the user 2021-03-30 08:07:02 +03: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
Vasilij Duško
08b0729751
Update LightSmsTransport.php 2021-03-29 19:37:44 +03:00
Vasilij Duško
7180c1f400
Update LightSmsTransport.php 2021-03-29 19:26:20 +03: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
Vasilij Dusko | CREATION
f16b4d2aa2 * phone changed to from 2021-03-29 17:52:20 +03:00
Vasilij Dusko | CREATION
7f13dbf711 * sender changed to from 2021-03-29 17:49:52 +03: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
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
Vasilij Dusko | CREATION
e20ef1ed35 * LightSmsTransport.php - change + to 00 2021-03-29 14:16:34 +03:00
Nyholm
68276562c3
Fixed support for nodes not extending BaseNode 2021-03-29 12:55:05 +02:00
Vasilij Dusko | CREATION
b0e64b9250 * LightSmsTransport.php - not ok throw exception 2021-03-29 13:51:17 +03:00
Vasilij Dusko | CREATION
fc13bb27e2 * LightSmsTransport.php - changed login for validation (the same like we have all places) 2021-03-29 13:34:15 +03:00
Vasilij Dusko | CREATION
5d2e6928f3 * LightSmsTransport.php - escape phone number 2021-03-29 13:29:53 +03:00
Vasilij Dusko | CREATION
8620e828a7 * LightSmsTransport.php - move timestamp 2021-03-29 13:14:06 +03:00
Nicolas Grekas
8aa6818322 [FrameworkBundle] dont access the container to configure http_cache 2021-03-29 10:37:12 +02:00
Vasilij Duško
66c34baf03 Update README.md 2021-03-29 08:45:01 +03:00
Vasilij Duško
2e0e1d733d Update README.md 2021-03-29 08:45:01 +03:00
Vasilij Duško
7b51e0dd7f Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
Co-authored-by: Thibault RICHARD <thibault@widop.com>
2021-03-29 08:45:01 +03:00
Vasilij Duško
079406ed3d Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
Co-authored-by: Thibault RICHARD <thibault@widop.com>
2021-03-29 08:45:01 +03:00
Vasilij Duško
0e41bc9186 Update src/Symfony/Component/Notifier/Bridge/LightSms/Tests/LightSmsTransportFactoryTest.php
Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
2021-03-29 08:45:01 +03:00
Vasilij Duško
3d0d79cfe2 Update src/Symfony/Component/Notifier/Bridge/LightSms/Tests/LightSmsTransportFactoryTest.php
Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
2021-03-29 08:45:01 +03:00
Vasilij Duško
e0a68bd0ac Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
Co-authored-by: Thibault RICHARD <thibault@widop.com>
2021-03-29 08:45:01 +03:00
Vasilij Duško
1b073c2366 Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
Co-authored-by: Thibault RICHARD <thibault@widop.com>
2021-03-29 08:45:01 +03:00
Vasilij Duško
b0891be0b2 Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
Co-authored-by: Thibault RICHARD <thibault@widop.com>
2021-03-29 08:45:01 +03:00
Vasilij Duško
49b4780f40 Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
Co-authored-by: Thibault RICHARD <thibault@widop.com>
2021-03-29 08:45:01 +03:00
Vasilij Duško
b2e46387b7 Update src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
Co-authored-by: Thibault RICHARD <thibault@widop.com>
2021-03-29 08:45:01 +03:00
Vasilij Duško
c02dbbd963 Update src/Symfony/Component/Notifier/Bridge/LightSms/README.md
Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
2021-03-29 08:45:01 +03:00
Vasilij Duško
9f89014d94 Update src/Symfony/Component/Notifier/Bridge/LightSms/README.md
Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
2021-03-29 08:45:01 +03:00
Vasilij Dusko
5e54dfe475 * LightSmsTransport.php - quick fix for private constant. 2021-03-29 08:45:01 +03:00
Vasilij Dusko
3cbbc85e43 * HOST split into two parts 2021-03-29 08:45:01 +03:00
Vasilij Dusko
9e1809e6ae * small changes 2021-03-29 08:45:01 +03:00
Vasilij Duško
febff4613d Update src/Symfony/Component/Notifier/Bridge/LightSms/LICENSE
Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
2021-03-29 08:45:01 +03:00
Vasilij Dusko
4a11b945a3 * github account author 2021-03-29 08:45:01 +03:00
Vasilij Dusko
728a3e2450 * Transport.php - missing use 2021-03-29 08:45:01 +03:00
Vasilij Dusko
ce41756a6c * notifier_transports.php - Coding Standard 2021-03-29 08:45:01 +03:00
Vasilij Dusko
d1ccd46e75 * Attached file changes which are required to run the lightsms notifier 2021-03-29 08:45:01 +03:00
Vasilij Dusko
a0fae7dc4a * tests 2021-03-29 08:45:01 +03:00
Vasilij Dusko
15686c0851 * LightSmsTransport.php - Coding Standard 2021-03-29 08:45:01 +03:00
Vasilij Dusko
2f65b92cba * LightSmsTransport.php - Coding Standard 2021-03-29 08:45:00 +03:00
Vasilij Dusko
6792535a52 * composer.json - requirements bug fix 2021-03-29 08:45:00 +03:00
Vasilij Dusko
167f325f40 * LightSmsTransport.php - logic error 2021-03-29 08:45:00 +03:00
Vasilij Dusko
be8f994fca * LightSmsTransport.php - return type 2021-03-29 08:45:00 +03:00
Vasilij Dusko
f2ba226b46 * LightSmsTransport.php - bug fix 2021-03-29 08:45:00 +03:00
Vasilij Dusko
b075c0eae2 * LightSms notifier 2021-03-29 08:45:00 +03: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
Fabien Potencier
09fe7333bb Bump Symfony version to 4.4.22 2021-03-29 07:15:29 +02:00
Fabien Potencier
c990794868 Update VERSION for 4.4.21 2021-03-29 07:11:04 +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
Vincent Langlet
592fb13456 Remove internal annotation 2021-03-28 19:13:50 +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
Fabien Potencier
b2e46a92a9 Fix typo 2021-03-27 16:08:04 +01:00
Fabien Potencier
912d3e58b4 feature #40449 [TwigBridge] add tailwindcss form layout (kbond)
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
2021-03-27 16:07:06 +01:00
Kevin Bond
3719a409b6 [TwigBridge] add tailwindcss form layout 2021-03-27 16:06:57 +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
Hugo Monteiro
bb26a92826 add missing queue_name to find(id) in doctrine messenger transport 2021-03-26 11:56:19 +00: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
Kévin Dunglas
af6f3c2c08
[Config][FrameworkBundle] Hint to use PHP 8+ or to install Annotations to use attributes/annots 2021-03-25 18:38:58 +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
azjezz
d3306fdc92 add support for symfony/mercure:^0.5 2021-03-25 16:29:53 +01:00
Robin Chalas
2dcf313a87 feature #40567 [Security] Move the badges resolution check to AuthenticatorManager (chalasr)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Security] Move the badges resolution check to `AuthenticatorManager`

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no (BC breaks on experimental code)
| Tickets       | Fixes #40491
| License       | MIT
| Doc PR        | -

Commits
-------

532f4aaa8e [Security] Move the badges resolution check to `AuthenticatorManager`
2021-03-24 15:58:59 +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
Robin Chalas
4e85380d2f minor [Contracts] Fix branch name in README.md links 2021-03-24 00:28:01 +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
Nicolas Grekas
36cc161adc Merge branch '4.4' into 5.2
* 4.4:
  [travis] remove cache of composer.lock for deps=low
  Fix comment with typo
2021-03-23 22:05:22 +01:00
sebpacz
96a05daf7e Fix comment with typo 2021-03-23 21:55:00 +01:00
Nicolas Grekas
8975f833ae Merge branch '5.2' into 5.x
* 5.2:
  fix reported class when deprecated method is static
2021-03-23 21:42:45 +01:00
Nicolas Grekas
5e9644fae4 Merge branch '4.4' into 5.2
* 4.4:
  fix reported class when deprecated method is static
2021-03-23 21:42:04 +01:00
Christian Flothmann
aa80df609f fix reported class when deprecated method is static 2021-03-23 21:33:06 +01:00
Robin Chalas
3640a889d5 feature #40555 [HttpKernel] Add #[AsController] attribute for declaring standalone controllers on PHP 8 (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[HttpKernel] Add `#[AsController]` attribute for declaring standalone controllers on PHP 8

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

This PR adds an `#[AsController]` attribute to allow autoconfiguring controllers even when they don't extend `AbstractController`. This should allow removing the line about `controller.service_arguments` in `services.yaml` to cover this need (but that is noise to most.)

Commits
-------

437f5feb45 [HttpKernel] Add `#[AsController]` attribute for declaring listeners on PHP 8
2021-03-23 21:08:54 +01:00
Nicolas Grekas
019e29b339 Merge branch '5.2' into 5.x
* 5.2:
  [travis] use packagist API v2
  [translation] Fix update existing key with existing +int-icu domain
  [Contracts] Fix branch name in README.md links
2021-03-23 20:34:00 +01:00
Nicolas Grekas
7a972c43c2 Merge branch '4.4' into 5.2
* 4.4:
  [travis] use packagist API v2
  [translation] Fix update existing key with existing +int-icu domain
  [Contracts] Fix branch name in README.md links
2021-03-23 20:33:48 +01:00
Nicolas Grekas
4f1318963a Add #[As-prefix] to service attributes 2021-03-23 18:57:16 +01:00
Nicolas Grekas
437f5feb45 [HttpKernel] Add #[AsController] attribute for declaring listeners on PHP 8 2021-03-23 18:56:31 +01:00
Nicolas Grekas
45d9a36794 [Contracts/Translation] Add TranslatorInterface::getLocale() 2021-03-23 17:28:16 +01:00
Nicolas Grekas
1665555dd5 bug #40552 [Translation] Fix update existing key with existing +int-icu domain (Alexis)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translation] Fix update existing key with existing +int-icu domain

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

Using php-translation webui interface, I was trying to update an existing +int-icu domain but a regular domain was created and the existing key wasn't updated. Looks like in the method I modified, we should have been looking for a potential domain+intl-icu domain and try update it first

Commits
-------

2a196ca0dc [translation] Fix update existing key with existing +int-icu domain
2021-03-23 17:25:13 +01:00
Alexis
2a196ca0dc [translation] Fix update existing key with existing +int-icu domain 2021-03-23 17:25:01 +01:00
Robin Chalas
c5c47f11a4 [Contracts] Fix branch name in README.md links 2021-03-23 16:25:38 +01:00
Robin Chalas
c752257be3 Merge branch '5.2' into 5.x
* 5.2:
  [Console] minor fix
  [Command] fix emojis messing up the line width
  [Validator] Avoid triggering the autoloader for user-input values
  Hardening Security - Unserialize DumpDataCollector
  Security hardening - Rate limiter
  [FrameworkBundle] ensure TestBrowserToken::$firewallName is serialized
  Fixed parsing deprecated definitions without message key
  improve login throttling rate limiter requirement message
  [HttpClient] remove using $http_response_header
  [Security] Handle properly 'auto' option for remember me cookie security
2021-03-23 15:20:07 +01:00
Robin Chalas
2da27bbd27 feature #40550 [Notifier] Move abstract test cases to namespace (OskarStark)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Move abstract test cases to  namespace

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no (only fixes builds)
| New feature?  | yes (not sure about a changeling entry)
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | no

This enables BC promise for the abstract test classes, like for other ones.

As we ignore current `/Tests` directory in `.gitattributes`, builds will fail if `symfony/notifier` is installed as dist.

Commits
-------

33ba3c755d [Notifier] Move abstract test cases to  namespace
2021-03-23 15:00:06 +01:00
Nicolas Grekas
e494b389f3 bug #40541 Fixed parsing deprecated definitions without message key (adamwojs)
This PR was merged into the 5.2 branch.

Discussion
----------

Fixed parsing deprecated definitions without message key

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

### Steps to reproduce

1. Create service/alias definition and mark it as deprecated without specifying message key as shown in https://symfony.com/doc/5.2/service_container/alias_private.html#deprecating-service-aliases. For example:

```yaml
services:
    service_without_deprecation_message:
        class: Foo
        deprecated:
            package: vendor/package
            version: 1.1

    alias_without_deprecation_message:
        alias: foobar
        deprecated:
            package: vendor/package
            version: 1.1
```

2. Clear cache by running `php bin/console cache:clear`

### Actual behaviour

`Symfony\Component\Config\Exception\LoaderLoadException` exception is thrown with the following message: `Warning: Undefined array key "message" (...)`

See https://gist.github.com/adamwojs/5bac85d4326d8fbe6f52a357fa6e57e6 for full stactrace.

### Excepted behaviour

Given definitions are loaded correctly. Default service/alias deprecation message is used as shown in linked documentation page.

Commits
-------

d585b64953 Fixed parsing deprecated definitions without message key
2021-03-23 13:46:26 +01:00
Nicolas Grekas
88d222d856 Merge branch '4.4' into 5.2
* 4.4:
  [Console] minor fix
  [Validator] Avoid triggering the autoloader for user-input values
  Hardening Security - Unserialize DumpDataCollector
  [HttpClient] remove using $http_response_header
  [Security] Handle properly 'auto' option for remember me cookie security
2021-03-23 13:45:44 +01:00
Nicolas Grekas
55bd7f4be4 feature #40530 [Uid] Handle predefined namespaces keywords "dns", "url", "oid" and "x500" (fancyweb)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Uid] Handle predefined namespaces keywords "dns", "url", "oid" and "x500"

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

Before: `uuid:generate --name-based="https://symfony.com" --namespace=6ba7b811-9dad-11d1-80b4-00c04fd430c8`
After: `uuid:generate --name-based="https://symfony.com" --namespace=url`

Same for FWB configuration.

Commits
-------

ede46ac13a [Uid] Handle predefined namespaces keywords "dns", "url", "oid" and "x500"
2021-03-23 13:33:35 +01:00
Nicolas Grekas
9a8e2c2625 bug #40537 [Security] Handle properly 'auto' option for remember me cookie security (fliespl)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Handle properly 'auto' option for remember me cookie security

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

Manually setting remember_me cookie secure as auto is still is being set as secure one even if used over http.

This PR fixes this behaviour by converting auto to null prior setting it up for service.

Commits
-------

2bcf69c071 [Security] Handle properly 'auto' option for remember me cookie security
2021-03-23 13:31:44 +01:00
Nicolas Grekas
7eb4db6d9d [Console] minor fix 2021-03-23 13:24:21 +01:00
Marion Hurteau
36b36dcecc [Command] fix emojis messing up the line width
add tests + removed irrelevant method
2021-03-23 13:19:11 +01:00
Nicolas Grekas
689056ef7f bug #40506 [Validator] Avoid triggering the autoloader for user-input values (Seldaek)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Validator] Avoid triggering the autoloader for user-input values

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

Following-up to https://twitter.com/seldaek/status/1372450636361502721 - mostly to see if the build passes or if this breaks some undocumented/unclear-to-me assumptions.

Essentially using the `Valid` constraint should only validate objects if they exist as objects. If a user sends a string and that gets assigned to a property, `Valid` should not attempt autoloading that user-given string.

As far as I can tell, this is used in two places:

- acb32dd396/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php (L364-L365) where non-objects are anyway ignored, so this change is harmless there.
- acb32dd396/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php (L652-L660) where it's explicitly passing anything in there to get the proper exception, so my change makes sure that exception is thrown *before* autoloading attempts. I am just not 100% sure if there are cases where validateGenericNode will receive a class name as a string to validate in $value. I can't imagine why it would but that doesn't mean it's true.

Commits
-------

e45eb23ba2 [Validator] Avoid triggering the autoloader for user-input values
2021-03-23 12:26:37 +01:00
Jordi Boggiano
e45eb23ba2 [Validator] Avoid triggering the autoloader for user-input values 2021-03-23 12:25:54 +01:00
Nicolas Grekas
4c2f77e5b1 bug #40544 [FrameworkBundle] ensure TestBrowserToken::$firewallName is serialized (kbond)
This PR was merged into the 5.2 branch.

Discussion
----------

[FrameworkBundle] ensure TestBrowserToken::$firewallName is serialized

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

Fixes a bug introduced in #40368. When `TestBrowserToken` in unserialized, `$firewallName` is `null` so trying to access it via `getFirewallName` throws a `TypeError`.

Commits
-------

8ba12ece57 [FrameworkBundle] ensure TestBrowserToken::$firewallName is serialized
2021-03-23 12:16:14 +01:00
Oskar Stark
33ba3c755d [Notifier] Move abstract test cases to namespace
This enables BC promise for the abstract test classes, like for other ones.

As we ignore current `/Tests` directory in `.gitattributes`, builds will fail if `symfony/notifier` is installed as dist.
2021-03-23 10:42:26 +01:00
Jérémy Derussé
214dbfec51
Hardening Security - Unserialize DumpDataCollector 2021-03-23 09:46:32 +01:00
Jérémy Derussé
e61553af4b
Security hardening - Rate limiter 2021-03-22 20:26:15 +01:00
Pierre Rineau
d29e433ae8 [Serializer] AbstractNormalizer force null for non-optional nullable constructor parameter denormalization when not present in input 2021-03-22 17:47:33 +01:00
Nyholm
415c2a0b47 [WebLink] Remove symfony/http-foundation dependency 2021-03-22 16:30:12 +01:00
Kevin Bond
8ba12ece57
[FrameworkBundle] ensure TestBrowserToken::$firewallName is serialized 2021-03-22 10:43:01 -04:00
Alexander M. Turek
1fc2a04e00 Rename master request to main request 2021-03-22 14:14:48 +01:00
Adam Wójs
d585b64953 Fixed parsing deprecated definitions without message key 2021-03-22 12:10:24 +01:00
Jesse Rushlow
6958bdc0be
improve login throttling rate limiter requirement message 2021-03-22 06:08:44 -04:00
Nicolas Grekas
b78f1dffc2 [HttpClient] remove using $http_response_header 2021-03-22 10:43:50 +01:00
flies
2bcf69c071 [Security] Handle properly 'auto' option for remember me cookie security 2021-03-22 09:54:48 +01:00
Alexander M. Turek
7873574335 Merge branch '5.2' into 5.x
* 5.2:
  [UID] refer to AbstractUid instead of "parent"
2021-03-22 02:11:47 +01:00
Thomas Calvet
ede46ac13a [Uid] Handle predefined namespaces keywords "dns", "url", "oid" and "x500" 2021-03-21 18:34:32 +01:00
Nyholm
abe4ee5b56
[UID] refer to AbstractUid instead of "parent" 2021-03-21 17:15:38 +01:00
Nyholm
4f486e850a
[Runtime] Dont use "parent" as type hint 2021-03-20 13:56:11 +01:00
Nicolas Grekas
1b93740325 CS fix 2021-03-19 19:00:13 +01:00
Thomas Calvet
2135fc3e71 [Uid] [GenerateUuidCommand] Compute a new \DateTimeImmutable every loop 2021-03-19 18:32:35 +01:00
Nyholm
6c0786b579
feature #40513 [Runtime] make GenericRuntime ... generic (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Runtime] make GenericRuntime ... generic

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

This PR will allow #40436 to move to https://github.com/symfony/psr-http-message-bridge
For the record, it builds on a prototype I wrote almost one year ago at https://github.com/tchwork/bootstrapper.

This PR makes the `GenericRuntime` implementation able to auto-discover runtime implementations for specific types.

It uses the autoloader for the discovery: when a closure-app requires or returns a type `Vendor\Foo`, it will use a convention and check if the class `Symfony\Runtime\Vendor\FooRuntime` exists. If yes, it will use it to resolve the corresponding type. Such runtime classes have to extend `GenericRuntime` so that they can use the protected API it provides. This requirement is aligned with the fact that the very convention proposed here is an implementation detail that works when using a `GenericRuntime` as the main runtime (This behavior can be overridden by providing explicit entries in the new `runtimes` option when booting the `GenericRuntime`.)

`SymfonyRuntime` can be used as both the main runtime or a type-specific runtime:
- when used as the main runtime, it configures the typical global-state for Symfony and has a fast codepath for Symfony types, while still being generic.
- it can also be used in another runtime as a way to resolve Symfony types (would typically be useful to #40436 for running Console apps in a PSR-based web app.)

Commits
-------

33e371e24d [Runtime] make GenericRuntime ... generic
2021-03-19 16:55:34 +01:00
Nicolas Grekas
485c896b4b Merge branch '5.2' into 5.x
* 5.2:
  [HttpKernel] do is_file check before include
  [PhpUnitBridge] fix reporting deprecations from DebugClassLoader
  [FrameworkBundle] skip deprecation in integration tests
  enable HTTP method overrides as early as possible with the HTTP cache
2021-03-19 12:02:33 +01:00
Nicolas Grekas
bd9e2208a0 Merge branch '4.4' into 5.2
* 4.4:
  [HttpKernel] do is_file check before include
  [PhpUnitBridge] fix reporting deprecations from DebugClassLoader
  [FrameworkBundle] skip deprecation in integration tests
2021-03-19 12:02:08 +01:00
Nicolas Grekas
a2d534ccf8 minor #40516 [HttpKernel] Add is_file() check before include (burned42)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Add is_file() check before include

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

I recently noticed that on every deployment I got warnings reported by sentry from the `cache:clear` command.

> Warning: include(/var/www/html/var/cache/pro_/App_KernelProdContainer.php): failed to open stream: No such file or directory

In `Symfony\Component\HttpKernel\Kernel` [line 469](https://github.com/symfony/symfony/blob/5.x/src/Symfony/Component/HttpKernel/Kernel.php#L469)
 (on 4.4 it's on [line 536](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/HttpKernel/Kernel.php#L536))

This is because the code tries to include the `$cachePath` without checking if it exists/is a file first. It seems like something similar was fixed some time ago already (https://github.com/symfony/symfony/pull/27249) some lines above.

This PR fixes the mentioned warnings for me.

I'm running on Symfony 5.2.5 at the moment, but the docs said that bugfixes should target branch 4.4 and new features should target 5.x, and I guess this could rather be seen as a bugfix than a new feature, so I branched off of 4.4 and also set this as target for the PR, I hope that's correct.

Commits
-------

8efcc17573 [HttpKernel] do is_file check before include
2021-03-19 12:01:36 +01:00
Nicolas Grekas
08306722ba bug #40508 [PhpUnitBridge] fix reporting deprecations from DebugClassLoader (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] fix reporting deprecations from DebugClassLoader

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

Commits
-------

cb68aeab38 [PhpUnitBridge] fix reporting deprecations from DebugClassLoader
2021-03-19 11:58:33 +01:00
Romain
20f03677e3 [Serializer] Add a Custom End Of Line in CSV File 2021-03-19 11:55:40 +01:00
Nicolas Grekas
33e371e24d [Runtime] make GenericRuntime ... generic 2021-03-19 11:40:44 +01:00
Bernd Stellwag
8efcc17573 [HttpKernel] do is_file check before include
Trying to include a file that doesn't exist issues a warning. Doing an
is_file check beforehand should prevent those warnings.
2021-03-19 08:57:35 +01:00
Alexander M. Turek
c8b48d8bbb feature #40430 [Form] Add "form_attr" FormType option (cristoforocervino)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Form] Add "form_attr" FormType option

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      |no
| New feature?  | yes
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | [#15108](https://github.com/symfony/symfony-docs/pull/15108)

## What is this about

This PR add support for [`form` attribute](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fae-form) to Symfony Form ([browser compatibility](https://caniuse.com/form-attribute)).

The `form` attribute allows form elements to override their associated form (which is their nearest ancestor form element by default). This is extremely useful to solve **nested form problem** and allows **form children** to be **rendered outside form tag** while still working as expected.

## New "form_attr" FormType option

#### form_attr
**type**: `bool` or `string` **default**: `false`

If set to `true` on a **root form**, adds [`form` attribute](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fae-form) on every children with their root **form id**.
This allows you to render form children outside the form tag and avoid **nested form problem** in some situations while keeping the form working properly.

If set to `true` on a **child**, adds [`form` attribute](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fae-form) on it with its **root form id**.
This allows you to render **that child** outside the form tag and avoid **nested form problem** in some situations while keeping the form working properly.

If root form has no `id` (this may happen by create an *unnamed* form), you can set it to a `string` identifier to be used at `FormView` level to link children and root form anyway.

## Usage on Root Form Example

#### Form Type
Enable the feature by setting `form_attr` to `true` on the root form.

```php
use Symfony\Component\Form\Extension\Core\Type;

class ListFilterType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('search', Type\SearchType::class)
            ->add('orderBy', Type\ChoiceType::class, [
                'choices' => [
                    // ...
                ],
            ])
            ->add('perPage', Type\ChoiceType::class, [
                'choices' => [
                    // ...
                ],
            ])
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefault('form_attr', true); // <--- Set this to true
    }
}

```

#### Twig

The following Twig template **works properly** even if form children are **outside** their form tag ([browser compatibility](https://caniuse.com/form-attribute)).

```twig

<div class="header-filters">
    {{ form_errors(form) }}
    {{ form_row(form.search) }} {# has attribute form="list_filter" #}
    {{ form_row(form.orderBy) }} {# has attribute form="list_filter" #}
</div>

<!-- -->
<!-- Some other HTML content, like a table or even another Symfony form -->
<!-- -->

<div class="footer-filters">
    {{ form_row(form.perPage) }} {# has attribute form="list_filter" #}
</div>
{{ form_start(form) }} {# id="list_filter" #}
{{ form_end(form) }}
```
 Every form elements work properly even outside form tag.

## Usage on Form Child Example

Enable the feature by setting `form_attr` to `true` on selected child.

```php
use Symfony\Component\Form\Extension\Core\Type;

class ListFilterType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('search', Type\SearchType::class)
            ->add('orderBy', Type\ChoiceType::class, [
                'choices' => [
                    // ...
                ],
            ])
            ->add('perPage', Type\ChoiceType::class, [
                'form_attr' => true,  // <--- Set this to true
                'choices' => [
                    // ...
                ],
            ])
    }
}

```

#### Twig

The following Twig template **works properly** even if `form.perPage` is **outside** form tag ([browser compatibility](https://caniuse.com/form-attribute)).

```twig

<div class="header-filters">
    {{ form_start(form) }} {# id="list_filter" #}
        {{ form_errors(form) }}
        {{ form_row(form.search) }}
        {{ form_row(form.orderBy) }}
    {{ form_end(form, {'render_rest': false}) }}
</div>

<!-- -->
<!-- Some other HTML content, like a table or even another Symfony form -->
<!-- -->

<div class="footer-filters">
    {{ form_row(form.perPage) }} {# has attribute form="list_filter" #}
</div>
```
 `form.perPage` element work properly even outside form tag.

Commits
-------

5f913cec74 [Form] Add "form_attr" FormType option
2021-03-18 16:04:16 +01:00
Cristoforo Cervino
5f913cec74 [Form] Add "form_attr" FormType option 2021-03-18 16:04:09 +01:00
Alexander M. Turek
1c22e6a0fc feature #38488 [Validator] Add normalizer option to Unique constraint (henry2778)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Validator] Add normalizer option to Unique constraint

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

Hello! Reopening my PR #37507 with target branch `5.x`

This PR is about https://github.com/symfony/symfony/issues/37451. The idea is to make that constraint more flexible and able to process business rules, especially when working with objects. We can think about it as the similar feature in UniqueEntity constraint, when we declare on which attributes we are applying the constraint. But in our case it is more general - we pass a callable with whatever logic we want to apply to collection elements before we apply 'uniqueness check' :)

Looks like no BC breaks. Thanks! :)

Commits
-------

44e1e8bc9b [Validator] Add normalizer option to Unique constraint
2021-03-18 15:44:46 +01:00
Andrii Popov
44e1e8bc9b [Validator] Add normalizer option to Unique constraint 2021-03-18 15:44:36 +01:00
Nicolas Grekas
cb68aeab38 [PhpUnitBridge] fix reporting deprecations from DebugClassLoader 2021-03-18 14:54:07 +01:00
Nicolas Grekas
5dd56a61a3 [FrameworkBundle] skip deprecation in integration tests 2021-03-18 10:22:03 +01:00
Christian Flothmann
93e9337382 enable HTTP method overrides as early as possible with the HTTP cache 2021-03-17 21:40:29 +01:00
Christian Flothmann
acb32dd396 Merge branch '5.2' into 5.x
* 5.2:
  fix version constraint
2021-03-17 21:38:37 +01:00
Christian Flothmann
e3788b68be fix version constraint 2021-03-17 21:31:43 +01:00
Nicolas Grekas
4b312ab06c Merge branch '5.2' into 5.x
* 5.2:
  Fix test
2021-03-17 18:12:23 +01:00
Nicolas Grekas
763edf9c92 Fix test 2021-03-17 18:12:15 +01:00
Nicolas Grekas
54cb7ec0cc Merge branch '5.2' into 5.x
* 5.2:
  CS fix
2021-03-17 18:02:51 +01:00
Nicolas Grekas
00036b934b Merge branch '4.4' into 5.2
* 4.4:
  CS fix
2021-03-17 18:02:05 +01:00
Nicolas Grekas
6a6274ca89 CS fix 2021-03-17 18:01:41 +01:00
Nicolas Grekas
285cdb0ecd bug #40498 [DebugBundle] Remove warning of ServerDumpPlaceholderCommand in console (DemigodCode)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DebugBundle] Remove warning of ServerDumpPlaceholderCommand in console

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

In 5.2.5 the console commands are lazy. (https://github.com/symfony/symfony/pull/39851)
With this change the ServerDumpCommand::$defaultName is used which isn't set in the placeholder command.
If no vardump-server in debug.dump_destination is defined, this will lead to a warning and not adding the command to the console list.

Commits
-------

37b2a19989 [DebugBundle] Add $defaultName to PlaceholderCommand
2021-03-17 17:59:56 +01:00
DemigodCode
37b2a19989 [DebugBundle] Add $defaultName to PlaceholderCommand 2021-03-17 17:58:09 +01:00
Nicolas Grekas
78fccbeb4c Merge branch '5.2' into 5.x
* 5.2:
  [Console] Fix line wrapping for decorated text in block output
  [Inflector] Fixed pluralize "coupon"
  [PhpUnitBridge] fix compat with symfony/debug
  [VarDumper] Adds support for ReflectionUnionType to VarDumper
  Correctly clear lines for multi-line progress bar messages.
  [Security] Add XML support for authenticator manager
2021-03-17 17:56:09 +01:00
Nicolas Grekas
98fce3ee7f Merge branch '4.4' into 5.2
* 4.4:
  [Console] Fix line wrapping for decorated text in block output
  [Inflector] Fixed pluralize "coupon"
  [PhpUnitBridge] fix compat with symfony/debug
  [VarDumper] Adds support for ReflectionUnionType to VarDumper
  Correctly clear lines for multi-line progress bar messages.
2021-03-17 17:55:51 +01:00
Nicolas Grekas
9030fd368b bug #40348 [Console] Fix line wrapping for decorated text in block output (grasmash)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Console] Fix line wrapping for decorated text in block output

| Q             | A
| ------------- | ---
| Branch?       |
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

Fixed bug that caused decorated text to be wrapped too early in SymfonyStyle->block().

Commits
-------

760be88310 [Console] Fix line wrapping for decorated text in block output
2021-03-17 17:22:13 +01:00
Matthew Grasmick
760be88310 [Console] Fix line wrapping for decorated text in block output 2021-03-17 17:22:06 +01:00
Nyholm
d3412e919f [Inflector] Fixed pluralize "coupon" 2021-03-17 17:19:54 +01:00
Nicolas Grekas
7678d62f75 bug #40494 [PhpUnitBridge] fix compat with symfony/debug (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] fix compat with symfony/debug

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

Best reviewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/40494/files?w=1).

Commits
-------

35dd54a654 [PhpUnitBridge] fix compat with symfony/debug
2021-03-17 12:14:50 +01:00
Nicolas Grekas
35dd54a654 [PhpUnitBridge] fix compat with symfony/debug 2021-03-17 09:57:09 +01:00
Fabien Potencier
692c6296d7 minor #40437 [Runtime] Remove "docs" from readme (Nyholm)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Runtime] Remove "docs" from readme

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/15081

Make the readme of the Runtime component link to the docs. This PR is blocked by the doc PR.

Commits
-------

6f4552fcec [Runtime] Remove "docs" from readme
2021-03-17 07:33:10 +01:00
Fabien Potencier
550489aa8e bug #40453 [VarDumper] Adds support for ReflectionUnionType to VarDumper (Michael Nelson, michaeldnelson)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[VarDumper] Adds support for ReflectionUnionType to VarDumper

Fixes a bug with VarDumper when dumping a ReflectionUnionType.
> PHP Error:  Call to undefined method ReflectionUnionType::isBuiltin()

Notes:
* One of the existing tests relies on its position in the test file. I had to modify its expected line number.
* There is an existing trailing space around line 367 in an expected value.
  I'm not sure if this was left for BC reasons but it seems like a bug if the dumper is leaving trailing spaces.

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

This commit fixes a crash when dumping ReflectionUnionType.  The code is minimal but uses a few extra lines to preserve key order for bc and consistency.  Additionally, there is an else condition that is currently unreachable but is defensive should they add additional subtypes of ReflectionType. Tests are included.  Please let me know if you have any questions or suggestions.  Thanks for Symfony it's a wonderful project.

Commits
-------

1a11491f6e [VarDumper] Adds support for ReflectionUnionType to VarDumper
2021-03-17 07:30:13 +01:00
Michael Nelson
1a11491f6e [VarDumper] Adds support for ReflectionUnionType to VarDumper 2021-03-17 07:30:06 +01:00
Fabien Potencier
9630c2fb57 Fix CS 2021-03-17 07:23:45 +01:00
Fabien Potencier
9287099c57 minor #40488 [Mailer] Add supported auth modes to exception (liayn)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Mailer] Add supported auth modes to exception

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

If there is no match for the available authenticators the thrown exception now includes the supported auth methods as reported by the server.

Commits
-------

d9c99d86ab [Mailer] Add supported auth modes to exception
2021-03-17 07:21:46 +01:00
Fabien Potencier
d70c0988d3 bug #40492 [Security] Fix BC layer (chalasr)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Security] Fix BC layer

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

Tests were broken because no password hasher was configured for the new `InMemoryUser` class in configs on lower branches.
This PR fixes it by making the new class extend the deprecated one, so that the password hasher factory is able to find a password hasher for it (instanceof-based match).

Commits
-------

2d7f7b5072 [Security] Fix BC layer
2021-03-17 07:06:36 +01:00
Fabien Potencier
50591a771b Fix CS 2021-03-17 07:04:35 +01:00
Wouter de Jong
99cf2a3a71 [Security] Disallow passing a UserInterface to Passport
This was deprecated in 5.2, with a warning that support would be dropped in 5.3
(due to the experimental state).
2021-03-17 07:03:24 +01:00
Matthew Grasmick
8ada55c07c Correctly clear lines for multi-line progress bar messages. 2021-03-16 22:19:58 -04:00
Robin Chalas
2d7f7b5072 [Security] Fix BC layer 2021-03-16 23:18:28 +01:00
Nicolas Grekas
49d23d4813 minor #40484 [DependencyInjection] accept null index in #[TaggedItem] (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] accept null index in #[TaggedItem]

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

As hinted by @stof in https://github.com/symfony/symfony/pull/40248#discussion_r595065941

Commits
-------

6d16fac703 [DI] accept null index in #[TaggedItem]
2021-03-16 20:14:20 +01:00
Nicolas Grekas
6d16fac703 [DI] accept null index in #[TaggedItem] 2021-03-16 20:13:40 +01:00
Fabien Potencier
db87d72869 feature #40443 [Security] Rename User to InMemoryUser (chalasr)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Security] Rename User to InMemoryUser

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

This PR aims to clarify that the `User` class should only be used by the `InMemoryUserProvider`, as documented:
c06a76c384/src/Symfony/Component/Security/Core/User/User.php (L15-L17)
It also renames `UserChecker` to `InMemoryUserChecker` because it only works with the in-memory user class:
c06a76c384/src/Symfony/Component/Security/Core/User/UserChecker.php (L31-L32)

Commits
-------

55b51d3f90 [Security] Rename User to InMemoryUser
2021-03-16 19:12:12 +01:00
Wouter de Jong
77fb0eb0a1 [Security] Add XML support for authenticator manager 2021-03-16 19:11:03 +01:00
Markus Klein
d9c99d86ab [Mailer] Add supported auth modes to exception
If there is no match for the available authenticators the thrown
exception now includes the supported auth methods as reported by the server.
2021-03-16 14:41:21 +01:00
Nicolas Grekas
7cc5cef1c3 feature #40468 Deprecate configuring tag names and service ids in compiler passes (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Deprecate configuring tag names and service ids in compiler passes

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

This PR is aimed at reducing the code complexity by hardcoding the name of tags and service ids that compiler passes have to deal with.

I think making these names configurable only adds boilerplate and maintenance overhead for no benefit:
- for the practice: the need to use a pass with a renamed tag/id should be extremely rare (do yo know any?)
- for the theory: a decorating pass could still rename before/after the processing, so this use case is still supported.

Side note: I skipped updating changelog+upgrade files. This would be just noise to me (nobody uses this possibility anyway ;) )

Commits
-------

6fe82d8be7 Deprecate configuring tag names and service ids in compiler passes
2021-03-16 10:12:04 +01:00
Nicolas Grekas
5850f3d4ea Merge branch '5.2' into 5.x
* 5.2:
  [ErrorHandler] Fix error caused by `include` + open_basedir
  [FrameworkBundle] Make the TestBrowserToken interchangeable with other tokens
  [Console] ProgressBar clears too many lines on update
  [FrameworkBundle] Exclude unreadable files when executing About command
  [Bridge\Twig] Add 'form-control-range' for range input type
  Be explicit about transparent background color of links in toolbar
  [Translation] fix test case name
  [Cache] Fix wrong namespace in test
  [DependencyInjection] Fix return type
2021-03-16 10:10:58 +01:00
Nicolas Grekas
ca06651235 Merge branch '4.4' into 5.2
* 4.4:
  [Console] ProgressBar clears too many lines on update
  [FrameworkBundle] Exclude unreadable files when executing About command
  [Bridge\Twig] Add 'form-control-range' for range input type
  Be explicit about transparent background color of links in toolbar
  [Translation] fix test case name
  [Cache] Fix wrong namespace in test
  [DependencyInjection] Fix return type
2021-03-16 10:10:13 +01:00
stlrnz
9ad7832acd [ErrorHandler] Fix error caused by include + open_basedir 2021-03-16 10:07:47 +01:00
Nicolas Grekas
faf7269806 bug #40368 [FrameworkBundle] Make the TestBrowserToken interchangeable with other tokens (Seldaek)
This PR was squashed before being merged into the 5.2 branch.

Discussion
----------

[FrameworkBundle] Make the TestBrowserToken interchangeable with other tokens

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

For some reason most tokens implement getFirewallName (and the deprecated getProviderKey), but not all. This adds it to TestBrowserToken because it caused issues in my tests when upgrading to Symfony 5's `Client::loginUser()`.

I am also happy to add this to AnonymousToken but I am more worried about BC impacts there, so I left it alone for now. All other token classes implement it, so I am not sure why this isn't in TokenInterface to begin with.

Commits
-------

a4958ae7ad [FrameworkBundle] Make the TestBrowserToken interchangeable with other tokens
2021-03-16 09:58:51 +01:00
Jordi Boggiano
a4958ae7ad [FrameworkBundle] Make the TestBrowserToken interchangeable with other tokens 2021-03-16 09:58:32 +01:00
Nicolas Grekas
a78fb1832b bug #40450 [Console] ProgressBar clears too many lines on update (danepowell)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Console] ProgressBar clears too many lines on update

| 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

The ProgressBar incorrectly calculates line lengths when updating, including non-displayable characters such as ANSI colors. This causes it to clear too many lines if the terminal width is greater than the displayed line length but less than the line length including non-displayed characters. An example of this bug in action is https://github.com/acquia/cli/issues/467

Commits
-------

2aa3df0c74 [Console] ProgressBar clears too many lines on update
2021-03-16 09:54:45 +01:00
Dane Powell
2aa3df0c74 [Console] ProgressBar clears too many lines on update 2021-03-16 09:54:32 +01:00
Nicolas Grekas
e21004d922 bug #40178 [FrameworkBundle] Exclude unreadable files when executing About command (michaljusiega)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Exclude unreadable files when executing About command

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

Fix as explained in: https://github.com/symfony/symfony/issues/39916.

Tests failed looks like not releated to my changes.

Commits
-------

25f503a813 [FrameworkBundle] Exclude unreadable files when executing About command
2021-03-16 09:47:37 +01:00
Michał Jusięga
25f503a813 [FrameworkBundle] Exclude unreadable files when executing About command 2021-03-16 09:46:52 +01:00
Nicolas Grekas
73cef1553a minor #40423 [DependencyInjection] Fix return type of getSubscribedServices() (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Fix return type of getSubscribedServices()

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

Commits
-------

ef59c89dea [DependencyInjection] Fix return type
2021-03-16 09:36:52 +01:00
Nicolas Grekas
1e6237c717 feature #40248 [DependencyInjection] Add #[TaggedItem] attribute for defining the index and priority of classes found in tagged iterators/locators (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] Add `#[TaggedItem]` attribute for defining the index and priority of classes found in tagged iterators/locators

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

Next to #39804, this PR adds a new `#[TaggedItem]` attribute that ppl can use to define the index of their service classes when they're used in tagged collections (iterators/locators.

This replaces the `public static getDefaultName()` and `getDefaultPriority()` methods that ppl could use for this purpose:
```php
#[TaggedItem(index: 'api.logger', priority: 123)]
class MyApiLogger implements LoggerInterface
{
}
```

This will ship the corresponding service at index `api.logger`, priority=123 when building locators/iterators.

Commits
-------

252f2ca1fb [DependencyInjection] Add `#[TaggedItem]` attribute for defining the index and priority of classes found in tagged iterators/locators
2021-03-16 09:24:13 +01:00
Nicolas Grekas
fcd658e6da minor #40475 Be explicit about anchor background color in profiler toolbar (bezin)
This PR was merged into the 4.4 branch.

Discussion
----------

Be explicit about anchor background color in profiler toolbar

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

Hello,

we have a project where we work with background colors on links. When we define this in our stylesheet, the Web Profiler picks these styles up due to the cascade. We added two CSS statements to the Web Profiler stylesheet to be explicit about the transparent background.

![2021-03-15 16_10_08](https://user-images.githubusercontent.com/4400435/111176325-860e8d80-85a9-11eb-82c4-7954aa01245a.png)
![2021-03-15 16_10_30](https://user-images.githubusercontent.com/4400435/111176328-86a72400-85a9-11eb-9515-280c5593a288.png)

Commits
-------

f0cac47ae7 Be explicit about transparent background color of links in toolbar
2021-03-16 09:13:06 +01:00
Oviglo
e73db2b1f1 [Bridge\Twig] Add 'form-control-range' for range input type 2021-03-16 09:08:39 +01:00
Fabien Potencier
a5a2d86929 Merge branch '5.2' into 5.x
* 5.2:
  Make async-ses required
  [RateLimiter] Fix wrong namespace in tests
2021-03-16 08:55:45 +01:00