Commit Graph

40465 Commits

Author SHA1 Message Date
Fabien Potencier
83fec23d61 bug #30350 [VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning

| 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        | -

Fixes the root issue that led to https://github.com/symfony/symfony/pull/30311#issuecomment-466457434

Commits
-------

29a0683107 [VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning
2019-02-23 11:36:56 +01:00
Fabien Potencier
2e8bf334ca bug #30349 [VarDumper] fix dumping Ds maps and pairs (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[VarDumper] fix dumping Ds maps and pairs

| 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 https://github.com/symfony/symfony/pull/30311#issuecomment-466457434

![image](https://user-images.githubusercontent.com/243674/53267273-41260e80-36e3-11e9-8723-a73bf0690a01.png)

Commits
-------

45869ac10c [VarDumper] fix dumping Ds maps and pairs
2019-02-23 11:35:34 +01:00
Jonathan
47320a63e2 handles multi-byte characters in autocomplete 2019-02-23 14:31:39 +04:00
Fabien Potencier
e9a2c3d753 feature #30345 [Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler (lyrixx)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler

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

see also https://github.com/symfony/monolog-bundle/pull/297

from that:
![image](https://user-images.githubusercontent.com/408368/53246085-f63ed380-36af-11e9-9bff-2e42f8af141c.png)

to that:
![image](https://user-images.githubusercontent.com/408368/53246115-0787e000-36b0-11e9-93ef-e47ed058adbf.png)

with some configuration:

```yaml
diff --git a/config/packages/dev/monolog.yaml b/config/packages/dev/monolog.yaml
index b1998da..66ae2db 100644
--- a/config/packages/dev/monolog.yaml
+++ b/config/packages/dev/monolog.yaml
@@ -17,3 +17,6 @@ monolog:
             type: console
             process_psr_3_messages: false
             channels: ["!event", "!doctrine", "!console"]
+            console_formater_options:
+                format: "%%datetime%% %%start_tag%%%%level_name%%%%end_tag%% <comment>[%%channel%%]</> %%message%%%%context%%\n"
+                multiline: false
```

Commits
-------

5e494db04c [Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler
2019-02-23 11:19:35 +01:00
Fabien Potencier
9e4ff87214 minor #30356 [FrameworkBundle][SecurityBundle] speed up tests running them without debug flag (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle][SecurityBundle] speed up tests running them without debug flag

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

Commits
-------

dfb924f6a9 speed up tests running them without debug flag
2019-02-23 11:17:05 +01:00
Fabien Potencier
51499f4cec minor #30355 [Translations] added missing Croatian validators (antonioperic)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translations] added missing Croatian validators

| Q             | A
| ------------- | ---
| Branch?       | 3.4 up to 4.2 for bug fixes
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30167
| License       | MIT

[Validator] Add the missing translations for the Croatian ("hr") locale #30167

Commits
-------

b9ce861ff6 [Translations] added missing Croatian validators
2019-02-23 11:15:41 +01:00
Fabien Potencier
5f8aa34396 feature #30357 [TwigBridge] rename parent_form() to form_parent() (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[TwigBridge] rename parent_form() to form_parent()

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

We got some feedback on the blog post that form_parent() would be better
for consistency with all the existing form_*() functions. I think that
user has a point about that.

Commits
-------

057d177378 rename parent_form() to form_parent()
2019-02-23 11:12:29 +01:00
Christian Flothmann
dfb924f6a9 speed up tests running them without debug flag 2019-02-23 11:01:03 +01:00
Christian Flothmann
057d177378 rename parent_form() to form_parent()
We got some feedback on the blog post that form_parent() would be better
for consistency with all the existing form_*() functions. I think that
user has a point about that.
2019-02-23 10:52:13 +01:00
Antonio Peric
b9ce861ff6
[Translations] added missing Croatian validators 2019-02-23 10:13:05 +01:00
Christian Flothmann
d7aaa615b9 deprecate the Role and SwitchUserRole classes 2019-02-23 00:57:00 +01:00
André R
178506e72c Fix getItems() performance issue with RedisCluster (php-redis)
On any kind of multi loads, including tags loading, current code leads to
an explosion of Redis lookups slowing down performance.

This backports the code for mget() usage from 4.x in order to fix it.
It's done with one small improvment which would also be relevant for 4.x,
only using pipeline on cluster on predis as mget is more efficient.
2019-02-22 22:23:30 +01:00
Nicolas Grekas
29a0683107 [VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning 2019-02-22 21:52:27 +01:00
Nicolas Grekas
45869ac10c [VarDumper] fix dumping Ds maps and pairs 2019-02-22 21:35:02 +01:00
Fabien Potencier
5ad1f370b0 minor #30344 be keen to newcomers (OskarStark)
This PR was merged into the 3.4 branch.

Discussion
----------

be keen to newcomers

| 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    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/11036

Commits
-------

c008ee046a be keen to newcomers
2019-02-22 19:41:32 +01:00
Nicolas Grekas
b4f6c345ad feature #30257 [DependencyInjection] Allow to choose an index for tagged collection (deguif, XuruDragon)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[DependencyInjection] Allow to choose an index for tagged collection

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

This is the continuity of the PR #29598

Add a way to specify an index based on a tag attribute when injecting a tag collection into services, but also a a way to fallback to a static method on the service class.

```yaml
services:
  foo_service:
    class: Foo
    tags:
      - foo
  foo_service_tagged:
    class: Bar
    arguments:
      - !tagged
          tag: 'foo'
          index_by: 'tag_attribute_name'
          default_index_method: 'static_method'
```
```xml
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
  <services>
    <service id="foo" class="Foo">
        <tag name="foo_tag" />
    </service>
    <service id="foo_tagged_iterator" class="Bar" public="true">
      <argument type="tagged" tag="foo_tag" index-by="tag_attribute_name" default-index-method="static_method" />
    </service>
  </services>
</container>
```

Tasks

* [x]  Support PHP loader/dumper
* [x]  Support YAML loader/dumper
* [x]  Support XML loader/dumper (and update XSD too)
* [x]  Add tests
* [x]  Documentation

Commits
-------

101bfd79bf [DI] change name to tag + add XMl support + adding yaml/xml tests
845d3a681b Allow to choose an index for tagged collection
2019-02-22 15:50:40 +01:00
Christian Flothmann
6a43e74828 IntegerType: reject submitted non-integer numbers 2019-02-22 15:45:47 +01:00
Oskar Stark
c008ee046a be keen to newcomers 2019-02-22 15:44:53 +01:00
Anthony MARTIN
101bfd79bf [DI] change name to tag + add XMl support + adding yaml/xml tests 2019-02-22 14:36:50 +01:00
Grégoire Pineau
5e494db04c [Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler 2019-02-22 14:32:09 +01:00
François-Xavier de Guillebon
845d3a681b Allow to choose an index for tagged collection 2019-02-22 11:27:55 +01:00
Nicolas Grekas
fec0475e8c feature #30311 [VarDumper] Implement DsCaster (enumag)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[VarDumper] Implement DsCaster

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

When dumping the data structures from [Ds extension](http://php.net/manual/en/book.ds.php) Symfony only shows the class name but not the actual data. So in this PR I tried to write a Caster for these data structures.

Map can't be simply casted to array because it can contain objects as keys so I dump the pairs instead.

Commits
-------

eab631fc45 [VarDumper] Implement DsCaster
2019-02-22 09:46:13 +01:00
Nicolas Grekas
848a83078c bug #30327 [HttpKernel] Fix possible infinite loop of exceptions (enumag)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Fix possible infinite loop of exceptions

| 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        |

I ran into an [issue](https://github.com/php-enqueue/enqueue-dev/issues/774) in the enqueue library which copied this part of code from Symfony. I'm now starting to understand what the problem is and it should most likely be fixed in Symfony as well.

I didn't actually run into it in Symfony itself but it seems at least hypothetically possible. Imagine if [here](8c3dc8254a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php (L77)) `$e` is somehow the same (===) as `$exception`. The code [below](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php#L82-L92) will then find the last exception in the `getPrevious()` chain and assigns `$exception` as the previous. However in the off chance that `$exception` is actually `$e` (the first exception in the chain) then it creates an infinite loop of exceptions which is not good for monolog and exception handlers.

What do you think?

Commits
-------

3447222b68 [HttpKernel] Fix possible infinite loop of exceptions
2019-02-22 09:41:30 +01:00
Nicolas Grekas
f7f31b2f3f minor #30330 [FrameworkBundle] fix lowest supported Routing component version (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[FrameworkBundle] fix lowest supported Routing component version

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

Commits
-------

715cf8db81 fix lowest supported Routing component version
2019-02-22 09:40:48 +01:00
Christian Flothmann
715cf8db81 fix lowest supported Routing component version 2019-02-21 13:27:02 +01:00
Jáchym Toušek
3447222b68
[HttpKernel] Fix possible infinite loop of exceptions 2019-02-21 13:02:05 +01:00
Fabien Potencier
7b4f4bfd47 fixed CS 2019-02-21 11:18:37 +01:00
Fabien Potencier
5ac4c2abf5 bug #27601 [Routing] fix URL generation with look-around requirements (nasimnabavi)
This PR was merged into the 3.4 branch.

Discussion
----------

[Routing] fix URL generation with look-around requirements

| Q             | A
| ------------- | ---
| Branch?       | 2.8 up to 4.1 for bug fixes
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10548
| License       | MIT
| Doc PR        |

If you have a non-catchable pattern in requirements like f.e. a positive lookahead (.+(?=/foo/)), the generator will not accept the parameter as the parameter itself cannot fulfil the requirement, but only matches in the context of the entire path.
This fix looks for lookAround in the path and ignores checking the requirements if any lookAround exists.

Commits
-------

c474451176 [Routing] fix URL generation with look-around requirements
2019-02-21 11:17:01 +01:00
Fabien Potencier
5a3e894203 feature #27570 [PropertyInfo] Added support for extract type from default value (tsantos84)
This PR was squashed before being merged into the 4.3-dev branch (closes #27570).

Discussion
----------

[PropertyInfo] Added support for extract type from default value

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

Added support for extract type from property's default value.

```php

class Dummy
{
    private $age = 30;
}

$types = $propertyInfo->getTypes('Dummy', 'age');

/*
  Example Result
  --------------
  array(1) {
    [0] =>
    class Symfony\Component\PropertyInfo\Type (6) {
      private $builtinType          => string(3) "int"
      private $nullable             => bool(false)
      private $class                => 'Dummy'
      private $collection           => bool(false)
      private $collectionKeyType    => NULL
      private $collectionValueType  => NULL
    }
  }
*/
```

Commits
-------

f6510cda40 [PropertyInfo] Added support for extract type from default value
2019-02-21 11:10:14 +01:00
tsantos
f6510cda40 [PropertyInfo] Added support for extract type from default value 2019-02-21 11:10:02 +01:00
Fabien Potencier
4e1ad10d91 feature #28919 [DX][WebProfilerBundle] Add Pretty Print functionality for Request Content (SamFleming)
This PR was squashed before being merged into the 4.3-dev branch (closes #28919).

Discussion
----------

[DX][WebProfilerBundle] Add Pretty Print functionality for Request Content

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

## Why?
Quite often when attempting to debug issues with JSON requests sent to a Symfony API, I use the Web Profiler to check the request content. More often than not the request content isn't easily readable (99% of the time it's all stuck on a single line and impossible to read). I always find myself copying + pasting the content into a random online tool to have it "pretty-print" the JSON.

Usually this isn't an issue, but can be annoying when offline. There's also the security issue of sending entire JSON payloads to a third-party server just for formatting 😳. Alternatively, maybe developers  copy+paste into their chosen editors and this PR is all a waste of time — I hope not 😛.

## How?
This PR adds "Pretty-Print" JSON functionality straight into the profiler.

We can use `collector.requestheaders` to detect if the request was JSON and conditionally show the Pretty Print button.

When the button is clicked, we format the JSON from the "Request Content" card.

## What does it look like?
Before:
![without-pretty-print](https://user-images.githubusercontent.com/573318/47180751-36b0ce00-d319-11e8-86ed-eb0d78ebcbe3.png)

After:
![pretty](https://user-images.githubusercontent.com/573318/47180763-3c0e1880-d319-11e8-995d-eba565aad827.png)

Non-JSON Requests (unchanged):
![non-json-request](https://user-images.githubusercontent.com/573318/47181080-03227380-d31a-11e8-8cf2-e8b2e8c1a21d.png)

## Things to consider

- Is `JSON.stringify(JSON.parse(content));` the safest, most efficient way to do this?
- Should the "Pretty Print" button be in-line next to the "Request Content" header? I couldn't find a pattern for this sort of thing elsewhere in the profiler.
- Do people want JSON formatted with 4 spaces, would 2 spaces be preferred? Should this be a configuration option stored in localStorage (such as the light/dark theme configuration)?
- Should this be a toggle? E.g. click to pretty print, then click to undo

## Future Improvements

Depending on how this is received it could be extended to support formatting different request content-types (e.g. XML formatting) — I assume.

## Progress

- [x] Gather feedback and decide where to perform the pretty-print: [server-side, or client-side](https://github.com/symfony/symfony/pull/28919#issuecomment-431508361).
*It was decided server-side would be better.*

Commits
-------

9f85103151 [DX][WebProfilerBundle] Add Pretty Print functionality for Request Content
2019-02-21 10:57:57 +01:00
Sam Fleming
9f85103151 [DX][WebProfilerBundle] Add Pretty Print functionality for Request Content 2019-02-21 10:57:48 +01:00
Christian Flothmann
93c2feb7b3 feature #28723 [Form] deprecate custom formats with HTML5 widgets (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] deprecate custom formats with HTML5 widgets

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

Commits
-------

b70c1b6e0d deprecate custom formats with HTML5 widgets
2019-02-21 10:41:31 +01:00
Fabien Potencier
3560cfdebe feature #29865 [Console] Added suggestions for missing packages (przemyslaw-bogusz)
This PR was squashed before being merged into the 4.3-dev branch (closes #29865).

Discussion
----------

[Console] Added suggestions for missing packages

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

Currently, when someone runs one of the most common commands, e.g. `server:run`, but does not have a required package installed, they will get a general **'There are no commands defined...'** message.

This commit adds a more useful message, informing the user about a package that might be missing and suggesting a command that should be run in order to install it, e.g. `composer require symfony/web-server-bundle --dev`.

Commits
-------

423a54f46e [Console] Added suggestions for missing packages
2019-02-21 10:36:22 +01:00
Przemysław Bogusz
423a54f46e [Console] Added suggestions for missing packages 2019-02-21 10:36:15 +01:00
Fabien Potencier
cbe8cff882 feature #30301 [VarDumper] add link to source next to class names (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[VarDumper] add link to source next to class names

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

This PR adds a `^` next to language identifiers (class and callback names) both on the Web and on the CLI. Clicking it opens the IDE to the target source code:

Eg in the profiler:
![image](https://user-images.githubusercontent.com/243674/53021031-900c4380-3458-11e9-9439-260ff11f0910.png)

And in the CLI:
![image](https://user-images.githubusercontent.com/243674/53021092-b16d2f80-3458-11e9-9f03-cdab59da4585.png)

Commits
-------

5fcd6b1d4e [VarDumper] add link to source next to class names
2019-02-21 10:23:57 +01:00
Fabien Potencier
8c3dc8254a minor #30326 Additional addons for the ghost (przemyslaw-bogusz)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Additional addons for the ghost

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

Following #30236 I've prepared two additional addons for the ghost.

The first one will display a plus on February 29, to indicate it's a leap year.
![ghost-plus](https://user-images.githubusercontent.com/35422131/53133091-3730ce00-3572-11e9-89f7-44568d796f7e.png)

The second one will display a gift on October 18, to indicate it's Symfony's birthday.
![ghost-gift](https://user-images.githubusercontent.com/35422131/53133127-5596c980-3572-11e9-8901-704785e235a8.png)

I would just like to point out that the addons are purely for fun, to amuse every hardcoding Symfony developer and offer a chance to smile on these few selected occasions.

Commits
-------

51ed942ef5 Additional addons for the ghost
2019-02-21 10:03:39 +01:00
Fabien Potencier
4b5661769d minor #30243 [Validator] Added missing translations for Afrikaans (Chris Tiearney)
This PR was squashed before being merged into the 3.4 branch (closes #30243).

Discussion
----------

[Validator] Added missing translations for Afrikaans

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

Added missing translations for Afrikaans

Commits
-------

8a931576d2 [Validator] Added missing translations for Afrikaans
2019-02-21 10:00:18 +01:00
Chris Tiearney
8a931576d2 [Validator] Added missing translations for Afrikaans 2019-02-21 10:00:09 +01:00
Fabien Potencier
ff4b1d4bff bug #30277 [Console] Prevent ArgvInput::getFirstArgument() from returning an option value (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Prevent ArgvInput::getFirstArgument() from returning an option value

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

Fixes the case where the passed input string contains no command name but one or more global (i.e. application-defined) options accepting values.

Commits
-------

46461e91f9 [Console] Prevent ArgvInput::getFirstArgument() from returning an option value
2019-02-21 09:51:54 +01:00
Fabien Potencier
ba725c2d70 feature #30225 publish message with custom queue options : flags | attributes (fedor.f, insidestyles)
This PR was merged into the 4.3-dev branch.

Discussion
----------

publish message with custom queue options : flags | attributes

| 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 | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

option for publish persistent message:
`amqp://localhost/%2f/messages?queue[attributes][delivery_mode]=2&queue[flags]=1`
or
options:
>queue:
>>name: '%env(MESSENGER_QUEUE)%'
>>routing_key: '%env(MESSENGER_ROUTING_KEY)%'
>>attributes:
>>>delivery_mode: 2

>>flags: 1

Commits
-------

5e16053c70 update test case for custom queue options
4532319520 publish message with custom queue options : update ConnectionTest
6f9fdaf7e4 publish message with custom queue options : flags | attributes
2019-02-21 09:34:03 +01:00
Fabien Potencier
68d5597125 bug #29981 [Security] Complain about an empty decision strategy (corphi)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Complain about an empty decision strategy

| 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        | -

When an empty string is passed (or objects with a similarly behaving `__toString()` method) to the constructor, the call to `decide` causes infinite recursion.

Commits
-------

3a22cad29b Fix infinite recursion when passed an empty string
2019-02-21 09:28:33 +01:00
Fabien Potencier
2e6d0698f5 feature #30249 [Routing] deprecate some router options (Tobion)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Routing] deprecate some router options

| 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 | https://github.com/symfony/symfony/pull/28865#issuecomment-463480970
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- 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.
-->

Commits
-------

bf4cd6164d [Routing] deprecate some router options
2019-02-21 09:24:00 +01:00
Fabien Potencier
da16b9c49b bug #29822 [EventDispatcher] Fix unknown priority (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[EventDispatcher] Fix unknown priority

| 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 -->

Somehow, after #29411 the profiler actually shows the security firewall `ContextListener`.

This listener removes itself at call time, but at this point it's wrapped reference is already in the call stack; to be displayed in the profiler.

Because the wrapped listener lazily collects its priority - it asks it from the dispatcher -  we get null; the listener was already removed.

This causes the profiler to render `-` by default:

![image](https://user-images.githubusercontent.com/1047696/50850320-d5c5ee80-1379-11e9-8516-0c6bc54512ce.png)

This fixes it by always passing the expected priority at call time.

Commits
-------

9fb619ac62 [EventDispatcher] Fix unknown priority
2019-02-21 09:22:09 +01:00
Fabien Potencier
6207f19317 feature #30267 [Form] add option to render NumberType as type="number" (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] add option to render NumberType as type="number"

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

Commits
-------

42e8f5e3a2 add option to render NumberType as type="number"
2019-02-21 09:19:09 +01:00
Christian Flothmann
b70c1b6e0d deprecate custom formats with HTML5 widgets 2019-02-21 08:51:58 +01:00
Fabien Potencier
eb7a612763 minor #30319 [Console] Doc Block: More intuitive usage example in ArrayInput. (mattjanssen)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Doc Block: More intuitive usage example in ArrayInput.

Make the ArrayInput doc block example more self-explanatory and less misleading. Show the common use case of having `command`, and replace the confusing `name` argument with something more arbitrary.

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

The current doc block example for `ArrayInput` seems to imply that the command name goes in as `name`, but this is actually just a random argument, named "name", in this case.
```php
new ArrayInput(['name' => 'foo', '--bar' => 'foobar']);
```

It might be more helpful to provide an example that works with Symfony's `Console` component out of the box, as that is a common use case:
```php
new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']);
```

Commits
-------

0c8d311657 Update usage example in ArrayInput doc block.
2019-02-21 08:45:12 +01:00
Fabien Potencier
02d6c0f22f feature #28969 [Form] deprecate using invalid names for buttons (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] deprecate using invalid names for buttons

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

Commits
-------

405aa548eb deprecate using invalid names for buttons
2019-02-21 08:40:33 +01:00
Fabien Potencier
a67441ab1f bug #30324 [Validator] Fixed duplicate UUID (ralfkuehnel)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Fixed duplicate UUID

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

Fixes the `TOO_HIGH_ERROR` constant had the same value in two different constraints: `LessThan` and `LessThanOrEqual`.

Commits
-------

0bd5dd84ef [Validator] Fixed duplicate UUID
2019-02-21 08:36:17 +01:00
Christian Flothmann
191403119c bug #30265 [Form] do not validate non-submitted form fields in PATCH requests (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] do not validate non-submitted form fields in PATCH requests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11493, #19788, #20805, #24453, #30011
| License       | MIT
| Doc PR        |

When a form field is not embedded as part of a HTTP PATCH requests, its
validation constraints configured through the `constraints` option must
not be evaluated. The fix from #10567 achieved this by not mapping their
violations to the underlying form field. This however also means that
constraint violations caused by validating the whole underlying data
object will never cause the form to be invalid. This breaks use cases
where some constraints may, for example, depend on the value of other
properties that were changed by the submitted data.

Commits
-------

a60d802619 do not validate non-submitted form fields in PATCH requests
2019-02-21 08:31:48 +01:00