Commit Graph

39103 Commits

Author SHA1 Message Date
Darryl Hein
feba3816dc
remove unneeded tearDown method 2018-10-27 15:32:49 -06:00
Fabien Potencier
b6758e9614 feature #28985 [Messenger] Move MiddlewareTestCase in Test ns (ogizanagi)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] Move MiddlewareTestCase in Test ns

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

Just a quick suggestion after #28943 being merged. Wouldn't it make sense to move this in `Test` namespace to be used by anyone wanting to unit test their middleware?

Commits
-------

215c895a55 [Messenger] Move MiddlewareTestCase in Test ns
2018-10-27 20:08:52 +02:00
Maxime Steinhausser
215c895a55 [Messenger] Move MiddlewareTestCase in Test ns 2018-10-27 18:09:57 +02:00
Fabien Potencier
a33725f6ef feature #28892 [FrameworkBundle] Deprecate support for legacy directories in Translation comands (chalasr)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Deprecate support for legacy directories in Translation comands

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

Commits
-------

a7a8aad46f [FrameworkBundle] Deprecate support for legacy translations and views directories
2018-10-27 18:04:48 +02:00
Fabien Potencier
9bb60c9642 feature #28854 [VarDumper] Scroll into view when searching (ro0NL)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarDumper] Scroll into view when searching

| Q             | A
| ------------- | ---
| Branch?       | master
| 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 -->

This jumps to the found element when using the javascript widget for searching HTML dumps. Inspired by Ctrl+F in Chrome :)

It's super convenient with long dumps, however i wasnt able to position the search input on the right in a fixed manner... because CSS 😓 i was hoping @ogizanagi could add a patch for it.

Also see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView

Commits
-------

647a937abc [VarDumper] Scroll into view when searching
2018-10-27 18:01:10 +02:00
Fabien Potencier
c2478d4500 minor #28977 [Intl] Update the ICU data to 63.1 (jakzal)
This PR was squashed before being merged into the 3.4 branch (closes #28977).

Discussion
----------

[Intl] Update the ICU data to 63.1

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

http://site.icu-project.org/download/63

All tests are passing on the CI. I additionally run intl related tests (Form,Intl,Translation,Validator components) with ICU `63.1` on PHP `5.5`, `5.6`, `7.1`, `7.2`, `7.3-rc`.

Confirmed `@group intl-data` tests are passing with ICU `63.1` on PHP `5.5` and `7.2`.

Commits
-------

76bc6f0f28 [Intl] Update the ICU data to 63.1
2018-10-27 17:56:31 +02:00
Jakub Zalas
76bc6f0f28 [Intl] Update the ICU data to 63.1 2018-10-27 17:56:20 +02:00
Robin Chalas
a7a8aad46f [FrameworkBundle] Deprecate support for legacy translations and views directories 2018-10-27 16:37:38 +02:00
Fabien Potencier
c11fe350a8 bug #28999 [Messenger] Fix DoctrineTransactionMiddleware after MiddlewareInterface bc-break (skalpa)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] Fix DoctrineTransactionMiddleware after MiddlewareInterface bc-break

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

Fixes `DoctrineTransactionMiddleware` that got broken by #28983, and adds tests.

Commits
-------

378ca065d6 Fix DoctrineTransactionMiddleware after MiddlewareInterface bc-break
2018-10-27 08:55:40 +02:00
Fabien Potencier
c333d8569e feature #28997 [FrameworkBundle] Deprecating support for legacy translations directory (yceruto)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Deprecating support for legacy translations directory

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

Commits
-------

acdece7005 Deprecating support for legacy translations directory
2018-10-27 06:16:49 +02:00
Fabien Potencier
5c3d826e9b minor #28996 [FrameworkBundle] Fix broken exception message (chalasr)
This PR was merged into the 2.8 branch.

Discussion
----------

[FrameworkBundle] Fix broken exception message

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

![](https://i.imgur.com/GmBhlqv.png)

Commits
-------

8e9860ca8b [FrameworkBundle] Fix broken exception message
2018-10-27 06:07:42 +02:00
Pascal Luna
378ca065d6 Fix DoctrineTransactionMiddleware after MiddlewareInterface bc-break 2018-10-27 04:46:27 +01:00
Yonel Ceruto
acdece7005 Deprecating support for legacy translations directory 2018-10-26 17:45:01 -04:00
Robin Chalas
8e9860ca8b [FrameworkBundle] Fix broken exception message 2018-10-26 23:18:28 +02:00
Vladimir Reznichenko
b12c89d481 SCA: fixed broken tests 2018-10-26 17:01:50 +02:00
vladimir.reznichenko
42e96ff7a2 SCA: applied code style as per guidelines 2018-10-26 15:43:57 +02:00
vladimir.reznichenko
8dbd927a33 SCA: minor code tweaks 2018-10-26 15:40:38 +02:00
Fabien Potencier
031762e191 minor #28988 Remove reference to http digest authentication (SamFleming)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Remove reference to http digest authentication

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 |    <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | <!-- 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.
-->
Seeing as HTTP Digest has been deprecated / removed, the README shouldn't be advertising it as a feature.

This is especially important seeing as sites such as packagist display the README to advertise the features/usage of a package. See https://packagist.org/packages/symfony/security

Commits
-------

9702a212e2 Remove reference to http digest authentication
2018-10-26 10:51:06 +02:00
Samuel ROZE
d5771cc55e feature #28983 [Messenger] make dispatch(), handle() and send() methods return Envelope (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] make dispatch(), handle() and send() methods return Envelope

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

Follow up of #28909. We can do better than return `void`: let's return `Envelope`!
This means middleware and senders should also return `Envelope`, so that we can typically read back the stamps that were added during the sending process (eg to get the Kafka queue id).

ping @dunglas as we discussed that first on Slack, and @sroze as we confirmed interest IRL today.

(User handlers don't know anything about envelopes so they still should return `void` - use senders or middleware if you need to populate/read envelopes.)

Commits
-------

4b0e015402 [Messenger] make dispatch(), handle() and send() methods return Envelope
2018-10-26 10:30:00 +02:00
Sam Fleming
9702a212e2
Remove reference to http digest authentication
Seeing as HTTP Digest has been deprecated / removed, the README shouldn't be advertising it as a feature.
2018-10-26 09:20:42 +01:00
Nicolas Grekas
4b0e015402 [Messenger] make dispatch(), handle() and send() methods return Envelope 2018-10-26 10:10:48 +02:00
Fabien Potencier
08eaf18d99 feature #28533 [DotEnv] Add a new loadForEnv() method mimicking Ruby's dotenv behavior (dunglas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[DotEnv] Add a new loadForEnv() method mimicking Ruby's dotenv behavior

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? |no <!-- 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 | helps for symfony/recipes#465, symfony/recipes#408
| License       | MIT
| Doc PR        | todo

This PR adds a new `loadForEnv()` method that mimics the behavior of [Create React App](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#what-other-env-files-can-be-used), [Rails' DotEnv](https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use) and probably some other libs:

`DotEnv::loadForEnv()` will load the following files, starting from the bottom. The first value set (or those already defined in the environment) take precedence:

- `.env` - The Original®
- `.env.dev`, `.env.test`, `.env.prod`... - Environment-specific settings.
- `.env.local` - Local overrides. This file is loaded for all environments _except_ `test`.
- `.env.dev.local`, `.env.test.local`, `.env.prod.local`... - Local overrides of environment-specific settings.

The plan is to use this method in the default SF installation (symfony/recipes#466).

Commits
-------

774a78c8de [DotEnv] Add a new loadForEnv() method mimicking Ruby's dotenv behavior
2018-10-26 08:39:44 +02:00
Samuel ROZE
61ec2814f3 feature #28943 [Messenger] Add StackInterface, allowing to unstack the call stack (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] Add `StackInterface`, allowing to unstack the call stack

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

At the moment, debugging an exception coming from a middleware is not as friendly as it could: each middleware is preceded by a noisy frame added by the `$next` callable indirection.

This PR allows removing this frame by using `$next()->handle($envelope, $next);` instead of `$next($envelope);` in a middleware. Note that this is optional so that the later continues to work. But if one wants to opt-in for the former, then the stack trace of exceptions will be freed from `$next`.

All core middleware should do this, so here they are, updated.

Commits
-------

2bc7d11ad3 [Messenger] Add `StackInterface`, allowing to unstack the call stack
2018-10-25 18:53:20 +02:00
Nicolas Grekas
2bc7d11ad3 [Messenger] Add StackInterface, allowing to unstack the call stack 2018-10-25 18:34:40 +02:00
Fabien Potencier
dd31ca8984 bug #28967 [TwigBridge] Remove $rootDir argument in CodeExtension (ro0NL)
This PR was merged into the 4.2-dev branch.

Discussion
----------

 [TwigBridge] Remove $rootDir argument in CodeExtension

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | https://github.com/symfony/symfony-docs/pull/10547#issuecomment-432608538
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Forgotten in #28890

cc @javiereguiluz

Commits
-------

f8947242a9 [TwigBridge] Remove $rootDir argument in CodeExtension
2018-10-25 17:01:28 +02:00
Samuel ROZE
76b2541468 bug #28955 [Messenger] send using the routing_key for AMQP transport (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] send using the routing_key for AMQP transport

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

Shouldn't we publish using the routing_key that is used by the listening queue?

Commits
-------

666d2d962b [Messenger] send using the routing_key for AMQP transport
2018-10-25 16:30:32 +02:00
Nicolas Grekas
9c8d0999b3 minor #28980 [Messenger] If framework.messenger.buses.X.middleware is empty, it will be null (sroze)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] If `framework.messenger.buses.X.middleware` is empty, it will be `null`

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

Otherwise, it would fail with the following configuration:
```yaml
framework:
    messenger:
        buses:
            events_bus:
                middleware:
#                    - 'some_commented_middleware'
```

Commits
-------

91a70fcd6f If `framework.messenger.buses.X.middleware` is empty, it will be `null`
2018-10-25 15:39:52 +02:00
Fabien Potencier
39d081ec96 minor #28982 Fix typo in Messenger examples (gitomato)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Fix typo in Messenger examples

| Q             | A
| ------------- | ---
| Branch?       | master for features / 2.8 up to 4.1 for bug fixes <!-- see below -->
| Bug fix?      | no
| New feature?  | yes/no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes/no <!-- 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 | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Fixed a typo in UPGRADE-4.2.md.

Commits
-------

7da59432cd Fix typo in Messenger examples
2018-10-25 15:16:58 +02:00
Fabien Potencier
b01ea272ce feature #28860 [Form] Deprecate TimezoneType regions option (ro0NL)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Form] Deprecate TimezoneType regions option

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

I know i've added this option myself in 4.1, but given my recent development for #28624 i realized it's an opinionated feaure, which can/should be solved on user-side (`choice_filter/choice_loader` and/or `group_by`).

- blocks translations as we dont have them (see #28831)
- blocks possibility of switching to Intl zones which doesnt really have this filter feature (see #28836)

~While at it, i solved a few issues with `OptionsResolver` that is able to deprecate options as of 4.2 also.~ Fixed in #28878

- when resolved trigger the deprecation
- allow to opt-out from triggering the deprecation
- dont trigger deprecation for default values (only given ones)

Commits
-------

5cb532d2de [Form] Deprecate TimezoneType regions option
2018-10-25 15:13:24 +02:00
gitomato
7da59432cd
Fix typo in Messenger examples 2018-10-25 13:19:04 +02:00
Samuel ROZE
91a70fcd6f If framework.messenger.buses.X.middleware is empty, it will be null 2018-10-25 11:45:27 +02:00
Nicolas Grekas
666d2d962b [Messenger] send using the routing_key for AMQP transport 2018-10-25 11:24:34 +02:00
Samuel ROZE
5ae0e8910f feature #28945 [Messenger] remove AllowNoHandlerMiddleware in favor of a constructor argument on HandleMessageMiddleware (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] remove AllowNoHandlerMiddleware in favor of a constructor argument on HandleMessageMiddleware

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

`AllowNoHandlerMiddleware` adds a frame in the call stack but its concern should be handled by `HandleMessageMiddleware` to me, and `HandlerLocatorInterface::getHandler()` should not care about whether it's an error or not to not have a middleware (this makes it on par with `SenderLocator` in this regard.)

Commits
-------

aedb281b76 [Messenger] remove AllowNoHandlerMiddleware in favor of a constructor argument on HandleMessageMiddleware
2018-10-25 11:19:23 +02:00
Nicolas Grekas
aedb281b76 [Messenger] remove AllowNoHandlerMiddleware in favor of a constructor argument on HandleMessageMiddleware 2018-10-25 11:11:58 +02:00
Samuel ROZE
2b7ac81d9b feature #28947 [Messenger] remove classifying sub-namespaces in favor of semantic ones (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] remove classifying sub-namespaces in favor of semantic ones

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

While working on the component, I found it hard to discover the meaning of the `Asynchronous` and `Enhancers` sub-namespaces. Now that I know the component better, I understand they're only classifying namespaces with no specific technical semantics.

I'd like to remove them to make the component easier to discover.
This PR introduces a few new semantic sub-namespaces instead.

From the changelog:
  * Classes in the `Middleware\Enhancers` sub-namespace have been moved to the `Middleware` one
 * Classes in the `Asynchronous\Routing` sub-namespace have been moved to the `Transport\Sender\Locator` sub-namespace
 * The `Asynchronous/Middleware/SendMessageMiddleware` class has been moved to the `Middleware` namespace
 * `SenderInterface` and `ChainSender` classes have been moved to the `Transport\Sender` sub-namespace
 * `ReceiverInterface` and its implementations have been moved to the `Transport\Receiver` sub-namespace

Commits
-------

16afb5e2b4 [Messenger] remove classifying sub-namespaces in favor of semantic ones
2018-10-25 11:05:42 +02:00
Roland Franssen
5cb532d2de [Form] Deprecate TimezoneType regions option 2018-10-25 10:54:23 +02:00
Nicolas Grekas
16afb5e2b4 [Messenger] remove classifying sub-namespaces in favor of semantic ones 2018-10-25 09:48:15 +02:00
Roland Franssen
f8947242a9 [TwigBridge] Remove $rootDir argument in CodeExtension 2018-10-25 08:59:49 +02:00
Fabien Potencier
a6e4d4abef bug #28968 [OptionsResolver] Fixed explicitly ignores a depreciation (yceruto)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[OptionsResolver] Fixed explicitly ignores a depreciation

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

When a deprecated option with default value was resolved (the first time it's called) in this case through a lazy evaluation, [the default resolution process](8398947c9c/src/Symfony/Component/OptionsResolver/OptionsResolver.php (L771-L773)) takes the resolved value and here should also trigger only if the option was provided by the user or is being called from a lazy evaluation, otherwise ignore.

Commits
-------

8398947c9c Fixed explicitly ignores a depreciation
2018-10-25 08:35:35 +02:00
Yonel Ceruto
8398947c9c Fixed explicitly ignores a depreciation 2018-10-24 08:06:04 -04:00
Nicolas Grekas
d95cc4d4c6 [Translation] allow using the ICU message format using domains with the "+intl-icu" suffix 2018-10-24 12:49:53 +02:00
Nicolas Grekas
8c24c35fe8 minor #28965 [Process] pass all output to the wait-until callback (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Process] pass all output to the wait-until callback

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

Introduced yesterday, my bad.
Should make appveyor green hopefully.

Commits
-------

a320133b1d [Process] pass all output to the wait-until callback
2018-10-24 12:37:43 +02:00
Nicolas Grekas
a320133b1d [Process] pass all output to the wait-until callback 2018-10-24 12:10:48 +02:00
Kévin Dunglas
774a78c8de [DotEnv] Add a new loadForEnv() method mimicking Ruby's dotenv behavior 2018-10-24 11:38:56 +02:00
Nicolas Grekas
2edadf072f feature #27917 [Validator] catch any UnexpectedValueException on validation (xabbuh)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Validator] catch any UnexpectedValueException on validation

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

Commits
-------

fa3586029f catch any UnexpectedValueException on validation
2018-10-24 09:54:03 +02:00
Christian Flothmann
fa3586029f catch any UnexpectedValueException on validation 2018-10-24 09:52:19 +02:00
Fabien Potencier
3dda3cc5b3 bug #28960 also clean away the NO_AUTO_CACHE_CONTROL_HEADER if we have no session (dbu)
This PR was merged into the 4.1 branch.

Discussion
----------

also clean away the NO_AUTO_CACHE_CONTROL_HEADER if we have no session

| Q             | A
| ------------- | ---
| Branch?       | 4.1 (feature added in this branch)
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This header is not supposed to ever be exposed to clients of the application, but a hack to transfer information within the symfony application. This bugfix makes it so that we also remove the header when no session is started and thus no decision has to be taken whether to overwrite the caching instructions or not.

Commits
-------

28d9f0c84c also clean away the NO_AUTO_CACHE_CONTROL_HEADER if we have no session
2018-10-24 05:36:46 +02:00
Fabien Potencier
b452c015cc feature #28875 [FWBundle] Add a new method AbstractController::addLink() (dunglas)
This PR was squashed before being merged into the 4.2-dev branch (closes #28875).

Discussion
----------

[FWBundle] Add a new method AbstractController::addLink()

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      |no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- 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 | n/a   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | todo

This provides a convenient method to add `Link` headers to the current `Response` directly from the `Request` object.
It improves the developer experience and the discoverability of [the WebLink component](https://github.com/symfony/symfony-docs/pull/10309).

Usage:

```php
namespace App\Controller;

use Fig\Link\Link;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class MyAction extends AbstractController
{
    public function __invoke(Request $request): Response
    {
        $this->addLink($request, new Link('mercure', 'https://demo.mercure.rocks'));

        return $this->json(['foo' => 'bar']);
    }
}
```

Commits
-------

4d20c39f70 [FWBundle] Add a new method AbstractController::addLink()
2018-10-24 05:28:52 +02:00
Kévin Dunglas
4d20c39f70 [FWBundle] Add a new method AbstractController::addLink() 2018-10-24 05:28:45 +02:00
Fabien Potencier
9d3621eadb bug #28878 [OptionsResolver] Trigger deprecation only if the option is used (yceruto)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[OptionsResolver] Trigger deprecation only if the option is used

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

It's true that showing a deprecation message when the option is not used is a bit annoying and it would be heavy to get rid of it.

Now, a deprecated option is triggered only when it's provided by the user or each time is being called from a lazy evaluation (except for deprecations based on the value, they're triggered only when provided by the user).

Commits
-------

1af23c9a74 [OptionsResolver] Trigger deprecation only if the option is used
2018-10-24 05:25:07 +02:00