Commit Graph

44481 Commits

Author SHA1 Message Date
Fabien Potencier db5cf1a83e bug #33350 [DI] scope singly-implemented interfaces detection by file (daniel-iwaniec, nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] scope singly-implemented interfaces detection by file

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

[DependencyInjection] fixed handling singly implemented interfaces when importing multiple resources

for example:
```yaml
App\Adapter\:
    resource: '../src/Adapter/*'
App\Port\:
    resource: '../src/Port/*'
```

this configuration wont create service for interface (in other words singly implemented interface wont be autowired) and this chage fixes it

**Also** this will prevent false positives - for example if I had one implementation in \App\Port namespace and another in \App\Adapter then interface service would still be registered

but that could potentially break exisitng code not aware of this bug

Commits
-------

c1f39709ff [DI] add FileLoader::registerAliasesForSinglyImplementedInterfaces()
bec38900d8 [DI] scope singly-implemented interfaces detection by file
2019-09-25 21:03:45 +02:00
Fabien Potencier 4cf7ec1ecf feature #33658 [Yaml] fix parsing inline YAML spanning multiple lines (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Yaml] fix parsing inline YAML spanning multiple lines

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

Commits
-------

85a5c31e05 fix parsing inline YAML spanning multiple lines
2019-09-25 20:53:23 +02:00
Fabien Potencier b1802085ec bug #33674 [ErrorHandler] Show fallback error page when default error controller is disabled (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Show fallback error page when default error controller is disabled

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

This would avoid a blank page on errors when we've disabled the default error controller. e.g:
```yaml
framework:
    error_controller: null
```
So, we will show you the default HTML error page.

Commits
-------

8eea11cc26 Show fallback error page when framework.error_controller is null
2019-09-25 20:52:25 +02:00
Fabien Potencier 745248f329 minor #33708 [ErrorHandler] don't throw deprecations for return-types by default (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] don't throw deprecations for return-types by default

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

As discussed a few times already,  in 4.4, `DebugClassLoader` shouldn't trigger deprecations when return types are missing. We'll enable them back in 5.1.

Commits
-------

2cb419edf4 [ErrorHandler] don't throw deprecations for return-types by default
2019-09-25 20:45:24 +02:00
Fabien Potencier 89d7931fdf feature #33698 [HttpKernel] compress files generated by the profiler (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] compress files generated by the profiler

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

I've recently seen several reports of fastly growing profiler storages. Let's compress them when possible.

Locally for the skeleton homepage, a single profile goes from 150k to 15k. Level 3 is producing significant compression ratio while being measurably faster than level 6 (the default), that's why I'm using it.

Commits
-------

08f9470556 [HttpKernel] compress files generated by the profiler
2019-09-25 20:41:47 +02:00
Fabien Potencier e2e73eff1d feature #33317 [Messenger] Added support for `from_transport` attribute on `messenger.message_handler` tag (ruudk)
This PR was squashed before being merged into the 4.4 branch (closes #33317).

Discussion
----------

[Messenger] Added support for `from_transport` attribute on `messenger.message_handler` tag

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #33306
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/12231

Right now, it's only possible to have dynamic `from_transport` when using `MessageSubscriberInterface`. Things like `priority` and `bus` can already be added as attributes on the  messenger.message_handler` tag.

With this PR it now also supports `from_transport`.

Commits
-------

c965e4e844 [Messenger] Added support for `from_transport` attribute on `messenger.message_handler` tag
2019-09-25 20:39:14 +02:00
Ruud Kamphuis c965e4e844 [Messenger] Added support for `from_transport` attribute on `messenger.message_handler` tag 2019-09-25 20:39:09 +02:00
Nicolas Grekas 2cb419edf4 [ErrorHandler] don't throw deprecations for return-types by default 2019-09-25 19:39:21 +02:00
Fabien Potencier a0bbae7514 Merge branch '4.3' into 4.4
* 4.3:
  ensure legacy event dispatcher compatibility
2019-09-25 17:04:11 +02:00
Fabien Potencier 5d4f302048 bug #33707 [Mailer] ensure legacy event dispatcher compatibility (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] ensure legacy event dispatcher compatibility

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

Commits
-------

860688ff2e ensure legacy event dispatcher compatibility
2019-09-25 16:56:38 +02:00
Fabien Potencier 29a54c5334 bug #33706 [Mailer][Messenger] ensure legacy event dispatcher compatibility (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer][Messenger] ensure legacy event dispatcher compatibility

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

Commits
-------

4fcc1bc6fa ensure legacy event dispatcher compatibility
2019-09-25 16:55:19 +02:00
Christian Flothmann 860688ff2e ensure legacy event dispatcher compatibility 2019-09-25 16:41:08 +02:00
Christian Flothmann 1595d307cf Merge branch '4.3' into 4.4
* 4.3:
  fix version in @deprecated annotation
  [Security] use LegacyEventDispatcherProxy
  Add missing row_attr option to FormType
2019-09-25 16:40:34 +02:00
Christian Flothmann 4fcc1bc6fa ensure legacy event dispatcher compatibility 2019-09-25 16:27:22 +02:00
Christian Flothmann 479d8ee2a3 bug #33688 Add missing row_attr option to FormType (mcsky)
This PR was merged into the 4.3 branch.

Discussion
----------

Add missing row_attr option to FormType

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix: #33682 - related issue #33573
| License       | MIT

The #33573 modified Symfony's form themes. But the [FormType](https://github.com/symfony/form/blob/master/Extension/Core/Type/FormType.php) don't allow the option `row_attr` so the OptionResolver throw an exception that the option is unknown.

This PR basically add the option and give it to the form view (like `label_attr` do)

Commits
-------

d711ea2b54 Add missing row_attr option to FormType
2019-09-25 12:11:53 +02:00
Christian Flothmann 042f5b5a9d bug #33692 [HttpClient] fix undefined index access (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix undefined index access

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

When the request fails.

Commits
-------

7fce184d25 [HttpClient] fix undefined index access
2019-09-25 12:04:37 +02:00
Christian Flothmann 51b7e030a8 minor #33696 [Security] tweak deprecation messages and changelog (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] tweak deprecation messages and changelog

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

Commits
-------

eceb0e595c tweak deprecation messages and changelog
2019-09-25 11:52:51 +02:00
Christian Flothmann a53732f28d bug #33693 [Security] use LegacyEventDispatcherProxy (dmaicher)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security] use LegacyEventDispatcherProxy

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

I ran into an issue on one of my apps that has its own event dispatcher class using the old dispatch method signature

```php
public function dispatch($eventName, Event $event = null)
```

This leads to

```
TypeError: Argument 2 passed to X\Tests\Base\TestEventDispatcher::dispatch() must be an instance of Symfony\Component\EventDispatcher\Event or null, string given, called in /var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php on line 230

/var/www/x/symfony/tests/Base/TestEventDispatcher.php:20
/var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php:230
/var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php:111
```

since the event here is dispatched using the new signature:

https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Security/Http/Firewall/ContextListener.php#L259

Commits
-------

7067e48165 [Security] use LegacyEventDispatcherProxy
2019-09-25 11:50:36 +02:00
Nicolas Grekas 08f9470556 [HttpKernel] compress files generated by the profiler 2019-09-25 10:55:08 +02:00
Christian Flothmann eceb0e595c tweak deprecation messages and changelog 2019-09-25 10:01:37 +02:00
Christian Flothmann e01614527f fix version in @deprecated annotation 2019-09-25 09:46:23 +02:00
David Maicher 7067e48165 [Security] use LegacyEventDispatcherProxy 2019-09-24 20:49:43 +02:00
Nicolas Grekas 7fce184d25 [HttpClient] fix undefined index access 2019-09-24 20:17:30 +02:00
Nicolas Grekas 373469b53f Merge branch '4.3' into 4.4
* 4.3:
  [Routing] fix bad fix
2019-09-24 18:23:28 +02:00
Nicolas Grekas 3ab7d57659 Merge branch '3.4' into 4.3
* 3.4:
  [Routing] fix bad fix
2019-09-24 18:23:04 +02:00
Nicolas Grekas 04fe347df9 [Routing] fix bad fix 2019-09-24 18:22:08 +02:00
Nicolas Grekas 51a2cb6e3c Merge branch '4.3' into 4.4
* 4.3:
  [Security/Http] fix typo in deprecation message
  Various tweaks 3.4
  Various tweaks 4.3
  [PhpUnit] Fix usleep mock return value
  [Lock] use Predis\ClientInterface instead of Predis\Client
  Fix version typo in deprecation notice
  Make legacy "wrong" RFC2047 encoding apply only to one header
2019-09-24 17:57:39 +02:00
Nicolas Grekas 1ccc970469 minor #33690 [Security/Http] fix typo in deprecation message (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security/Http] fix typo in deprecation message

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

spotted by @stof in #33676

Commits
-------

e70057aed4 [Security/Http] fix typo in deprecation message
2019-09-24 17:54:42 +02:00
Nicolas Grekas 7031e83a8f Merge branch '3.4' into 4.3
* 3.4:
  Various tweaks 3.4
  [PhpUnit] Fix usleep mock return value
  [Lock] use Predis\ClientInterface instead of Predis\Client
2019-09-24 17:54:14 +02:00
Nicolas Grekas e70057aed4 [Security/Http] fix typo in deprecation message 2019-09-24 17:43:44 +02:00
Kevin Grenier d711ea2b54 Add missing row_attr option to FormType 2019-09-24 17:38:26 +02:00
Fabien Potencier 3c7172d81e feature #33584 [Security] Deprecate isGranted()/decide() on more than one attribute (wouterj)
This PR was squashed before being merged into the 4.4 branch (closes #33584).

Discussion
----------

[Security] Deprecate isGranted()/decide() on more than one attribute

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

While I expect it not be used much, it is currently possible to call `isGranted()` on more than one attribute:

```php
if ($this->authorizationChecker->isGranted(['ROLE_USER', 'ROLE_ADMIN'])) {
    // ...
}
```

Supporting this includes a couple of problems/questions:

- It is not clear whether this is `OR` or `AND`;
- In fact, this is left over to the voter to decide upon. So it can vary for each voter and writers of new voters need to consider this (otherwise, you get issues like https://github.com/LeaseWeb/LswSecureControllerBundle/issues/4 );
- It promotes to vote over roles instead of actions.

I think we can do better. In the past, we've created all tooling for this to be self-explaining and easier:

```php
// ExpressionLanguage component (also includes other functions, like `is_granted('EDIT')`)
if ($this->authorizationChecker->isGranted("has_role('ROLE_USER') or has_role('ROLE_ADMIN')")) {
    // ...
}

// calling it multiple times in PHP (may reduce performance)
if ($this->authorizationChecker->isGranted('ROLE_USER')
    || $this->authorizationChecker->isGranted('ROLE_ADMIN')
) {
    // ...
}

// or by using Role Hierarchy, if a user really wants to vote on roles
```

This PR deprecates passing more than one attribute to `isGranted()` and `decide()` to remove this confusing bit in Security usage.

Backwards compatiblity help
---

I need some help in how to approach changing the `VoterInterface::vote(TokenInterface $token, $subject, array $attributes)` method in a backwards compatible way. Removing `array` breaks all Voters, so does changing it to `string` and removed the parameter all together.

Commits
-------

c64b0beffb [Security] Deprecate isGranted()/decide() on more than one attribute
2019-09-24 17:21:06 +02:00
Wouter J c64b0beffb [Security] Deprecate isGranted()/decide() on more than one attribute 2019-09-24 17:21:01 +02:00
Fabien Potencier e84bd65e91 feature #33663 [Security] Make stateful firewalls turn responses private only when needed (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Make stateful firewalls turn responses private only when needed

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26769 *et al.*
| License       | MIT
| Doc PR        | -

Replaces #28089

By taking over session usage tracking and replacing it with token usage tracking, we can prevent responses that don't actually use the token from turning responses private without changing anything to the lifecycle of security listeners. This makes the behavior much more seamless, allowing to still log the user with the monolog processor, and display it in the profiler toolbar.

This works by using two separate token storage services:
- `security.token_storage` now tracks access to the token and increments the session usage tracker when needed. This is the service that is injected in userland.
- `security.untracked_token_storage` is a raw token storage that just stores the token and is disconnected from the session. This service is injected in places where reading the session doesn't impact the generated output in any way (as e.g. in Monolog processors, etc.)

Commits
-------

20df3a125c [Security] Make stateful firewalls turn responses private only when needed
2019-09-24 17:09:00 +02:00
Yonel Ceruto e95d27b31a minor #33686 Fixed a minor typo in the UPGRADE to 5.0 guide (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

Fixed a minor typo in the UPGRADE to 5.0 guide

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

I tried to fix this in the 4.3 branch too ... but the `UPGRADE-5.0.md` is quite different. Should these two files be exactly the same?

* https://github.com/symfony/symfony/blob/4.3/UPGRADE-5.0.md
* https://github.com/symfony/symfony/blob/4.4/UPGRADE-5.0.md

Commits
-------

8532d62 Fixed a minor typo in the UPGRADE to 5.0 guide
2019-09-24 10:07:40 -04:00
Javier Eguiluz 8532d62c5f Fixed a minor typo in the UPGRADE to 5.0 guide 2019-09-24 15:52:36 +02:00
Fabien Potencier 7c04a82a47 bug #33675 [PhpUnit] Fix usleep mock return value (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnit] Fix usleep mock return value

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| 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| License       | MIT
| Doc PR        | n/a

`usleep` does not return anything.

Commits
-------

8198d93c5b [PhpUnit] Fix usleep mock return value
2019-09-24 07:30:09 +02:00
Fabien Potencier d273ee8bd0 minor #33677 Various tweaks 3.4 (fabpot)
This PR was squashed before being merged into the 3.4 branch (closes #33677).

Discussion
----------

Various tweaks 3.4

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| 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
| License       | MIT
| Doc PR        | n/a

<!--
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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

47cb83a6ec Various tweaks 3.4
2019-09-24 07:29:37 +02:00
Fabien Potencier 47cb83a6ec Various tweaks 3.4 2019-09-24 07:29:29 +02:00
Fabien Potencier 926f286000 minor #33678 Various tweaks 4.3 (fabpot)
This PR was squashed before being merged into the 4.3 branch (closes #33678).

Discussion
----------

Various tweaks 4.3

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| 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
| License       | MIT
| Doc PR        | n/a
<!--
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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

7596f99a12 Various tweaks 4.3
2019-09-24 07:27:48 +02:00
Fabien Potencier 7596f99a12 Various tweaks 4.3 2019-09-24 07:27:42 +02:00
Nicolas Grekas 20df3a125c [Security] Make stateful firewalls turn responses private only when needed 2019-09-23 21:34:59 +02:00
Fabien Potencier 8198d93c5b [PhpUnit] Fix usleep mock return value 2019-09-23 21:21:37 +02:00
Yonel Ceruto 8eea11cc26 Show fallback error page when framework.error_controller is null 2019-09-23 12:22:17 -04:00
Christian Flothmann b00b633665 feature #33609 [Form][SubmitType] Add "validate" option (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form][SubmitType] Add "validate" option

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

The second part of the ticket requires more work but is kind of unrelated.

Commits
-------

a2bc06d811 [Form][SubmitType] Add "validate" option
2019-09-23 17:54:07 +02:00
Fabien Potencier 3f96ef2b65 feature #33621 Revert "feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)" (lyrixx)
This PR was squashed before being merged into the 4.4 branch (closes #33621).

Discussion
----------

Revert "feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)"

This reverts commit 21a05de9bf, reversing
changes made to 24faadc905.

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

Commits
-------

e767bb1b42 Revert \"feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)\"
2019-09-23 17:45:42 +02:00
Grégoire Pineau e767bb1b42 Revert \"feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)\" 2019-09-23 17:45:34 +02:00
Nicolas Grekas c1ab2c64c5 [TwigBundle] typo 2019-09-23 16:56:34 +02:00
Nicolas Grekas 4ca6eea758 [TwigBundle] fix test case 2019-09-23 16:55:33 +02:00
Fabien Potencier acca7ad939 minor #33641 Make legacy "wrong" RFC2047 encoding apply only to one header (terjebraten-certua)
This PR was merged into the 4.3 branch.

Discussion
----------

Make legacy "wrong" RFC2047 encoding apply only to one header

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

It says in a comment in the code that "We have to go against RFC 2183/2231 in some areas for interoperability". But I would like that to be the exception and not the rule. As the code was, all parameterized headers except from "Content-Disposition" was not encoded according to RFC 2231.

This change is to make it so that the exception (to not follow the RFC) is for the header "Content-Type" only, and all other parameterized headers will follow the rule of RFC 2231.

The code kind of worked before, because in emails we generally only have two parameterized headers; "Content-Disposition" and "Content-Type". But I think it is a good thing that if another  parameterized header would happen to be added, by default it should follow the rule of the RFC and not by default be an exception.

Commits
-------

3817a8b036 Make legacy "wrong" RFC2047 encoding apply only to one header
2019-09-23 16:42:16 +02:00