Commit Graph

34911 Commits

Author SHA1 Message Date
Fabien Potencier
e69d1cb38d minor #32441 [PHPUnit Bridge] Spell "triggering" properly (greg0ire)
This PR was merged into the 4.3 branch.

Discussion
----------

[PHPUnit Bridge] Spell "triggering" properly

As a side effect, the property name matches the one in the declaration,
which was correct.

| Q             | A
| ------------- | ---
| Branch?       | 4.3 for bug fixes
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

cad5f9a106 Spell "triggering" properly
2019-07-09 09:10:48 +02:00
Amrouche Hamza
41de6333db
[Lock][Console] bump lock requirement in console 2019-07-09 09:02:15 +02:00
Fabien Potencier
342461014e minor #32449 [Lock] minor: add missing alias for PersistStoreInterface (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] minor: add missing alias for PersistStoreInterface

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | todo <!-- 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/roadmap):
 - 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.
-->

Add missing alias highlited by @jderusse in order to do:
```
public function __construct(PersistStoreInterface $store) {}
```

Commits
-------

f1e98f2a10 [Lock] minor: add missing alias for PersistenStoreInterface
2019-07-09 08:52:26 +02:00
Amrouche Hamza
f1e98f2a10
[Lock] minor: add missing alias for PersistenStoreInterface 2019-07-09 08:33:03 +02:00
Fabien Potencier
4078686d3e feature #32446 [Lock] rename and deprecate Factory into LockFactory (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] rename and deprecate Factory into LockFactory

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes<!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none  <!-- #-prefixed issue number(s), if any -->
| 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/roadmap):
 - 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.
-->
As highlighted in https://github.com/symfony/symfony/pull/32198#pullrequestreview-255808664 we need to rename the factory to LockFactory for consistency and readability.

Commits
-------

fc75eb9bef [Lock] rename and deprecate Factory into LockFactory
2019-07-09 08:22:23 +02:00
Arman
e9abc7d654 Improve fa translations 2019-07-09 08:19:25 +02:00
Fabien Potencier
37756d3b22 minor #32432 [DependencyInjection] Added tests to cover the possibility of having scalars as services (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[DependencyInjection] Added tests to cover the possibility of having scalars as services

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32411
| License       | MIT
| Doc PR        | N/A

Commits
-------

60939d988d Added tests to cover the possibility of having scalars as services.
2019-07-09 08:16:48 +02:00
Fabien Potencier
de710f6640 feature #31975 Dynamic bundle assets (garak)
This PR was squashed before being merged into the 4.4 branch (closes #31975).

Discussion
----------

Dynamic bundle assets

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no (new method in interface as annotation)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29213
| License       | MIT
| Doc PR        | none (yet)

Everything is explained in linked issue

Commits
-------

c16fcc93e2 Dynamic bundle assets
2019-07-09 08:13:12 +02:00
Massimiliano Arione
c16fcc93e2 Dynamic bundle assets 2019-07-09 08:12:54 +02:00
Amrouche Hamza
fc75eb9bef
[Lock] rename and deprecate Factory into LockFactory 2019-07-09 07:41:12 +02:00
Nicolas Grekas
4a50400d3d minor #32377 [Debug] Restoring back the state of the Debug component (1st step) (yceruto)
This PR was squashed before being merged into the 4.4 branch (closes #32377).

Discussion
----------

[Debug] Restoring back the state of the Debug component (1st step)

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

After a good discussion with @nicolas-grekas, we made the decision to split the current `ErrorCatcher` component into several:
 * `ErrorHandler` it would be the Debug component before these changes https://github.com/symfony/symfony/pull/31065, with everything related to ErrorHandler, Debug, DebugClassLoader classes and change its name.
 * `ErrorDumper` it would be the current ErrorCatcher but with FlattenException + the new error renderer system only.

This is the first step, then we can deprecate everything for the Debug component in favor of the ErrorHandler and ErrorDumper components, **BUT without moving any code !!**, that would give us more freedom to do it correctly in the new components.

NOTE: For this PR I've copy the `Debug` component directory from the revision prior to merged commit  https://github.com/symfony/symfony/pull/31065 in 4.4 branch.

Commits
-------

eda49e295e [Debug] Restoring back the state of the Debug component (1st step)
2019-07-09 07:29:33 +02:00
Yonel Ceruto
eda49e295e [Debug] Restoring back the state of the Debug component (1st step) 2019-07-09 07:29:09 +02:00
Ryan Weaver
90d1b059fd Adding missing event_dispatcher wiring for messenger.middleware.send_message 2019-07-08 13:53:30 -04:00
Grégoire Paris
cad5f9a106
Spell "triggering" properly
As a side effect, the property name matches the one in the declaration,
which was correct.
2019-07-08 19:17:40 +02:00
Maxime Steinhausser
c1bfaa1de4 [Serializer] XmlEncoder: don't cast padded strings 2019-07-08 17:39:29 +02:00
Amrouche Hamza
2c5089b235
[Lock] Fix tests 2019-07-08 16:26:57 +02:00
Alexander M. Turek
60939d988d Added tests to cover the possibility of having scalars as services. 2019-07-08 16:11:17 +02:00
Fabien Potencier
29654a4c02 feature #32429 [VarDumper] Let browsers trigger their own search on double CMD/CTRL + F (ogizanagi)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] Let browsers trigger their own search on double CMD/CTRL + F

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #29748   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Simple way to enhance DX & mitigate #29748

Commits
-------

d2430584cd [VarDumper] Let browsers trigger their own search on double CMD/CTRL + F hit
2019-07-08 15:41:43 +02:00
Fabien Potencier
d9aace2db3 fixed CS 2019-07-08 15:38:56 +02:00
Fabien Potencier
608d428160 feature #32198 [Lock] Split "StoreInterface" into multiple interfaces with less responsability (Simperfit)
This PR was squashed before being merged into the 4.4 branch (closes #32198).

Discussion
----------

[Lock] Split "StoreInterface" into multiple interfaces with less responsability

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | Contribute to #28694 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | TODO <!-- 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/roadmap):
 - 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.
-->

We are removing the StoreInterface in order to split into multiple interface, it will help reduce de responsability of the StoreInterface.

Firstly, since not all stores needs to have all the methods of the StoreInterface, we can split this like this in order to limit the methods that are needed for each store.

Secondly, we add supportsX methods in order to avoid throwing exception when a store does not supports a feature it's easier an instance of the special interface or not, and it can return true/false on the support method.

**Really big thanks to** @jderusse for working with me on this, 1-2 hours of talking together, and another 1-2 hours of pre-review :). now giving it to the whole community !

*some time has been sponsored by* @izisolutions

Commits
-------

91fcbea977 [Lock] Split \"StoreInterface\" into multiple interfaces with less responsability
2019-07-08 15:38:00 +02:00
Amrouche Hamza
91fcbea977 [Lock] Split \"StoreInterface\" into multiple interfaces with less responsability 2019-07-08 15:37:49 +02:00
Maxime Steinhausser
d2430584cd [VarDumper] Let browsers trigger their own search on double CMD/CTRL + F hit 2019-07-08 15:18:18 +02:00
Fabien Potencier
350ec6cc7e minor #32428 [Stopwatch] Fix missing deprecations (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[Stopwatch] Fix missing deprecations

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

Fix https://github.com/symfony/symfony/pull/32408

Commits
-------

527bf89a27 Fix missing deprecations
2019-07-08 15:06:45 +02:00
Fabien Potencier
e1cea970c0 feature #31511 [Validator] Allow to use property paths to get limits in range constraint (Lctrs)
This PR was squashed before being merged into the 4.4 branch (closes #31511).

Discussion
----------

[Validator] Allow to use property paths to get limits in range constraint

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

Similar as #22576, but for the `Range` constraint.

Commits
-------

2b509904c8 [Validator] Allow to use property paths to get limits in range constraint
2019-07-08 15:05:23 +02:00
Lctrs
2b509904c8 [Validator] Allow to use property paths to get limits in range constraint 2019-07-08 15:04:44 +02:00
Yonel Ceruto
527bf89a27 Fix missing deprecations 2019-07-08 08:57:32 -04:00
Fabien Potencier
5328c4b552 fixed tests on old PHP versions 2019-07-08 14:55:32 +02:00
Fabien Potencier
fea98a8473 bug #31620 [FrameworkBundle] Inform the user when save_path will be ignored (gnat42)
This PR was squashed before being merged into the 3.4 branch (closes #31620).

Discussion
----------

[FrameworkBundle] Inform the user when save_path will be ignored

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no  / maybe??
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31611
| License       | MIT

When a project is created, framework.yaml or config.yml has handler_id set to ~. This uses the native php SessionHandler object which is instantiated with the save_path setting from php.ini or php-fpm.d/www.conf. If you set a save_path, it is silently ignored. When using mod_php for apache or php-fpm running as apache/nginx this is typically not a big deal (except your session files are stored someplace other than you actually wanted). However if using php-fpm and running as a non-standard user for the distro, it will fail silently. Sessions won't be saved because the setting has no effect. This throws a warning in those cases to inform the user.

_It could be a BC because it changes the default configuration however fixes a 'long standing bug' if you will. Not sure what you want to do about that part._

Commits
-------

a0901294d4 [FrameworkBundle] Inform the user when save_path will be ignored
2019-07-08 14:54:13 +02:00
Nathanael d. Noblet
a0901294d4 [FrameworkBundle] Inform the user when save_path will be ignored 2019-07-08 14:54:05 +02:00
Fabien Potencier
2d04e20e7e bug #32056 [DI] deprecate booting the kernel twices (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] deprecate booting the kernel twices

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #31233   <!-- #-prefixed issue number(s), if any -->
| 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/roadmap):
 - 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.
-->

This adds a check to see if the kernel has been booted twices in a single test, and throw a deprecation

Commits
-------

905bec4577 [DI] throw an exception when the kernel has been booted twices
2019-07-08 14:22:23 +02:00
Fabien Potencier
bd498f2503 fixed CS 2019-07-08 13:57:06 +02:00
Fabien Potencier
931965a448 bug #32096 Don't assume port 0 for X-Forwarded-Port (alexbowers, xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

Don't assume port 0 for X-Forwarded-Port

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | none added
| Fixed tickets |
| License       | MIT
| Doc PR        | -

If you use X-Forwarded-Host but don't provide X-Forwarded-Port, it will default to `0.0.0.0:` which then assumes port `0` instead of following its default assumption based on the scheme.

Commits
-------

adcdd938a4 PHP 5 compat
6c49a0c758 Add test case
c266d6c737 Update Request.php
23db9be884 Don't assume port 0 for X-Forwarded-Port
2019-07-08 13:55:51 +02:00
Fabien Potencier
98bbc57e95 bug #31820 [SecurityBundle] Fix profiler dump for non-invokable security listeners (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[SecurityBundle] Fix profiler dump for non-invokable security listeners

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Listeners can be any callable since 4.3.

Commits
-------

f7738d934b [SecurityBundle] Fix profiler dump for non-invokable security listeners
2019-07-08 13:31:38 +02:00
Robin Chalas
f7738d934b [SecurityBundle] Fix profiler dump for non-invokable security listeners 2019-07-08 12:43:35 +02:00
Fabien Potencier
ea0da05cd6 feature #32424 [Console] don't redraw progress bar more than every 100ms by default (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] don't redraw progress bar more than every 100ms by default

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no (behavior change)
| BC breaks?    | no (behavior change)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Follow up of https://github.com/symfony/symfony/pull/26339
Looks like something we can and should do on 4.4 to me.

Commits
-------

df551e945c [Console] don't redraw progress bar more than every 100ms by default
2019-07-08 12:34:39 +02:00
Nicolas Grekas
df551e945c [Console] don't redraw progress bar more than every 100ms by default 2019-07-08 12:29:08 +02:00
Fabien Potencier
7647209b9a feature #32418 [Console] Added Application::reset() (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Added Application::reset()

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

Symfony leaks a lot in CLI when using the EventDispatcher. I'm working on it.

But instead of fixing the root cause, it can be legit to go quick and to reset all services.
So IMHO, this services should be exposed, and always available

Commits
-------

15ba5791cd [Console] Added Application::reset()
2019-07-08 12:10:30 +02:00
Fabien Potencier
400eaa676a feature #31217 [WebserverBundle] Deprecate the bundle in favor of symfony local server (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebserverBundle] Deprecate the bundle in favor of symfony local server

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | to do <!-- required for new features -->

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Since most of the feature added to the symfony local server (using php-fpm) will be handy for all developers and as said in https://github.com/symfony/symfony/issues/25748#issuecomment-485740082, I agree that we should deprecate the WebserverBundle in favor of the [Symfony Local Server](https://symfony.com/doc/current/setup/symfony_server.html) cc @stof @fabpot

Commits
-------

7307907585 [WebserverBundle] Deprecate the bundle in favor of symfony local server
2019-07-08 11:58:44 +02:00
Grégoire Pineau
15ba5791cd [Console] Added Application::reset() 2019-07-08 11:58:42 +02:00
Fabien Potencier
87a6f04409 feature #31554 [SECURITY] AbstractAuthenticationListener.php error instead info. Rebase of #28462 (berezuev)
This PR was merged into the 4.4 branch.

Discussion
----------

[SECURITY] AbstractAuthenticationListener.php error instead info. Rebase of #28462

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

Rebase of #28462. Origin description:
> ```
> [2018-09-13 20:43:38] security.INFO: Authentication request failed. {"exception":"[object] (Symfony\\Component\\Security\\Core\\Exception\\AuthenticationServiceException(code: 0): An exception occurred while executing
>  ...
>  Doctrine\\DBAL\\Driver\\PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.phone' in 'field list' at
> ```
>
> Definitely I think this is NOT info, but error.
> And since it's info, it's not logged in production because of `fingers_crossed` with `action_level: error` - so to actually see the real error behind `Authentication request could not be processed due to a system problem.` I had to debug on production. Very bad practice IMHO.

Commits
-------

867eb78cfe [SECURITY] AbstractAuthenticationListener.php error instead info. Rebase of #28462
2019-07-08 11:56:07 +02:00
Fabien Potencier
14614bd895 feature #32284 [Cache] Add argument $prefix to AdapterInterface::clear() (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] Add argument $prefix to AdapterInterface::clear()

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

This PR allows clearing `AdapterInterface` implementations by prefix of keys. The goal is to fix an edge case situation in `ProxyAdapter`: right now, when one calls `->clear()` on a proxy adapter that is configured to add a prefix to all the keys passed to the decorated pool, we clear it all; while only the subset that starts with the prefix should be.

Since `AdapterInterface` is an "internal" interface (ie its purpose is to create compatible implementations - *NOT* to be type-hinted for), this is not really a user-facing change.

/cc @Nyholm, this came out after we talked about proxified chain pools

Commits
-------

ad6f6cf900 [Cache] Add argument $prefix to AdapterInterface::clear()
2019-07-08 11:50:54 +02:00
Fabien Potencier
3e2ee71bcb feature #32423 [ServerBundle] Display all logs by default (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[ServerBundle] Display all logs by default

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

Instead of relying on `-vvv` behavior, we display all logs.
End user has two ways of filtering now:

* with the `--filter` options
* by configuring the handler in `config/dev/monolog.yaml`

Commits
-------

54b0809d2c [ServerBundle] Display all logs by default
2019-07-08 11:44:22 +02:00
Amrouche Hamza
7307907585
[WebserverBundle] Deprecate the bundle in favor of symfony local server 2019-07-08 11:40:47 +02:00
Fabien Potencier
c202e96cd6 feature #26339 [Console] Add ProgressBar::preventRedrawFasterThan() and forceRedrawSlowerThan() methods (ostrolucky)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Add ProgressBar::preventRedrawFasterThan() and forceRedrawSlowerThan() methods

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | TBA

The way ProgressBar redraw frequency works currently requires to know speed of progress beforehand, which is impossible to know in some situations, e.g. when showing progress of download, or I/O speed. Setting frequency too low relative to progress speed throttles I/O speed and makes progress bar flicker too much, setting it too high makes progress bar unresponsive. Current behaviour IMHO undermines usefulness of ProgressBar.

This is an attempt to replace this with more consistent experience, not requiring to know speed of progress.)

Commits
-------

83edac321e [Console] Add ProgressBar::preventRedrawFasterThan() and forceRedrawSlowerThan() methods
2019-07-08 11:29:00 +02:00
Fabien Potencier
853e032c19 fixed CS 2019-07-08 11:24:04 +02:00
Ben Davies
213dfd1492 [Messenger] Doctrine Transport: Support setting auto_setup from DSN 2019-07-08 11:23:12 +02:00
Alexey Berezuev
867eb78cfe [SECURITY] AbstractAuthenticationListener.php error instead info. Rebase of #28462 2019-07-08 12:18:00 +03:00
Grégoire Pineau
54b0809d2c [ServerBundle] Display all logs by default
Instead of relying on `-vvv` behavior, we display all logs.
End user has two ways of filtering now (instead of 3 previously):

* with the `--filter` options
* by configuring the handler in `config/dev/monolog.yaml`
2019-07-08 11:06:24 +02:00
Stadly
dc31739288 [Translator] Dump native plural formats to po files 2019-07-08 10:26:08 +02:00
Fabien Potencier
feab919c86 bug #31267 [Translator] Load plurals from mo files properly (Stadly)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translator] Load plurals from mo files properly

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/10152#issuecomment-55522675
| License       | MIT
| Doc PR        |

Plurals were not handled correctly when loading mo files.
```
msgid "foo"
msgid_plural "foos"
msgstr[0] "bar"
msgstr[1] "bars"
```

Before, the mo entry above was treated as two entries, which doesn't make sense:
```
'foo' => 'bar'
'foos' => '{0} bar|{1} bars'
```

With this PR, it is treated as one entry:
```
'foo|foos' => 'bar|bars'
```

This PR does the same as #31266, just for mo files instead of po files. Note, however, that the old behavior differed between po and mo files: `'foos' => 'bar|bars'` for po files and `'foos' => '{0} bar|{1} bars'` for mo files.

Commits
-------

97d28b5e4e Load plurals from mo files properly
2019-07-08 10:22:53 +02:00
Fabien Potencier
9fc8d2ec63 bug #31266 [Translator] Load plurals from po files properly (Stadly)
This PR was squashed before being merged into the 3.4 branch (closes #31266).

Discussion
----------

[Translator] Load plurals from po files properly

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/10152#issuecomment-55522675
| License       | MIT
| Doc PR        |

Plurals were not handled correctly when loading po files.
```
msgid "foo"
msgid_plural "foos"
msgstr[0] "bar"
msgstr[1] "bars"
```

Before, the po entry above was treated as two entries, which doesn't make sense:
```
'foo' => 'bar'
'foos' => 'bar|bars'
```

With this PR, it is treated as one entry:
```
'foo|foos' => 'bar|bars'
```

Commits
-------

6b69a99230 [Translator] Load plurals from po files properly
2019-07-08 10:21:27 +02:00
Stadly
6b69a99230 [Translator] Load plurals from po files properly 2019-07-08 10:21:19 +02:00
Amrouche Hamza
cb2d97f92b [Ldap][Security] LdapBindAuthenticationProvider does not bind before search query 2019-07-08 10:00:03 +02:00
Fabien Potencier
950db8e85b fixed CS 2019-07-08 09:52:12 +02:00
Fabien Potencier
088270ebbd feature #31626 [Console] allow answer to be trimmed by adding a flag (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] allow answer to be trimmed by adding a flag

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/11603 <!-- 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/roadmap):
 - 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 the master branch.
-->

According to https://github.com/symfony/symfony/issues/23210#issuecomment-495998087 we add a new flag in the `Question` class to be able to not trim the answer.

Commits
-------

8f182d811e [Console] allow answer to be trimmed by adding a flag
2019-07-08 09:51:32 +02:00
Fabien Potencier
6b8d4aa57e bug #32383 [Serializer] AbstractObjectNormalizer ignores the property types of discriminated classes (sandergo90)
This PR was merged into the 4.2 branch.

Discussion
----------

[Serializer] AbstractObjectNormalizer ignores the property types of discriminated classes

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27607
| License       | MIT
| Doc PR        |

As discusses in ticket #27607, when using a discriminator map and the symfony serializer, things go wrong when having two classes in the discriminator map having the same property name. When the function ```validateAndDenormalize``` is called, the function ```getTypes``` would be called with the wrong class name.

If you take a look at the ```getTypes``` function below, I'm not even sure if we still need the part of the discriminator at this place because we already passed the class name of the discriminated class.

```
    /**
     * @return Type[]|null
     */
    private function getTypes(string $currentClass, string $attribute)
    {
        if (null === $this->propertyTypeExtractor) {
            return null;
        }

        if (null !== $types = $this->propertyTypeExtractor->getTypes($currentClass, $attribute)) {
            return $types;
        }

        if (null !== $this->classDiscriminatorResolver && null !== $discriminatorMapping = $this->classDiscriminatorResolver->getMappingForClass($currentClass)) {
            if ($discriminatorMapping->getTypeProperty() === $attribute) {
                return [
                    new Type(Type::BUILTIN_TYPE_STRING),
                ];
            }

            foreach ($discriminatorMapping->getTypesMapping() as $mappedClass) {
                if (null !== $types = $this->propertyTypeExtractor->getTypes($mappedClass, $attribute)) {
                    return $types;
                }
            }
        }

        return null;
    }
```

Commits
-------

9fc56c7e28 [Serializer]: AbstractObjectNormalizer ignores the property types of discriminated classes
2019-07-08 09:44:03 +02:00
Fabien Potencier
8b439ee031 fixed CS 2019-07-08 09:43:01 +02:00
Fabien Potencier
dc56389b03 feature #31876 [WebProfilerBundle] Add clear button to ajax tab (Matts)
This PR was squashed before being merged into the 4.4 branch (closes #31876).

Discussion
----------

[WebProfilerBundle] Add clear button to ajax tab

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31839
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

For pages that have been open for a long time, the profiler ajax tab can start filling up fast. In #31839 the request to allow the history to be cleared with one click.

The reason why I did not align the button to the right, is because after looking at the other tabs. None of them had items that were aligned to the right. Moved the addEventListener above the ajax tab logic to keep the code consistent.

Ps. Please be nice, this is my first contribution 🍰

<!--
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):
 - 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
-------

6bff4db6d3 [WebProfilerBundle] Add clear button to ajax tab
2019-07-08 09:42:34 +02:00
Matthew Smeets
6bff4db6d3 [WebProfilerBundle] Add clear button to ajax tab 2019-07-08 09:42:23 +02:00
Sander
9fc56c7e28 [Serializer]: AbstractObjectNormalizer ignores the property types of discriminated classes
Add tests

Remove test group

Allow null

Add quux null attribute

Add quux value to serialize test
2019-07-08 09:31:20 +02:00
Fabien Potencier
a22eeb3fff fixed deprecation message 2019-07-08 09:23:44 +02:00
Fabien Potencier
499ad6df0d minor #32408 [Stopwatch] Deprecate passing null in Section::get() method. (jschaedl)
This PR was merged into the 4.4 branch.

Discussion
----------

[Stopwatch] Deprecate passing null in Section::get() method.

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32179<!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This PR is related to https://github.com/symfony/symfony/pull/32242

Commits
-------

ea4817677b [Stopwatch] Deprecate passing null in Section::get() method.
2019-07-08 09:21:34 +02:00
Fabien Potencier
a640c30df2 feature #32415 [Translation] deprecate passing a null locale (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translation] deprecate passing a null locale

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | not needed <!-- 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/roadmap):
 - 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.
-->

According to the discussion in https://github.com/symfony/symfony/pull/32386#discussion_r300590343 it seems that allowing null here was not the right thing to do, so we are deprecating this behaviour.

Commits
-------

088615ddaf [Translation] deprecate passing a null locale
2019-07-08 08:50:08 +02:00
Amrouche Hamza
088615ddaf
[Translation] deprecate passing a null locale 2019-07-08 08:40:36 +02:00
Fabien Potencier
166502c714 minor #32417 [Intl] Remove --dev from intl compile autoloader (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Remove --dev from intl compile autoloader

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Remove implicit composer default (`jakzal/php-intl` uses latest composer during compile)

Commits
-------

8ffc61692d [Intl] Remove --dev from intl compile autoloader
2019-07-08 08:36:40 +02:00
Fabien Potencier
51cf65e4ba feature #32290 [HttpClient] Add $response->toStream() to cast responses to regular PHP streams (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Add $response->toStream() to cast responses to regular PHP streams

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

This PR adds `$response->toStream()` to cast responses to regular PHP streams, and uses the method in `Psr18Client` and `HttplugClient`.

This means `Psr18Client` and `HttplugClient` will now be lazy past response headers. I'm not sure any other PSR-18 implementation has this behavior. :)

This also adds `StreamWrapper::createResource()` to turn any `ResponseInterface` implementation into a PHP stream.

/cc @Nyholm FYI since we discussed about this recently.

Commits
-------

a59e0af24a [HttpClient] Add $response->toStream() to cast responses to regular PHP streams
2019-07-08 08:35:40 +02:00
Fabien Potencier
4ef1f2fa8d minor #32385 Fix CS regarding nullable arguments (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

Fix CS regarding nullable arguments

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Let's keep our CS consistent.

Commits
-------

ec5d7346b3 Fix CS regarding nullable arguments
2019-07-08 08:24:29 +02:00
Fabien Potencier
bb9251a42a bug #32413 [Messenger] fix publishing headers set on AmqpStamp (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] fix publishing headers set on AmqpStamp

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        |

Dispatching a message using an AmqpStamp and setting extra headers with it didn't work. We need to merge the `$attribute['headers']`, not the attributes itself as that will ignore the stamp headers because it's not recursive.
I also made the AmqpStamp a NonSendableStampInterface because it's pointless to serialize the stamp because the stamp already set's the attributes for publishing.

Commits
-------

50b3ec4dc5 [Messenger] fix publishing headers set on AmqpStamp
2019-07-08 08:20:10 +02:00
Fabien Potencier
6a1be4c3c7 minor #32401 [Intl] Init compile tmp volume (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Init compile tmp volume

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Fixes

```
Symfony\Component\Filesystem\Exception\IOException: Failed to create "/tmp/icu-data": mkdir(): Permission denied.
```

if the initial volume does not exists docker creates it as root, but the container runs for the current user.

Commits
-------

5e26d96a6b [Intl] Init compile tmp volume
2019-07-08 08:16:38 +02:00
Fabien Potencier
a731c3b410 bug #32384 [Mime] add check for openssl when using SMime (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] add check for openssl when using SMime

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

Should also make tests green for the component on Windows.

Commits
-------

f33c67bfc1 [Mime] add check for openssl when using SMime
2019-07-08 08:15:12 +02:00
Grégoire Pineau
5249eaf9d5 [EventDispatcher] Add tag kernel.rest on 'debug.event_dispatcher' service 2019-07-08 08:06:11 +02:00
Fabien Potencier
c03415d4e5 feature #32402 [Intl] Exclude root language (ro0NL)
This PR was squashed before being merged into the 4.4 branch (closes #32402).

Discussion
----------

 [Intl] Exclude root language

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Spotted in #32388

Commits
-------

089cc06c3a  [Intl] Exclude root language
2019-07-08 07:53:32 +02:00
Roland Franssen
089cc06c3a [Intl] Exclude root language 2019-07-08 07:53:15 +02:00
Amrouche Hamza
ff0c14171b
[Console] Update to inherit and add licence 2019-07-08 07:40:49 +02:00
Alexis Lefebvre
0c326d0b55 Add missing test for workflow dump description 2019-07-08 07:36:18 +02:00
Roland Franssen
8ffc61692d
[Intl] Remove --dev from intl compile autoloader 2019-07-07 09:15:14 +02:00
Tobias Schultze
50b3ec4dc5 [Messenger] fix publishing headers set on AmqpStamp 2019-07-07 01:21:29 +02:00
Tobias Schultze
52e8523f4a bug #32398 [Messenger] Removes deprecated call to ReflectionType::__toString() on MessengerPass (brunowowk)
This PR was merged into the 4.2 branch.

Discussion
----------

[Messenger] Removes deprecated call to ReflectionType::__toString() on MessengerPass

Closes #32397

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32397
| License       | MIT
| Doc PR        | -

Removes deprecated call to ReflectionType::__toString() for 7.4 support

Commits
-------

0c52a531e2 Remove call to deprecated method
2019-07-06 21:00:30 +02:00
Bruno Nogueira Nascimento Wowk
0c52a531e2 Remove call to deprecated method 2019-07-06 14:57:33 -03:00
Jan Schädlich
ea4817677b [Stopwatch] Deprecate passing null in Section::get() method. 2019-07-06 16:19:02 +02:00
Roland Franssen
5e26d96a6b [Intl] Init compile tmp volume 2019-07-06 10:17:29 +02:00
Tobias Schultze
6811aaa8e0 Merge branch '4.3' into 4.4 2019-07-05 23:02:06 +02:00
Tobias Schultze
d27c5307f0 Merge branch '4.2' into 4.3 2019-07-05 23:01:41 +02:00
Tobias Schultze
6a1bae27d1 fix merge 2019-07-05 22:59:32 +02:00
Tobias Schultze
5cf221707f Merge branch '3.4' into 4.2 2019-07-05 22:53:03 +02:00
Tobias Schultze
42899cdd67 feature #32295 [FrameworkBundle] Add autowiring alias for PSR-14 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Add autowiring alias for PSR-14

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

Commits
-------

2d5bcda9e7 [FrameworkBundle] Add autowiring alias for PSR-14
2019-07-05 21:50:21 +02:00
Alexander M. Turek
e110603e5e Don't pass objects as class name to ContainerBuilder::register. 2019-07-05 21:20:21 +02:00
Alexander M. Turek
edfc9d6f34 Deprecated passing Parameter instances as class name to Definition. 2019-07-05 21:06:26 +02:00
Christian Flothmann
416502df4e pass default cache lifetime as an integer 2019-07-05 12:25:01 +02:00
Robin Chalas
7f4368114c bug #32379 [SecurityBundle] conditionally register services (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] conditionally register services

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32342
| License       | MIT
| Doc PR        |

Commits
-------

8fbcdf250e conditionally register services
2019-07-05 11:26:59 +02:00
Nicolas Grekas
f33c67bfc1 [Mime] add check for openssl when using SMime 2019-07-05 09:42:08 +02:00
Nicolas Grekas
ec5d7346b3 Fix CS regarding nullable arguments 2019-07-05 09:04:50 +02:00
Nicolas Grekas
09e3cef7a0 Merge branch '4.3' into 4.4
* 4.3:
  [PhpUnitBridge] fix running simple-phpunit on Windows
  fixed phpdocs
  [Messenger] fix broken key normalization
2019-07-05 08:35:10 +02:00
Nicolas Grekas
b78816d647 Merge branch '4.2' into 4.3
* 4.2:
  [PhpUnitBridge] fix running simple-phpunit on Windows
  fixed phpdocs
2019-07-05 08:35:01 +02:00
Nicolas Grekas
44e82520ee Merge branch '3.4' into 4.2
* 3.4:
  [PhpUnitBridge] fix running simple-phpunit on Windows
  fixed phpdocs
2019-07-05 08:33:37 +02:00
Nicolas Grekas
d9833ace32 [PhpUnitBridge] fix running simple-phpunit on Windows 2019-07-05 08:33:19 +02:00
Nicolas Grekas
a59e0af24a [HttpClient] Add $response->toStream() to cast responses to regular PHP streams 2019-07-05 07:37:18 +02:00
Fabien Potencier
b515107870 feature #32106 [FrameworkBundle] Use default_locale as default value for translator.fallbacks (dunglas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Use default_locale as default value for translator.fallbacks

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Simplify translator's config:

Before:

```yaml
    default_locale: fr
    translator:
        default_path: '%kernel.project_dir%/translations'
        fallbacks:
            - fr
```

After:

```yaml
    default_locale: fr
    translator:
        default_path: '%kernel.project_dir%/translations'
```

Commits
-------

e0ef35973d [FrameworkBundle] Use default_locale as default value for translator.fallbacks
2019-07-05 07:36:15 +02:00
Fabien Potencier
77747a9472 fixed phpdocs 2019-07-05 06:54:49 +02:00
Fabien Potencier
d292b133a5 minor #32382 Fix phpdocs (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix phpdocs

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Backported from #32286

<!--
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):
 - 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
-------

4acddef91b fixed phpdocs
2019-07-05 06:53:43 +02:00
Fabien Potencier
4acddef91b fixed phpdocs 2019-07-05 06:51:06 +02:00
Fabien Potencier
a672bbc209 feature #32294 [FrameworkBundle] Allow creating chained cache pools by providing several adapters (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Allow creating chained cache pools by providing several adapters

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

Replaces #30984, follows https://github.com/symfony/symfony-docs/pull/11813

This PR allows defining several adapters for one pool. When doing so, this defines a chain pool.
The benefit is that all chained pools get automatic namespace and lifetime, so things are transparent:

```yaml
pools:
    my_chained_pool:
        default_lifetime: 12
        adapters:
          - cache.adapter.array
          - cache.adapter.filesystem
          - {name: cache.adapter.redis, provider: 'redis://foo'}
```

(see fixtures for example of PHP/XML config)

/cc @Nyholm @pborreli FYI

Commits
-------

29ba091898 [FrameworkBundle] Allow creating chained cache pools by providing several adapters
2019-07-05 06:43:41 +02:00
Yonel Ceruto
08aa16f729 minor #32369 [ErrorCatcher] Fixed some escaping in error renderers (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorCatcher] Fixed some escaping in error renderers

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | -
| License       | MIT
| Doc PR        | not needed

Fixes this: https://github.com/symfony/symfony/pull/32364/files#r300394620

Commits
-------

1413bdc [ErrorCatcher] Fixed some escaping in XML errors
2019-07-04 17:25:02 -04:00
Javier Eguiluz
1413bdcab8 [ErrorCatcher] Fixed some escaping in XML errors 2019-07-04 17:23:09 -04:00
Christian Flothmann
adcdd938a4 PHP 5 compat 2019-07-04 23:04:55 +02:00
Tobias Schultze
9931b3e183 [Messenger] fix broken key normalization 2019-07-04 22:25:02 +02:00
Christian Flothmann
8fbcdf250e conditionally register services 2019-07-04 21:53:41 +02:00
Nicolas Grekas
29ba091898 [FrameworkBundle] Allow creating chained cache pools by providing several adapters 2019-07-04 19:09:10 +02:00
Nicolas Grekas
2f6c7c507f Merge branch '4.3' into 4.4
* 4.3:
  bump phpunit-bridge cache ids
2019-07-04 19:07:39 +02:00
Nicolas Grekas
511fc93640 Merge branch '4.2' into 4.3
* 4.2:
  bump phpunit-bridge cache ids
2019-07-04 19:07:21 +02:00
Nicolas Grekas
e30800df2c Merge branch '3.4' into 4.2
* 3.4:
  bump phpunit-bridge cache ids
2019-07-04 19:06:45 +02:00
Nicolas Grekas
ea34d6dcf5 bump phpunit-bridge cache ids 2019-07-04 19:06:26 +02:00
Nicolas Grekas
6ab0488a54 [Messenger] fix missing dep 2019-07-04 18:31:08 +02:00
Nicolas Grekas
910db453f3 Merge branch '4.3' into 4.4
* 4.3:
  [Bridge/PhpUnit] fix running composer to install phpunit
2019-07-04 18:10:48 +02:00
Nicolas Grekas
1e6231b41d Merge branch '4.2' into 4.3
* 4.2:
  [Bridge/PhpUnit] fix running composer to install phpunit
2019-07-04 18:10:28 +02:00
Nicolas Grekas
e0850631fc Merge branch '3.4' into 4.2
* 3.4:
  [Bridge/PhpUnit] fix running composer to install phpunit
2019-07-04 18:09:15 +02:00
Nicolas Grekas
af850146a4 [Bridge/PhpUnit] fix running composer to install phpunit 2019-07-04 18:09:01 +02:00
Yonel Ceruto
0151279cfe minor #32359 [ErrorCatcher] Pretty print JSON formatted errors (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorCatcher] Pretty print JSON formatted errors

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | not needed

A long string with JSON contents is not very useful to quickly parse the error contents, so I propose to "pretty print" the JSON errors.

Commits
-------

ab926d2 [ErrorCatcher] Pretty print JSON formatted errors
2019-07-04 11:27:52 -04:00
Javier Eguiluz
ab926d2065 [ErrorCatcher] Pretty print JSON formatted errors 2019-07-04 11:24:36 -04:00
Nicolas Grekas
b9b03fe1d3 Merge branch '4.3' into 4.4
* 4.3:
  [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass
  [FrameworkBundle] reset cache pools between requests
2019-07-04 15:46:31 +02:00
Nicolas Grekas
f59bc48850 Merge branch '4.2' into 4.3
* 4.2:
  [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass
  [FrameworkBundle] reset cache pools between requests
2019-07-04 15:45:39 +02:00
Nicolas Grekas
e9852bd9a1 Merge branch '3.4' into 4.2
* 3.4:
  [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass
  [FrameworkBundle] reset cache pools between requests
2019-07-04 15:45:20 +02:00
Nicolas Grekas
a383649ad7 bug #32363 [FrameworkBundle] reset cache pools between requests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] reset cache pools between requests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Looks like we missed this part: cache pools should all be reset between requests, at least to persist any deferred items. Replaces #32361 (which should be applied when merging 3.4 into 4.2).

Commits
-------

5ff45bac66 [FrameworkBundle] reset cache pools between requests
2019-07-04 15:42:09 +02:00
Nicolas Grekas
db05791ceb bug #32365 [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Spotted in and needed by #32294

Commits
-------

b06d0003a3 [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass
2019-07-04 15:33:02 +02:00
Nicolas Grekas
b06d0003a3 [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass 2019-07-04 11:26:59 +02:00
Nicolas Grekas
5ff45bac66 [FrameworkBundle] reset cache pools between requests 2019-07-04 11:11:41 +02:00
Fabien Potencier
e3927b6294 minor #32354 [Messenger] Use ConnectionRegistry instead of RegistryInterface (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Use ConnectionRegistry instead of RegistryInterface

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

This PR changes the constructor type-hint on `DoctrineTransportFactory` from `Symfony\Bridge\Doctrine\RegistryInterface` to the smaller `Doctrine\Common\Persistence\ConnectionRegistry`. Since we only call the `getConnection()` method, this interface is sufficient.

This change allows to use the factory without the Doctrine bridge and makes it easier to use it stand-alone.

Commits
-------

ce6a5ad235 Use ConnectionRegistry instead of RegistryInterface.
2019-07-04 09:48:35 +02:00
Fabien Potencier
b7c9fcf7a1 bug #32348 [HttpFoundation] Accept must take the lead for Request::getPreferredFormat() (dunglas)
This PR was squashed before being merged into the 4.4 branch (closes #32348).

Discussion
----------

[HttpFoundation] Accept must take the lead for Request::getPreferredFormat()

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Follow up PR to #32344: if both `Accept` and `Content-Type` are defined, `Accept` must take the lead because it explicitly tells what format the client expect as a response.

Before:

```
$ curl -H 'Accept: application/json' -H 'Content-Type: text/xml' -i 'https://127.0.0.1:8000/userinfo'

[snip]
content-type: text/xml
```

After:

```
$ curl -H 'Accept: application/json' -H 'Content-Type: text/xml' -i 'https://127.0.0.1:8000/userinfo'

[snip]
content-type: application/json
```

Actually, I'm not sure that inferring the content type of the response using the `Content-Type` provided for the request body is a good idea. The HTTP RFC explicitly states that `Accept` must be used to hint a preferred response format (`Content-Type` on the request indicates the type of associated its the body). I would be in favor of being more conservative: use `Accept` if provided (a best practice anyway), and fallback to the default value (HTML by default) otherwise. WDYT?

Commits
-------

60d997df75 [HttpFoundation] Accept must take the lead for Request::getPreferredFormat()
2019-07-04 09:46:57 +02:00
Kévin Dunglas
60d997df75 [HttpFoundation] Accept must take the lead for Request::getPreferredFormat() 2019-07-04 09:46:50 +02:00
Kévin Dunglas
cd0341e69b [FrameworkBundle] Allow to use the BrowserKit assertions with Panther and API Platform's test client 2019-07-04 08:46:07 +02:00
Alexander M. Turek
ce6a5ad235 Use ConnectionRegistry instead of RegistryInterface. 2019-07-04 02:03:26 +02:00
Fabien Potencier
b79a1bf229 Merge branch '4.3' into 4.4
* 4.3:
  Fixes windows error
  [Messenger] Added more test for MessageBus
  fixed typo
  [Filesystem] added missing deprecations to UPGRADE-4.3.md
  Fix authentication for redis transport
  only decorate when an event dispatcher was passed
  [FrmaeworkBundle] More simplifications in the DI configuration
  Fixing validation for messenger transports retry_strategy service key
  Removed unused field.
  Remove @internal annotations for the serilize methods
  [Lock] Stores must implement `putOffExpiration`
  Annotated correct return type for getInEdges()/getOutEdges().
  deprecate the framework.templating option
2019-07-03 19:15:45 +02:00
Fabien Potencier
98c36025cd Merge branch '4.2' into 4.3
* 4.2:
  Fixes windows error
  Removed unused field.
  [Lock] Stores must implement `putOffExpiration`
  Annotated correct return type for getInEdges()/getOutEdges().
2019-07-03 19:15:34 +02:00
Fabien Potencier
02a25fe518 Merge branch '3.4' into 4.2
* 3.4:
  Fixes windows error
  Annotated correct return type for getInEdges()/getOutEdges().
2019-07-03 19:14:02 +02:00
misterx
1f8927a9a6 Fixes windows error 2019-07-03 19:13:23 +02:00
Fabien Potencier
10449cb493 feature #32344 [HttpFoundation][HttpKernel] Improving the request/response format autodetection (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation][HttpKernel] Improving the request/response format autodetection

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

Mainly for API-based apps, currently the response header `Content-Type` (if no provided) is guessed based on the request format (`_format` attribute), falling back to `html` by default.

Especially for the new error renderer system, where any kind of error can occur and it becomes an http response, this PR improves this guesser mechanism by taking into account also the `Content-type` of the request.

Example:
```bash
$ curl -X POST -H 'Content-Type: application/json' -i 'https://127.0.0.1:8000/login'
```
**before:**
```bash
HTTP/2 500
cache-control: no-cache, private
content-type: text/html; charset=UTF-8 # <- inaccurate
...

{"title":"Internal Server Error","status":500,"detail":"Invalid credentials!"}
```
Most of the 3rd-party bundles that I know (`api-platform/core`, `FOSRestBundle`) need a dedicated listener to achieve it right.

**after:**
```bash
HTTP/2 500
cache-control: no-cache, private
content-type: application/json
...

{"title":"Internal Server Error","status":500,"detail":"Invalid credentials!"}
```
Of course, this applies to all kind of responses, as long as the `Content-Type` is not explicitly provided. So, as a last chance, the `Accept` heading of the request is also taken into account to detect the preferred format:
```bash
$ curl -H 'Accept: application/json' -i 'https://127.0.0.1:8000/userinfo'
HTTP/2 404
cache-control: no-cache, private
content-type: application/json
...

{"title":"Not Found","status":404,"detail":"No route found for \"GET \/userinfo\""}
```
They could be other places in the code where this new method could also be useful, please advise :)

WDYT?

Commits
-------

1952928471 Improving the request/response format autodetection
2019-07-03 19:09:44 +02:00
Yonel Ceruto
1952928471 Improving the request/response format autodetection 2019-07-03 12:46:41 -04:00
Fabien Potencier
c33c396a63 bug #32299 [Lock] Stores must implement putOffExpiration (jderusse)
This PR was merged into the 4.2 branch.

Discussion
----------

[Lock] Stores must implement `putOffExpiration`

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | /
| License       | MIT
| Doc PR        | /

Following https://github.com/symfony/symfony/pull/32198#pullrequestreview-256165051 every stores MUST implement the method `putOffExpiration` either by ignoring the arguments (by design they lock forever) or using a mechanism to define the expiration.

It was a mistake to add the dockblock `@throws NotSupportedException` tell me if it's a BC break, I'll create a dedicated PR for it.

Commits
-------

c986c86d1c [Lock] Stores must implement `putOffExpiration`
2019-07-03 18:27:50 +02:00
Fabien Potencier
50dfcaa8ef bug #32302 [Mime] Remove @internal annotations for the serialize methods (francoispluchino)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mime] Remove @internal annotations for the serialize methods

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes (it's not really a bug)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Currently, when we extend the `Symfony\Component\Mime\Message` and `Symfony\Component\Mime\MessageRaw` classes of the Mime component, we get 2 deprecation messages:

```
The "Symfony\Component\Mime\Message::__serialize()" method is considered internal. It may change without further notice. You should not extend it from "Vendor\FooMessage".
```
and
```
The "Symfony\Component\Mime\Message::__unserialize()" method is considered internal. It may change without further notice. You should not extend it from "Vendor\FooMessage".
```

However, we need to add properties to the new class, and so, we need to extend `__serialize()` and `__unserialize()` methods in the same way as `Symfony\Bridge\Twig\Mime\TemplatedEmail`, to know, retrieve the serialization of the parent class:

```php
    public function __serialize(): array
    {
        return [$this->foo, $this->bar, $this->baz, parent::__serialize()];
    }

    public function __unserialize(array $data): void
    {
        [$this->foo, $this->bar, $this->baz, $parentData] = $data;

        parent::__unserialize($parentData);
    }
```

But given that the third-party components use another namespace, we get the 2 deprecation messages, while the 2 methods must be inevitably used and extended. Of course, the methods `serialize()` and `unserialize()` are always marked by the `@internal` annotation and the `final` keyword.

This PR so deletes the 2 deprecation messages that should not be displayed.

Commits
-------

8544a35e52 Remove @internal annotations for the serilize methods
2019-07-03 18:27:00 +02:00
Fabien Potencier
f5a0633b40 minor #32338 [Messenger] Added more test for MessageBus (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Added more test for MessageBus

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

[This code](bed50fd542/src/Symfony/Component/Messenger/MessageBus.php (L33-L49)) is quite hard to understand. So It must be covered by tests.

More over, it will help people to understand how it works

Commits
-------

5f4ab23991 [Messenger] Added more test for MessageBus
2019-07-03 18:25:48 +02:00
Fabien Potencier
d65a5e26cf minor #32340 [Messager] Simplified MessageBus::__construct() (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messager] Simplified MessageBus::__construct()

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

The third path deals with generator (or other king of iterator that are

not an IteratorAggregate). It means, very few cases in practice

The previous code saved one object on the first call of `self::dispatch()`
by replacing it at runtime. More over, this object (anon. class) is very
light in memory.

The performance optimization (even if fun) is not useful here. Let's
make the code readable to everyone.

Commits
-------

6b5671f5ae [Messager] Simplified MessageBus::__construct()
2019-07-03 18:24:36 +02:00
Grégoire Pineau
6b5671f5ae [Messager] Simplified MessageBus::__construct()
The third path deals with generator (or other king of iterator that are
not an IteratorAggregate). It means, very few cases in practice

The previous code saved one object on the first call of `self::dispatch()`
by replacing it at runtime. More over, this object (anon. class) is very
light in memory.

The performance optimization (even if fun) is not useful here. Let's
make the code readable to everyone.
2019-07-03 15:46:19 +02:00
Fabien Potencier
2452ef8978 minor #32188 [PropertyInfo] add static cache to ContextFactory (bastnic)
This PR was merged into the 4.4 branch.

Discussion
----------

[PropertyInfo] add static cache to ContextFactory

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no (performance...)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32073, https://github.com/api-platform/api-platform/issues/1159
| License       | MIT
| Doc PR        | no

The issue is very very well described here #32073, and was also discussed a few weeks ago with @dunglas here https://github.com/api-platform/api-platform/issues/1159.

`ContextFactory::createFromReflector` is heavy, and it's called redundanlty
by `Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor` for each property
and methods. Avoid that by parsing it only once and then use static cache

This is a quite big performance problem.

![Deepin Capture-écran_zone de sélection _20190626142041](https://user-images.githubusercontent.com/84887/60179692-8471c480-981e-11e9-9e3c-3f9c0b83b01b.png)

Commits
-------

063e880861 [PropertyInfo] add static cache to ContextFactory
2019-07-03 15:36:04 +02:00
Fabien Potencier
df13b506eb feature #32231 [HttpClient] Add support for NTLM authentication (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Add support for NTLM authentication

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

Someone mentioned NTLM auth on Twitter, so here we are, this adds support for it.
Requires curl.

Commits
-------

548f4fd0ea [HttpClient] Add support for NTLM authentication
2019-07-03 15:28:45 +02:00
Fabien Potencier
6abaa8c5a2 feature #32265 [Validator] deprecate non-string constraint violation codes (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] deprecate non-string constraint violation codes

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

Commits
-------

e217729066 deprecate non-string constraint violation codes
2019-07-03 15:25:50 +02:00
Fabien Potencier
09e762e819 bug #32334 [Messenger] Fix authentication for redis transport (alexander-schranz)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fix authentication for redis transport

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32304
| License       | MIT
| Doc PR        | symfony/symfony-docs#... TODO

This will implement support for password in redis stream transport.

Commits
-------

bedae5dde9 Fix authentication for redis transport
2019-07-03 15:20:24 +02:00
Fabien Potencier
927a3341c0 minor #32281 [DependencyInjection] Annotated correct return type for getInEdges()/getOutEdges() (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[DependencyInjection] Annotated correct return type for getInEdges()/getOutEdges()

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

This changed annotation was quite helpful when analyzing `PhpDumper` for #32266.

Commits
-------

28882f52cb Annotated correct return type for getInEdges()/getOutEdges().
2019-07-03 15:17:20 +02:00
Fabien Potencier
4e32643bdf feature #31528 [Validator] Add a Length::$allowEmptyString option to reject empty strings (ogizanagi)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Add a Length::$allowEmptyString option to reject empty strings

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | Todo (change the warning on top of https://symfony.com/doc/current/reference/constraints/Length.html)

which defaults to `true` in 4.4 but will trigger a deprecation if not set explicitly
in order to make the default `false` in 5.0.

While it could be solved now thanks to #29641 by using both `@Length(min=1)` & `@NotBlank(allowNull=true)` constraints,
as expressed in https://github.com/symfony/symfony/issues/27876#issuecomment-403307783 and following comments, the `@Length(min=1)` behavior doesn't match our expectations when reading it: it feels logical to invalidate empty strings, but it actually doesn't.
Hence the proposal of making the behavior of rejecting empty strings the default in 5.0.

In my opinion, the flag could even be removed later.

Commits
-------

e113e7f812 [Validator] Add a Length::$allowEmptyString option to reject empty strings
2019-07-03 15:15:57 +02:00
Fabien Potencier
ea0656a4f4 minor #32305 [HttpKernel][DX] Improve the error message when not defining the controller as a service but using construct parameters (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel][DX] Improve the error message when not defining the controller as a service but using construct parameters

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | not needed <!-- 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/roadmap):
 - 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.
-->

I'm working with newcomers to the symfony framework ATM and one of them has got stuck in this errors trying to understand why the constructor argument declared as a a service would not work and didn't check if the controller was declared as a service itself.

I feel like this could be improve to be really specific since "such" is not that specific ;).

Commits
-------

c670d5120e [HttpKernel][DX] Improve the error message when not defining the controller as a service but using contruct parameters
2019-07-03 15:05:19 +02:00
Fabien Potencier
7b9c026153 feature #32081 [WIP][Mailer] Overwrite envelope sender and recipients from config (Devristo)
This PR was squashed before being merged into the 4.4 branch (closes #32081).

Discussion
----------

[WIP][Mailer] Overwrite envelope sender and recipients from config

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #31592 #31733   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

# Description

This MR adds the following configuration, example:

```yaml
# config/packages/mailer.yaml
framework:
  mailer:
    envelope:
      sender: 'sender@example.org'
      recipients: ['redirected@example.org']
```
In turn the `\Symfony\Component\Mailer\EventListener\EnvelopeListener` will be configured to alter the sender and recipient addresses before the message has been sent.

Note: it will only alter the envelope, thus rerouting the message to the correct mailbox. However the message itself will still have the original 'from' and 'to' headers.

# Todos

- [x] Alter configuration and dependency injection
- [x] Create test case
- [ ] Update XML config schema?
- [ ] Doc PR

<!--
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):
 - 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
-------

8e0c8006d8 [WIP][Mailer] Overwrite envelope sender and recipients from config
2019-07-03 14:59:34 +02:00