Commit Graph

41233 Commits

Author SHA1 Message Date
Fabien Potencier
04eed543af minor #30944 Fix Lock test suite (jderusse)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Fix Lock test suite

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

Commits
-------

1f66e7b2be Fix Lock test suite
2019-04-07 11:31:45 +02:00
Fabien Potencier
76906ab6e8 minor #30953 [Form] Refactor DefaultChoiceListFactory (vudaltsov)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] Refactor DefaultChoiceListFactory

| 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

A small optimization (remove unnecessary `foreach` calls) and a naming improvement.

ping @HeahDude , @stof

#EUFOSSA

Commits
-------

77424c8557 Refactor DefaultChoiceListFactory
2019-04-07 11:26:33 +02:00
Fabien Potencier
2b01eaaa30 feature #30862 [Routing] UrlHelper to get absolute URL for a path (vudaltsov)
This PR was squashed before being merged into the 4.3-dev branch (closes #30862).

Discussion
----------

[Routing] UrlHelper to get absolute URL for a path

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

I noticed that I need to generate absolute urls quite often. For example when normalizing uploads in API. I found Twig's `absolute_url()` really helpful, but obviously `Symfony\Bridge\Twig\Extension\HttpFoundationExtension` cannot be used as a normalizer's argument service.

In this PR I propose to extract `HttpFoundationExtension::generateAbsoluteUrl` and `HttpFoundationExtension::generateRelativePath` to separate interfaces which could be used on their own. Although this could be just a final class helper, I thought that we might leave a possibility for decoration here. That's why I created interfaces.

- [x] Split `HttpFoundationExtension` into two interfaces
- [x] Deprecate `HttpFoundationExtension::generateAbsoluteUrl` and `HttpFoundationExtension::generateRelativePath`
- [x] Add service definitions
- [x] Fix tests
- [ ] Add docs

Commits
-------

388d8f548c [Routing] UrlHelper to get absolute URL for a path
2019-04-07 11:25:07 +02:00
Valentin
388d8f548c [Routing] UrlHelper to get absolute URL for a path 2019-04-07 11:24:57 +02:00
Valentin
77424c8557 Refactor DefaultChoiceListFactory 2019-04-07 11:13:09 +02:00
Fabien Potencier
0d365a8c7f feature #30607 [Serializer] Add Support of recursive denormalization on object_to_populate (jewome62)
This PR was squashed before being merged into the 4.3-dev branch (closes #30607).

Discussion
----------

[Serializer] Add Support of recursive denormalization on object_to_populate

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

Currently the deserialization re-create new sub-object with object_to_populate.
This option permit to make object_to_populate recursive.

Commits
-------

5b723865b1 [Serializer] Add Support of recursive denormalization on object_to_populate
2019-04-07 11:04:56 +02:00
jewome62
5b723865b1 [Serializer] Add Support of recursive denormalization on object_to_populate 2019-04-07 11:04:49 +02:00
Fabien Potencier
9e2f506e37 bug #30939 [Validator] throw UnexpectedValueException instead (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Validator] throw UnexpectedValueException instead

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

#FOSSHackathons #EUFOSSA

Commits
-------

de12e2382e throw UnexpectedValueException instead
2019-04-07 10:55:57 +02:00
Jérémy Derussé
1f66e7b2be
Fix Lock test suite 2019-04-07 10:54:19 +02:00
Fabien Potencier
758f0285b0 minor #30938 [FrameworkBundle] drop not needed "constant" type argument (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[FrameworkBundle] drop not needed "constant" type argument

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

#FOSSHackathons #EUFOSSA

Commits
-------

faf629386e drop not needed "constant" type argument
2019-04-07 10:54:10 +02:00
Fabien Potencier
680074ddfd minor #30896 [HttpClient] Fix Notice on HttpClientTestCase::testTimeoutOnStream() (derrabus)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpClient] Fix Notice on HttpClientTestCase::testTimeoutOnStream()

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

When I run the test suite for the HTTP Client locally, I run into the following notice:

```
Notice: ob_flush(): failed to flush buffer. No buffer to flush in /path/to/symfony/src/Symfony/Contracts/HttpClient/Test/Fixtures/web/index.php on line 89
```

This PR aims to fix this.

`EUFOSSA`

Commits
-------

8acf29eaf5 There is no OB to flush.
2019-04-07 10:27:48 +02:00
Alexander M. Turek
8acf29eaf5 There is no OB to flush. 2019-04-07 10:26:05 +02:00
Fabien Potencier
e53f696a39 feature #30429 [Form] group_by as callback returns array (antonch1989)
This PR was squashed before being merged into the 4.3-dev branch (closes #30429).

Discussion
----------

[Form]  group_by as callback returns array

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

Commits
-------

4c04601036 [Form]  group_by as callback returns array
2019-04-07 10:22:34 +02:00
Anton Chernikov
4c04601036 [Form] group_by as callback returns array 2019-04-07 10:22:26 +02:00
Samuel ROZE
0b671aa30d minor #30947 [Messenger] DoctrineTransport - Use InvalidArgumentException instead of TransportException during configuration checks (vincenttouzet)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] DoctrineTransport - Use InvalidArgumentException instead of TransportException during configuration checks

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

As discussed with @weaverryan the exceptions thrown during the check of the configuration must be InvalidArgumentException instead of TransportException.

Commits
-------

e2dbe63489 [Messenger] DoctrineTransport - Use InvalidArgumentException instead of TransportException during configuration checks
2019-04-07 10:17:53 +02:00
Vincent Touzet
e2dbe63489 [Messenger] DoctrineTransport - Use InvalidArgumentException instead of TransportException during configuration checks 2019-04-07 09:39:29 +02:00
Nicolas Grekas
65b46a532c feature #30887 [FrameworkBundle] fix search in debug autowiring (sez-open)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[FrameworkBundle] fix search in debug autowiring

| 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 | #30493   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |

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

Taking #30522 and finishing it with @nicolas-grekas comments.
Is the sentence ok ?

Commits
-------

fec4beaffc fix debug:autowiringcommand
2019-04-07 09:30:18 +02:00
sez-open
fec4beaffc
fix debug:autowiringcommand 2019-04-07 09:27:26 +02:00
Grégoire Pineau
50c22b3d58 Fixed tests 2019-04-06 23:28:55 +02:00
Christian Flothmann
de12e2382e throw UnexpectedValueException instead 2019-04-06 23:02:44 +02:00
Christian Flothmann
faf629386e drop not needed "constant" type argument 2019-04-06 22:23:29 +02:00
Fabien Potencier
a84842b519 bug #30937 [Profiler] Fix graph text color (dFayet)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Profiler] Fix graph text color

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

#30450 introduces bad text color for graph items in the profiler, specially in dark theme mode.

### before/after

![Capture d’écran de 2019-04-06 21-38-29](https://user-images.githubusercontent.com/7721219/55674505-ff79ad80-58b5-11e9-9a29-8359ff07673d.png)

![Capture d’écran de 2019-04-06 21-42-26](https://user-images.githubusercontent.com/7721219/55674507-030d3480-58b6-11e9-8dee-395e2046e7ca.png)

There is a small change for default theme

### before/after

![Capture d’écran de 2019-04-06 21-51-46](https://user-images.githubusercontent.com/7721219/55674538-4ff10b00-58b6-11e9-8aed-2621bdde673d.png)

![Capture d’écran de 2019-04-06 21-52-15](https://user-images.githubusercontent.com/7721219/55674540-52ebfb80-58b6-11e9-9d94-68743187aba2.png)

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

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

44d9fbe995 Fix graph text color
2019-04-06 21:55:52 +02:00
dFayet
44d9fbe995 Fix graph text color 2019-04-06 21:48:09 +02:00
Fabien Potencier
fad7c8c01f feature #30935 Use env variable to create anytype of lock store (jderusse)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Use env variable to create anytype of lock store

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

In lock configuration, at the moment, env variable are only able to resolve DNS which are able to create RedisStore and MemcachedStore.

This PR update the StoreFactory to be able to also create connection at runtime.

Commits
-------

6b57ea996c Use env variable to create anytype of lock store
2019-04-06 21:40:22 +02:00
Jérémy Derussé
6b57ea996c
Use env variable to create anytype of lock store 2019-04-06 21:34:46 +02:00
Fabien Potencier
9afcc7b833 minor #30934 [Serializer] add return type hints for ObjectPropertyListExtractorInterface (dmaicher)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Serializer] add return type hints for ObjectPropertyListExtractorInterface

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

@nicolas-grekas as just discussed here the type-hint + phpdoc cleanup as follow-up for https://github.com/symfony/symfony/pull/30904 😉

cc @joelwurtz

Commits
-------

7628972285 [Serializer] add return type hints for ObjectPropertyListExtractorInterface
2019-04-06 21:25:56 +02:00
Fabien Potencier
f80df4cea5 feature #30932 [Validator] Add an option to disable NotCompromisedPasswordValidator (lyrixx)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Validator] Add an option to disable NotCompromisedPasswordValidator

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

EUFOSSA

Commits
-------

9a2787e89a [Validator] Add an option to disable NotCompromisedPasswordValidator
2019-04-06 21:23:33 +02:00
Fabien Potencier
e05aaf9207 feature #30909 [Translator] Add comments when dumping po files (deguif)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Translator] Add comments when dumping po files

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | ?    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #29962
| License       | MIT
| Doc PR        |

This code
```php
$catalogue = new MessageCatalogue('fr');
$dumper = new PoFileDumper();

$catalogue->set('key.one', 'First key', 'custom');
$catalogue->setMetadata('key.one', ['sources' => 'src/file_1', 'comments' => 'Comment', 'flags' => 'fuzzy'], 'custom');

$catalogue->set('key.second', 'Second key', 'custom');
$catalogue->setMetadata('key.second', ['sources' => ['src/file_1', 'src/file_2'], 'comments' => ['Comment 1', 'Comment 2'], 'flags' => ['fuzzy', 'another']], 'custom');

$dumper->dump($catalogue, [
    'path' => 'xxx',
]);
```

Will produces this output:
```
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fr\n"

# Comment
#, fuzzy
#: src/file_1
msgid "key.one"
msgstr "First key"

# Comment 1
# Comment 2
#, fuzzy,another
#: src/file_1 src/file_2
msgid "key.second"
msgstr "Second key"
```

Commits
-------

31b3a55787 Add comments when dumping po files
2019-04-06 21:19:44 +02:00
Fabien Potencier
3de3e4e8d9 feature #30913 [Messenger] Uses an AmqpStamp to provide flags and attributes (sroze)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Uses an `AmqpStamp` to provide flags and attributes

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

Using the `AmqpStamp` you can configure the flags and any attribute (such as `delivery_mode`).

Commits
-------

56fa574023 Uses an `AmqpStamp` to provide flags and attributes
2019-04-06 21:18:37 +02:00
David Maicher
7628972285 [Serializer] add return type hints for ObjectPropertyListExtractorInterface 2019-04-06 21:18:18 +02:00
Grégoire Pineau
9a2787e89a [Validator] Add an option to disable NotCompromisedPasswordValidator 2019-04-06 21:16:20 +02:00
Samuel ROZE
56fa574023 Uses an AmqpStamp to provide flags and attributes 2019-04-06 21:05:34 +02:00
Fabien Potencier
8a62892e42 bug #30876 [Mime][BrowserKit] Add FormUrlEncoded - Fix content-type in HttpBrowserPost (jderusse)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Mime][BrowserKit] Add FormUrlEncoded - Fix content-type in HttpBrowserPost

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

This PR use the content-type `x-www-form-urlencoded` when posting a form with the HttpBrowser.

Commits
-------

aecca9778e Use FormUrlEncoded when posting non-binary data
2019-04-06 21:02:43 +02:00
Fabien Potencier
05e488f418 fixed CS 2019-04-06 20:58:31 +02:00
Fabien Potencier
5c0acfb649 minor #30929 [HttpKernel] Remove unused import (yceruto)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpKernel] Remove unused import

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

cleanup

EU-FOSSA

Commits
-------

0d704b4f79 Remove unused import
2019-04-06 20:54:36 +02:00
Yonel Ceruto
0d704b4f79 Remove unused import 2019-04-06 20:51:34 +02:00
Fabien Potencier
c73fd100e9 feature #30900 [Validator] add new Timezone validation constraint (phansys)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Validator] add new `Timezone` validation constraint

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

Rework of #22262.

Commits
-------

536e53f184 [Validator] add new `Timezone` validation constraint.
2019-04-06 20:48:23 +02:00
Javier Spagnoletti
536e53f184 [Validator] add new Timezone validation constraint. 2019-04-06 20:45:46 +02:00
Fabien Potencier
58d78ac2cd minor #30927 [HttpClient] Removed undefined variable (derrabus)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpClient] Removed undefined variable

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

The variable `$noProxy` is accessed here before it is defined.

`EU-FOSSA`

Commits
-------

69f0a0b3bf Removed undefined variable.
2019-04-06 20:45:16 +02:00
Fabien Potencier
ce220cd216 feature #30915 [Serializer] Add datetimezone normalizer (jewome62)
This PR was squashed before being merged into the 4.3-dev branch (closes #30915).

Discussion
----------

[Serializer] Add datetimezone normalizer

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

Commits
-------

1546c0dfa0 [Serializer] Add datetimezone normalizer
2019-04-06 20:42:17 +02:00
jewome62
1546c0dfa0 [Serializer] Add datetimezone normalizer 2019-04-06 20:42:10 +02:00
Alexander M. Turek
69f0a0b3bf Removed undefined variable. 2019-04-06 20:38:25 +02:00
Fabien Potencier
a68b4c7191 feature #28937 Improve Translator caching (rpkamp)
This PR was squashed before being merged into the 4.3-dev branch (closes #28937).

Discussion
----------

Improve Translator caching

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

Add DirectoryResources to MessageCatalogues when loaded.

So that when a file is added to one of the directories the cache for all MessageCatalogues will be invalidated.

All directories must be added to all MessageCatalogues because we can't predict for which locale files will be added to each individual directory.

Also, now that the translator keeps track of its own directories for caching the container no longer needs to it. This means that when a translation changes or is added the container no longer needs to be fully rebuilt, saving a considerable amount of time (compilation time went down from ~4 seconds to ~1 second on each translation change/add in our project).

Commits
-------

a5246589cf Improve Translator caching
2019-04-06 20:37:50 +02:00
Remon van de Kamp
a5246589cf Improve Translator caching 2019-04-06 20:37:41 +02:00
Fabien Potencier
f587944e61 minor #30916 [Profiler] Update ProfilerController.php (error56)
This PR was squashed before being merged into the 4.3-dev branch (closes #30916).

Discussion
----------

[Profiler] Update ProfilerController.php

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

6e0785f8c5 [Profiler] Update ProfilerController.php
2019-04-06 20:31:43 +02:00
error56
6e0785f8c5 [Profiler] Update ProfilerController.php 2019-04-06 20:31:36 +02:00
Fabien Potencier
adba41aaa6 feature #30904 [Serializer] provide new ObjectPropertyListExtractorInterface (dmaicher)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Serializer] provide new ObjectPropertyListExtractorInterface

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

EUFOSSA Hackathon

As discussed with @joelwurtz this adds a new `ObjectPropertyListExtractorInterface` and a default implementation.

See https://github.com/symfony/symfony/issues/30818

>  A new interface will be provided ObjectPropertyListExtractorInterface (name can change), that allow getting attributes based on an object. A default implementation will be provided that use the PropertyListExtractorInterface and a class resolver, as the latter one only rely on class name, it may be important to have this distinction (this will allow features that rely on a specific value of the object to get the current property list, like exclusion policy)

Commits
-------

997270f7ac [Serializer] provide new ObjectPropertyListExtractorInterface
2019-04-06 20:28:25 +02:00
Fabien Potencier
e2e38dea9a feature #30902 [Workflow] The TransitionEvent is able to modify the context (lyrixx)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Workflow] The TransitionEvent is able to modify the context

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

EUFOSSA

ping @HeahDude

Commits
-------

62ab775154 [Workflow] The TransitionEvent is able to modify the context
2019-04-06 20:25:25 +02:00
Fabien Potencier
e5f14b7d28 feature #30908 [Workflow] Added workflow_transition_blockers twig function (lyrixx)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Workflow] Added workflow_transition_blockers twig function

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

EUFOSSA

---

also related to https://github.com/symfony/symfony/issues/26689

I'm not a big fan of the current name. What should I pick?

cc @javiereguiluz

Commits
-------

a2f99757f1 [Workflow] Added workflow_transition_blockers twig function
2019-04-06 20:23:30 +02:00
Fabien Potencier
4c78e60ad5 feature #30893 Add "input" option to NumberType (fancyweb, Bernhard Schussek)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Add "input" option to NumberType

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

This PR replaces #24793 in (partially) fixing how Doctrine's DECIMAL type is handled by the Form component.

Previously, DECIMAL was mapped to the regular NumberType. That confuses Doctrine's change detection, depending on the DB platform.

Examples:

| DB | DB value | Doctrine entity before submit | Form input | Doctrine entity after submit
| --- | --- | --- | --- | ---
| SQLite | 8.000 | '8' | 8 | 8
| SQLite | 8.123 | '8.123' | 8.123 | 8.123
| PostgreSQL | 8.000 | '8.000' | 8 | 8
| PostgreSQL | 8.123 | '8.123' | 8.123 | 8.123

The value in the Doctrine entity changes before and after submit. Hence Doctrine believes an update is necessary.

This PR introduces an `input` option to NumberType (similar to DateType), that can be set to `'number'` (default) or `'string'`. If set to `'string'`, the conversion is as follows:

| DB | DB value | Doctrine entity before submit | Form input | Doctrine entity after submit
| --- | --- | --- | --- | ---
| SQLite | 8.000 | **'8'** | 8 | **'8.000'**
| SQLite | 8.123 | '8.123' | 8.123 | '8.123'
| PostgreSQL | 8.000 | '8.000' | 8 | '8.000'
| PostgreSQL | 8.123 | '8.123' | 8.123 | '8.123'

You see that this does not completely solve this issue for SQLite. However, @Ocramius and I agree that this is something to be fixed by Doctrine, since Doctrine is providing the database abstraction.

That fix should be done in the SqlitePlatform object in Doctrine as part of another PR and should be backwards compatible with the current Doctrine version (i.e. opt in via configuration).

Compared to #24793, this PR does not introduce a new type but instead makes the NumberType more flexible. Also, this PR does not introduce the `force_full_scale` option since that should be solved by Doctrine as described above.

Commits
-------

3f25734647 Added new option "input" to NumberType
fb2b37a8f3 add force_full_scale option to handle all cases
40f25121c3 [DoctrineBridge] Add decimal form type
2019-04-06 20:17:43 +02:00