Commit Graph

33477 Commits

Author SHA1 Message Date
Nicolas Grekas
b0989aaffc feature #29935 [DI] Fix bad error message for unused bind under _defaults (przemyslaw-bogusz)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[DI] Fix bad error message for unused bind under _defaults

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

**Sidenote**: I originally included the fix in #29897, but I decided to close the previous PR and divide it into two separate PRs for clarity.

**Description:**
With this fix, the message regarding an unused bind will have a clear information about the type of the bind (defined under __defaults_, __instanceof_ or _per service_), as well as the name of the file, in which it was configurated. It's for, both, YAML and XML configurations.

For the core team, please note, that the fix assumes a possibility of definings binds under __instanceof_, which was introduced in #27806. But since fixes are merged into other branches, I thought that it might be necessary to inlude this possibility. If this case requires making separate fixes for different branches, I will gladly do it.

Commits
-------

35bf4203e8 [DI] Fix bad error message for unused bind under _defaults
2019-04-07 12:29:22 +02:00
Fabien Potencier
3df05e0877 feature #30962 [DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader (HeahDude)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader

| 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 | ~
| License       | MIT
| Doc PR        | ~

#EUFOSSA

Big thanks to @stof for the help with writing the test!

## Description
It happens that the `IdReader` is created by the `DoctrineType` and cached for each entity class case.
But the type already resolves whether or not it should use it, only when we can optimize query thanks to a single id field when defining the `choice_value` option: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php#L188.

This PR is a first step to optimize the choice loading process.

Commits
-------

287c39b9ea [DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader
2019-04-07 12:26:36 +02:00
Przemysław Bogusz
35bf4203e8 [DI] Fix bad error message for unused bind under _defaults 2019-04-07 12:22:52 +02:00
Jules Pietri
287c39b9ea [DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader 2019-04-07 12:14:41 +02:00
Nicolas Grekas
4447f87c2e Merge branch '4.2'
* 4.2:
  fix translating file validation error message
  [Validator] Add missing Hungarian translations
  Improving deprecation message of the Twig templates directory src/Resources/views
  [3.4] [Validator] Add missing french validation translations.
  [Validator] Only traverse arrays that are cascaded into
  Handle case where no translations were found
  [Validator] Translate unique collection message to Hungarian
  fix tests
  Run test in separate process
  Use a class name that does not actually exist
  [Profiler] Fix dark theme elements color
  fix horizontal spacing of inlined Bootstrap forms
  [Translator] Warm up the translations cache in dev
  turn failed file uploads into form errors
2019-04-07 11:58:10 +02:00
Nicolas Grekas
ecb52bc9f1 Merge branch '3.4' into 4.2
* 3.4:
  fix translating file validation error message
  [Validator] Add missing Hungarian translations
  [3.4] [Validator] Add missing french validation translations.
  [Validator] Only traverse arrays that are cascaded into
  Handle case where no translations were found
  [Validator] Translate unique collection message to Hungarian
  fix tests
  Run test in separate process
  Use a class name that does not actually exist
  fix horizontal spacing of inlined Bootstrap forms
  [Translator] Warm up the translations cache in dev
  turn failed file uploads into form errors
2019-04-07 11:56:43 +02:00
Fabien Potencier
ca290396fb minor #30943 [Asset] PathPackage : use parent getUrl Method instead of duplicating code (tiecoders)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Asset] PathPackage : use parent getUrl Method instead of duplicating code

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

Use parent getUrl method instead of duplicating code.

Commits
-------

0c2a2bf536 ASSET-PathPackage-Enhancement  - Use parent getUrl method instead of duplicating code.
2019-04-07 11:43:31 +02:00
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
Christian Flothmann
9c41842756 fix translating file validation error message 2019-04-07 11:31:05 +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
Gábor Egyed
62e5a91150 [Validator] Add missing Hungarian translations 2019-04-07 10:52:46 +02:00
Fabien Potencier
95d46c25f7 minor #30940 [Validator] Translate unique collection message to Hungarian (1ed)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Translate unique collection message to Hungarian

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

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

6a732dc031 [Validator] Translate unique collection message to Hungarian
2019-04-07 10:48:21 +02:00
Fabien Potencier
6ea4d79e0f minor #30945 [3.4] [Validator] Add missing french validators translations (hhamon)
This PR was merged into the 3.4 branch.

Discussion
----------

[3.4] [Validator] Add missing french validators translations

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

331b601fed [3.4] [Validator] Add missing french validation translations.
2019-04-07 10:44:45 +02:00
Yonel Ceruto
89a00b315d Improving deprecation message of the Twig templates directory src/Resources/views 2019-04-07 10:37:45 +02:00
Fabien Potencier
3d6f15251a bug #30951 Handle case where no translations were found (greg0ire)
This PR was merged into the 3.4 branch.

Discussion
----------

Handle case where no translations were found

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

Right now, the program emits a warning when trying to use max() on an
empty array.

Commits
-------

79b1fb8333 Handle case where no translations were found
2019-04-07 10:36:55 +02:00
Hugo Hamon
331b601fed [3.4] [Validator] Add missing french validation translations. 2019-04-07 10:32:58 +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
Fabien Potencier
1f48f7bd82 bug #29800 [Validator] Only traverse arrays that are cascaded into (corphi)
This PR was squashed before being merged into the 3.4 branch (closes #29800).

Discussion
----------

[Validator] Only traverse arrays that are cascaded into

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

Previously, array properties were traversed even if they were not annotated `Valid`.

Commits
-------

7db9200279 [Validator] Only traverse arrays that are cascaded into
2019-04-07 10:20:18 +02:00
Philipp Cordes
7db9200279 [Validator] Only traverse arrays that are cascaded into 2019-04-07 10:20:12 +02:00
Grégoire Paris
79b1fb8333
Handle case where no translations were found
Right now, the program emits a warning when trying to use max() on an
empty array.
2019-04-07 10:01:42 +02:00
Fabien Potencier
03d804e32d minor #30928 [DependencyInjection] fix tests (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[DependencyInjection] fix tests

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

#FOSSHackathons #EUFOSSA

Commits
-------

e55f6e6f5e fix tests
2019-04-07 09:57:30 +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
tiecoders
0c2a2bf536 ASSET-PathPackage-Enhancement - Use parent getUrl method instead of duplicating code. 2019-04-07 01:25:14 +02:00
Grégoire Pineau
50c22b3d58 Fixed tests 2019-04-06 23:28:55 +02:00
Gábor Egyed
6a732dc031
[Validator] Translate unique collection message to Hungarian 2019-04-06 23:20:57 +02:00
Christian Flothmann
de12e2382e throw UnexpectedValueException instead 2019-04-06 23:02:44 +02:00
Christian Flothmann
e55f6e6f5e fix tests 2019-04-06 22:57:23 +02:00
Christian Flothmann
faf629386e drop not needed "constant" type argument 2019-04-06 22:23:29 +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
Grégoire Paris
6d51a04b11
Run test in separate process
This test calls code that defines some environment variables, which in
turn trigger the registration of a the deprecation error handler, which
causes unexpected issues when testing other components.
2019-04-06 21:33:58 +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
Grégoire Paris
a53e0fe1cd
Use a class name that does not actually exist
Using "Foo", a class name that corresponds to no less than 22 fixture
classes, results in the first found "Foo" being loaded when one is
found by the ClassNotFoundFatalErrorHandler error handler, I am not sure
exactly why, but it is not really a big issue because this is a fatal
error handler and execution is not supposed to continue after that.
Except that is very much the case when running the whole test suite
sequentially with ./phpunit . Then we arrive to the DI component test
suite, and a failure happens because \\foo was not supposed to be defined:

> Failed asserting that exception message 'The definition for "\foo" has
> no class attribute, and appears to reference a class or interface in the
> global namespace. Leaving out the "class" attribute is only allowed for
> namespaced classes. Please specify the class attribute explicitly to get
> rid of this error.' contains 'The definition for "\foo" has no class.'.
2019-04-06 21:25:09 +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