Commit Graph

35 Commits

Author SHA1 Message Date
Christian Flothmann eb26992f95 [#35368] add missing changelog entry 2020-04-21 08:45:37 +02:00
Fabien Potencier 7800a2ab92 feature #36426 [Form] Deprecated unused old `ServerParams` util (HeahDude)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Form] Deprecated unused old `ServerParams` util

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

A left over after https://github.com/symfony/symfony/pull/11924#issuecomment-56511557, this class is unused since Symfony 2.3 ^^'. I've noticed it before but never took the time to submit a PR because this is very minor IMHO. But since this deprecation should not impact anyone, let's keep the codebase clean and remove it in 6.0.

Commits
-------

e05e924c5a [Form] Deprecated unused old `ServerParams` util
2020-04-12 15:57:46 +02:00
Jules Pietri e05e924c5a
[Form] Deprecated unused old `ServerParams` util 2020-04-12 15:23:35 +02:00
Nicolas Grekas 647d971ae4 [DI] deprecate the `inline()` function from the PHP-DSL in favor of `service()` 2020-04-09 10:45:03 +02:00
Ahmed TAILOULOUTE c3f5e2c1c8 [OptionsResolver] Improve the deprecation feature by handling package + version 2020-04-06 19:48:46 +02:00
Fabien Potencier 8a2a69f332 feature #36209 [HttpKernel] allow cache warmers to add to the list of preloaded classes and files (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpKernel] allow cache warmers to add to the list of preloaded classes and files

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

This PR makes cache warmers responsible for returning a list of classes or files to preload. It does so by adding the following to `WarmableInterface::warmUp()`:
`@return string[] A list of classes or files to preload on PHP 7.4+`

Of course, this return value is properly implemented so that we can see what this provides in practice. Here are the benchmarks on a simple Hello World rendered with Twig:
- without preloading: 360 req/s
- with preloading in master: 560 req/s (+55%)
- with preloading and this PR: 630 req/s (+75%)

Commits
-------

8ab75d99d4 [HttpKernel] allow cache warmers to add to the list of preloaded classes and files
2020-04-05 09:00:42 +02:00
Fabien Potencier 1fc7b86f07 feature #36243 [Security] Refactor logout listener to dispatch an event instead (wouterj)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Security] Refactor logout listener to dispatch an event instead

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes (sort of...)
| New feature?  | yes
| Deprecations? | yes
| Tickets       | Fix #25212, Fix #22473
| License       | MIT
| Doc PR        | tbd

The current `LogoutListener` has some extension points, but they are not really DX-friendly (ref #25212). It requires hacking a `addMethodCall('addHandler')` in the container builder to register a custom logout handler.
Also, it is impossible to overwrite the default logout functionality from a bundle (ref #22473).

This PR introduces a `LogoutEvent` that replaces both the `LogoutSuccessHandlerInterface` and `LogoutHandlerInterface`. This provides a DX-friendly extension point and also cleans up the authentication factories (no more `addMethodCall()`'s).

In order to allow different logout handlers for different firewalls, I created a specific event dispatcher for each firewall (as also shortly discussed in #33558). The `dispatcher` tag attribute allows you to specify which dispatcher it should be registered to (defaulting to the global dispatcher). The `EventBubblingLogoutListener` also dispatches logout events on the global dispatcher, to be used for listeners that should run on all firewalls.

_@weaverryan and I discussed this feature while working on #33558, but figured it was unrelated and could be done while preservering BC. So that's why a separate PR is created._

Commits
-------

a9f096eb1f [Security] Refactor logout listener to dispatch an event instead
2020-04-04 13:02:32 +02:00
Wouter de Jong a9f096eb1f [Security] Refactor logout listener to dispatch an event instead 2020-04-04 13:02:21 +02:00
Nicolas Grekas 8ab75d99d4 [HttpKernel] allow cache warmers to add to the list of preloaded classes and files 2020-04-04 11:52:45 +02:00
Benjamin Dos Santos 5fa9d68e8b [Messenger] Add a \Throwable argument in RetryStrategyInterface methods 2020-04-04 09:33:12 +02:00
Nicolas Grekas 0bec08f0d8 feature #35871 [Config] Improve the deprecation features by handling package and version (atailouloute)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Config] Improve the deprecation features by handling package and version

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | https://github.com/orgs/symfony/projects/1#card-32681032
| License       | MIT
| Doc PR        | TODO

Commits
-------

f4de76dba0 [Config] Improve the deprecation features by handling package and version
2020-04-01 10:41:36 +02:00
Ahmed TAILOULOUTE f4de76dba0 [Config] Improve the deprecation features by handling package and version 2020-04-01 10:41:21 +02:00
Thomas Calvet 6162ca8e40 [DependencyInjection] Deprecate ContainerInterface aliases 2020-04-01 09:27:41 +02:00
William Arslett f9b52fe55e [FrameworkBundle] Deprecate flashbag and attributebag services 2020-04-01 07:18:04 +02:00
Nicolas Grekas 9381dd6dd1 feature #36257 [HttpKernel] Deprecate single-colon notation for controllers (chalasr)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpKernel] Deprecate single-colon notation for controllers

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

Commits
-------

e88cec6d32 [HttpKernel] Deprecate single-colon notation for controllers
2020-03-31 21:54:48 +02:00
Ahmed TAILOULOUTE f10413cf34 [DependencyInjection] improve the deprecation features by handling package+version info 2020-03-31 21:51:49 +02:00
Robin Chalas e88cec6d32 [HttpKernel] Deprecate single-colon notation for controllers 2020-03-31 21:20:47 +02:00
Fabien Potencier e0bddeeef0 feature #35733 [Form] Added a "choice_filter" option to ChoiceType (HeahDude)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Form] Added a "choice_filter" option to ChoiceType

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | Fix #32657
| License       | MIT
| Doc PR        | symfony/symfony-docs#13223

Finally opening this PR for a very old branch, based on both #34550 (merged) and #30994 (merged).

~Until #30994 is merged, this PR should better be reviewed by commits. Thanks!~

Commits
-------

ed2c312609 [Form] Added a "choice_filter" option to ChoiceType
2020-03-16 07:19:38 +01:00
Haralan Dobrev 36a57cc7c2 [PhpUnitBridge] Deprecate @expectedDeprecation annotation 2020-03-16 07:05:14 +01:00
Jules Pietri ed2c312609
[Form] Added a "choice_filter" option to ChoiceType 2020-03-15 16:49:24 +01:00
Wouter de Jong 3c8d316f65 Added ROLE_PREVIOUS_ADMIN deprecation to UPGRADE guide 2020-02-28 12:20:28 +01:00
Nicolas Grekas 21b8a64446 [Routing] deprecate RouteCompiler::REGEX_DELIMITER 2020-02-25 11:55:47 +01:00
Nicolas Grekas 8522a83217 [Routing] add priority option to annotated routes 2020-02-05 19:01:26 +01:00
Nicolas Grekas 86573147b3 feature #32747 [Form] Add "is empty callback" to form config (fancyweb)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Form] Add "is empty callback" to form config

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/31572 for 4.4+
| License       | MIT
| Doc PR        | -

This PR introduces a new feature that allow to resolve a bug.

Currently, the `isEmpty()` behavior of the `Form` class is the same whatever its configuration. That prevents us to specify a different behavior by form type.

But I think that some form types should have dedicated empty values. For example, the `CheckboxType` model data either resolves to `true` (checked) or `false` (unchecked). But `false` is not an empty value in the `Form::isEmpty()` method, so a `CheckboxType` form can never be empty. `false` should not be in that list because for other form types, it's perfectly fine that it's not considered as an empty value.

The problem is better seen in https://github.com/symfony/symfony/issues/31572 with a `ChoiceType` that is never considered as empty (when no radio button is checked).

Being able to specify the "is empty" behavior by form type would also allow users to define their own logic in their custom form types + probably define it ourselves in all our form types in order to get rid of the default common behavior.

Commits
-------

7bfc27e7cf [Form] Add "is empty callback" to form config
2020-02-05 17:32:36 +01:00
Nicolas PHILIPPE bc4f7d701f Messenger: validate options for AMQP and Redis Connections 2020-02-04 06:52:48 +01:00
Thomas Calvet 7bfc27e7cf [Form] Add "is empty callback" to form config 2020-02-03 18:27:57 +01:00
Nicolas Grekas 98c7d3027b [Dotenv] Add Dotenv::bootEnv() to check for .env.local.php before calling Dotenv::loadEnv() 2020-01-28 12:41:19 +01:00
Fabien Potencier 3945a5c80e feature #35422 [Messenger] Move Transports to separate packages (Nyholm)
This PR was squashed before being merged into the 5.1-dev branch (closes #35422).

Discussion
----------

[Messenger] Move Transports to separate packages

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

I think it is a good idea to have the transports in a separate package. The benefits a many:
- It allows us to have usage statistics
- The core messenger package is smaller
- Transports can have dependencies specified in composer.json instead of just suggests

This PR will not break BC but it requires to configure subtree split.

Commits
-------

2990c8f1e7 [Messenger] Move Transports to separate packages
2020-01-28 09:56:37 +01:00
Nyholm 2990c8f1e7 [Messenger] Move Transports to separate packages 2020-01-28 09:56:31 +01:00
Grégoire Pineau e2ede070fa [Console] Add default parameter (true) for Command::setHidden() 2020-01-22 11:03:14 +01:00
Nicolas Grekas 84849bc96a [FrameworkBundle] Deprecate *not* setting the "framework.router.utf8" option 2020-01-11 19:23:19 +01:00
Alexander M. Turek c7e612d4ad [EventDispatcher] Deprecate LegacyEventDispatcherProxy. 2019-12-15 23:54:05 +01:00
Nicolas Grekas cf45eeccfc [FrameworkBundle] Allow using a ContainerConfigurator in MicroKernelTrait::configureContainer() 2019-12-13 14:10:14 +01:00
Fabien Potencier ebb13e7c99 Deprecate *Response::create() methods 2019-12-03 07:30:08 +01:00
Valentin Udaltsov e641cbdd46 [Routing] Deprecate RouteCollectionBuilder 2019-11-25 13:05:32 +01:00