Commit Graph

41712 Commits

Author SHA1 Message Date
Nicolas Grekas
8f699541f5 [HttpClient] fix too high timeout in test 2019-04-15 19:24:46 +02:00
Ryan Weaver
70b448d120 Reorganizing messenger serializer config and replacing base64_encode with addslashes 2019-04-15 10:26:02 -04:00
Nicolas Grekas
81d11c3f2e minor #31115 [Form] Workaround for \DateInterval::createFromDateString() (renanbr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Workaround for \DateInterval::createFromDateString()

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

This patch makes test `Symfony\Component\Form\Tests\Extension\Core\Type\DateIntervalTypeTest::testSubmitNullUsesDateEmptyData()` pass in PHP 7.2.17 and 7.3.4

PHP bug reference : https://bugs.php.net/bug.php?id=77896

See also : https://3v4l.org/sQjh2

Commits
-------

54247ec05f Workaround for \DateInterval::createFromDateString()
2019-04-15 15:32:17 +02:00
renanbr
54247ec05f Workaround for \DateInterval::createFromDateString() 2019-04-15 15:23:09 +02:00
Yonel Ceruto
f1d3bc0e62 Show all option normalizers on debug:form command 2019-04-15 09:14:41 -04:00
Nicolas Grekas
238f844c72 feature #30717 [Serializer] Use name converter when normalizing constraint violation list (norkunas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Serializer] Use name converter when normalizing constraint violation list

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

When using name converter with serializer and the default ConstraintViolationListNormalizer, returned propertyPaths was not converted to the same format.

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

dd93b707cc Use name converter when normalizing constraint violation list
2019-04-15 13:56:07 +02:00
Fabien Potencier
5d3d1a014c feature #28846 [Intl] Simplify API (ro0NL)
This PR was squashed before being merged into the 4.3-dev branch (closes #28846).

Discussion
----------

[Intl] Simplify API

| 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 | #18368
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/issues/11221

Simplifies the Intl API. It greatly reduces the no. of boilerplate classes in this component. Very over complicated, much wow :)

Solving (IMHO):

```php
class LanguageBundle extends LanguageDataProvider implements LanguageBundleInterface
```

Which seems very over complicated just to provide static data.

```php
// before
Intl::getLanguageBundle()->getLanguageName() // string | null

// after
Languages::getName() // string
Languages::exists() // bool
```

I left out Canonicalization on puropose, that's a new topic to me.

- [x] Languages
- [x] Locales
- [x] Currencies
- [x] Regions
- [x] Scripts
- [ ] Timezones (#28831)
- [x] Update constraints
- [x] Update form types

Thoughts?

Commits
-------

d6b67d469a [Intl] Simplify API
2019-04-15 13:51:58 +02:00
Roland Franssen
d6b67d469a [Intl] Simplify API 2019-04-15 13:51:51 +02:00
Nicolas Grekas
76647a78bd minor #31047 [DoctrineBridge] [DX] Update exception text in ManagerRegistry to avoid confusion. (Simperfit)
This PR was submitted for the master branch but it was merged into the 4.2 branch instead (closes #31047).

Discussion
----------

[DoctrineBridge] [DX] Update exception text in ManagerRegistry to avoid confusion.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yesish <!-- 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 | #29659   <!-- #-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.
-->

Since the last PR was closed and the ticket is still open, taking it since it was already done by Nicolas in the comments.

Commits
-------

9ade232533 [DoctrineBridge] [DX] Update exception text in ManagerRegistry::resetService to avoid confusion.
2019-04-15 11:42:25 +02:00
Amrouche Hamza
9ade232533 [DoctrineBridge] [DX] Update exception text in ManagerRegistry::resetService to avoid confusion. 2019-04-15 11:42:18 +02:00
Nicolas Grekas
d88833d27a [Routing] fix trailing slash redirection with non-greedy trailing vars 2019-04-14 20:04:59 +02:00
Nicolas Grekas
a12656eaad [FrameworkBundle] decorate the ValidatorBuilder's translator with LegacyTranslatorProxy 2019-04-14 20:04:40 +02:00
Fabien Potencier
3fdc359fec minor #31099 Missing Lithuanian translations added. (rmikalkenas)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #31099).

Discussion
----------

Missing Lithuanian translations added.

| 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

Missing Lithuanian translations for validator component.

Commits
-------

1c9a9cd9e0 Missing Lithuanian translations added to validator component.
2019-04-13 08:36:38 +02:00
Rokas Mikalkėnas
1c9a9cd9e0 Missing Lithuanian translations added to validator component. 2019-04-13 08:36:32 +02:00
Fabien Potencier
95932df2ac bug #31100 Missing use statement added in UniqueValidator. (rmikalkenas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Missing use statement added in UniqueValidator.

| 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

Commits
-------

9ae73b11a6 Missing use statement added in UniqueValidator.
2019-04-13 08:35:37 +02:00
Rokas Mikalkėnas
9ae73b11a6 Missing use statement added in UniqueValidator. 2019-04-13 00:07:37 +03:00
Nicolas Grekas
e45bc83f21 Merge branch '4.2'
* 4.2:
  Skip testing the phpunit-bridge on not-master branches when $deps is empty
  more tests
  [DI] Fixes: #28326 - Overriding services autowired by name under _defaults bind not working
  [DI] fix removing non-shared definition while inlining them
2019-04-12 17:33:39 +02:00
Nicolas Grekas
dc2edaffe2 Merge branch '3.4' into 4.2
* 3.4:
  Skip testing the phpunit-bridge on not-master branches when $deps is empty
  more tests
  [DI] Fixes: #28326 - Overriding services autowired by name under _defaults bind not working
2019-04-12 17:32:33 +02:00
Nicolas Grekas
39f20844b3 minor #31095 Skip testing the phpunit-bridge on not-master branches when $deps is empty (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Skip testing the phpunit-bridge on not-master branches when $deps is empty

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

Tests are not in sync with the autoloaded code on these jobs.
The bridge is still tested on deps=low/high jobs + master

Commits
-------

b0ee192aaa Skip testing the phpunit-bridge on not-master branches when $deps is empty
2019-04-12 17:30:21 +02:00
Nicolas Grekas
08577f4398 [PhpUnitBridge] fix PHP 5.5 support 2019-04-12 17:26:05 +02:00
Nicolas Grekas
b0ee192aaa Skip testing the phpunit-bridge on not-master branches when $deps is empty 2019-04-12 17:12:49 +02:00
Nicolas Grekas
770c7ddec4 [PhpUnitBridge] CS fix 2019-04-12 16:49:44 +02:00
Nicolas Grekas
8297a75eb7 bug #31088 [DI] fix removing non-shared definition while inlining them (nicolas-grekas)
This PR was merged into the 4.2 branch.

Discussion
----------

[DI] fix removing non-shared definition while inlining them

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

I didn't manage to create a specific test case but this still has 100% coverage for the added lines and fixed the reproducer (and makes sense also :) )

Commits
-------

317e820694 [DI] fix removing non-shared definition while inlining them
2019-04-12 16:35:03 +02:00
Nicolas Grekas
37eff9bf68 feature #31093 [PhpUnitBridge] ClockMock does not mock gmdate() (Simperfit)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[PhpUnitBridge] ClockMock does not mock gmdate()

| Q             | A
| ------------- | ---
| Branch?       | feature
| 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 | #30393   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/11418 <!-- 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.
-->
Adding the feature to mock gmdate directly in ClockMock.

Commits
-------

b34738bba6 [PhpUnitBridge] ClockMock does not mock gmdate()
2019-04-12 16:34:26 +02:00
Nicolas Grekas
3403a8e65a bug #29944 [DI] Overriding services autowired by name under _defaults bind not working (przemyslaw-bogusz, renanbr)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Overriding services autowired by name under _defaults bind not working

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

This is an implementation of ideas and suggestions of @nicolas-grekas and @GuilhemN.

Commits
-------

7e805eae2b more tests
35a40ace6f [DI] Fixes: #28326 - Overriding services autowired by name under _defaults bind not working
2019-04-12 16:33:47 +02:00
renanbr
7e805eae2b more tests 2019-04-12 16:27:23 +02:00
Przemysław Bogusz
35a40ace6f [DI] Fixes: #28326 - Overriding services autowired by name under _defaults bind not working 2019-04-12 16:15:59 +02:00
Amrouche Hamza
b34738bba6
[PhpUnitBridge] ClockMock does not mock gmdate() 2019-04-12 16:09:30 +02:00
Nicolas Grekas
2f73c2f66b fix 2019-04-12 15:55:35 +02:00
Nicolas Grekas
0cf183375a Merge branch '4.2'
* 4.2:
  [TwigBridge] fix tests
  [FrameworkBundle] Fix Controller deprecated when using composer --optimized
2019-04-12 15:50:47 +02:00
Nicolas Grekas
1d02ef2ccb Merge branch '3.4' into 4.2
* 3.4:
  [TwigBridge] fix tests
2019-04-12 15:50:35 +02:00
Nicolas Grekas
d134dfcbe2 minor #31091 [TwigBridge] fix tests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] fix tests

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

Follows https://github.com/twigphp/Twig/pull/2935

Commits
-------

33c6681585 [TwigBridge] fix tests
2019-04-12 15:50:12 +02:00
Nicolas Grekas
371b55ac7e bug #31094 [PhpUnitBridge] fixes (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[PhpUnitBridge] fixes

| 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 @stof's review in #29211 + fixes PHP5.5 support (array consts are PHP5.6+)
/cc @greg0ire

Commits
-------

b11585e31f [PhpUnitBridge] fixes
2019-04-12 15:49:45 +02:00
Nicolas Grekas
b11585e31f [PhpUnitBridge] fixes 2019-04-12 15:46:34 +02:00
Nicolas Grekas
33c6681585 [TwigBridge] fix tests 2019-04-12 15:39:20 +02:00
Valentin
340a2fb3f8 Keep preferred_choices order 2019-04-12 16:00:33 +03:00
Nicolas Grekas
317e820694 [DI] fix removing non-shared definition while inlining them 2019-04-12 11:55:35 +02:00
Fabien Potencier
a36fbe3d38 feature #29211 [PhpUnitBridge] Url encoded deprecations helper config (greg0ire)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[PhpUnitBridge] Url encoded deprecations helper config

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

First stab at implementing a new way of configuring the deprecation error handler. Includes a refactoring to keep things manageable.

Rework of #24867, blocked by #29718

TODO:

- [x] make the code 5.5 compatible 😢
- [x] add more tests
- [x] deprecate modes (using echo :P)
- [x] test this on real life projects and add some screenshots
- [x] docs PR
- [x] handle `strict`
- [x] adapt existing CI config

# Quiet configuration

![quiet](https://user-images.githubusercontent.com/657779/49341318-fa78c900-f64b-11e8-9504-a8a9eac4baf8.png)

# Default configuration

![verbose](https://user-images.githubusercontent.com/657779/49341322-10868980-f64c-11e8-9d90-dc3f6a18c335.png)

Commits
-------

1c73f9cfed [PhpUnitBridge] Url encoded deprecations helper config
2019-04-12 11:11:22 +02:00
Fabien Potencier
9edd84bce0 bug #30967 [HttpClient] Document the state object that is passed around by the HttpClient (derrabus)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpClient] Document the state object that is passed around by the HttpClient

| 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

In an attempt to make the code of the new HttpClient component more understandable, I've introduced internal classes that document the `$multi` object that is being passed around between *Client and *Response classes.

My goal is to make the code more accessible to potential contributors and static code analyzers.

Commits
-------

20f4eb3204 Document the state object that is passed around by the HttpClient.
2019-04-12 11:04:34 +02:00
Fabien Potencier
69b43fa8a8 bug #30993 [FrameworkBundle] Fix for Controller DEPRECATED when using composer --optimized (aweelex)
This PR was merged into the 4.2 branch.

Discussion
----------

[FrameworkBundle] Fix for Controller DEPRECATED  when using composer --optimized

| Q | A |
| --- | --- |
| Branch? | 4.2 |
| Bug fix? | Yes |
| New feature? | No |
| BC breaks? | No |
| Deprecations? | No |
| Tests pass? | Yes |
| Fixed tickets | --- |
| License | MIT |

Using `composer --optimize-autoload` causes `console cache:clear` (without warmup) to give DEPRECATED error, that stays in profiler.

I moved `@trigger_error` from beggining of the file to Controller __consctruct method.

Commits
-------

2ae2fd800d [FrameworkBundle] Fix Controller deprecated when using composer --optimized
2019-04-12 11:01:41 +02:00
Grégoire Paris
1c73f9cfed
[PhpUnitBridge] Url encoded deprecations helper config 2019-04-11 23:10:50 +02:00
Fabien Potencier
936355e2a2 minor #31063 CS Fixes: Not double split with one array argument (rubenrua)
This PR was merged into the 4.3-dev branch.

Discussion
----------

CS Fixes: Not double split with one array argument

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

Keep to use the same CS in all the Symfony code base.

Use:
```php
$resolver->setDefaults([
    'compound' => false
]);
```

Instead of:
```php
$resolver->setDefaults(
    [
        'compound' => false,
    ]
);
```

Keep the double split when the method has two or more arguments.

I miss a PSR with this rule.

Commits
-------

027bd12884 CS Fixes: Not double split with one array argument
2019-04-11 21:35:58 +02:00
rubenrua
027bd12884 CS Fixes: Not double split with one array argument
Keep to use the same CS in all the Symfony code base.

Use:
```php
$resolver->setDefaults([
    'compound' => false
]);
```

Instead of:
```php
$resolver->setDefaults(
    [
        'compound' => false,
    ]
);
```

Keep the double split when the method has two or more arguments.

I miss a PSR with this rule.
2019-04-11 16:45:23 +02:00
Nicolas Grekas
713aab79cc Merge branch '4.2'
* 4.2:
  Catch empty deprecation.log silently (fixes #31050)
  minor: the meaning of the data breach was not correct
  Optimize SVGs
  property normalizer should also pass format and context to isAllowedAttribute
2019-04-11 14:10:52 +02:00
Nicolas Grekas
ebe9ccf0cc Merge branch '3.4' into 4.2
* 3.4:
  Catch empty deprecation.log silently (fixes #31050)
2019-04-11 13:58:13 +02:00
Nicolas Grekas
9483779f5f bug #31076 [HttpKernel] Fixed LoggerDataCollector crashing on empty file (althaus)
This PR was submitted for the 4.2 branch but it was merged into the 3.4 branch instead (closes #31076).

Discussion
----------

[HttpKernel] Fixed LoggerDataCollector crashing on empty file

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

This PR adds a check to the LoggerDataCollector if there's acutal some content in the log file.

Commits
-------

291c73a290 Catch empty deprecation.log silently (fixes #31050)
2019-04-11 13:43:56 +02:00
Matthias Althaus
291c73a290 Catch empty deprecation.log silently (fixes #31050) 2019-04-11 13:43:50 +02:00
Nicolas Grekas
9399cb99a5 Merge branch '3.4' into 4.2
* 3.4:
  minor: the meaning of the data breach was not correct
  Optimize SVGs
  property normalizer should also pass format and context to isAllowedAttribute
2019-04-11 13:27:41 +02:00
Nicolas Grekas
5f4c27f0de minor #31067 Optimize SVGs (MartijnCuppens)
This PR was merged into the 3.4 branch.

Discussion
----------

Optimize SVGs

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see below -->
| 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 -->

Used [svgo](https://github.com/svg/svgo) to optimize the svgs. I kept the `viewBox` attribute to keep the aspects when SVGs are rescaled.

I also added `insert_final_newline = false` to the `.editorconfig` file because the newlines are removed from the SVGs and there's only one line left.

Commits
-------

4614cea9d2 Optimize SVGs
2019-04-11 13:23:48 +02:00
Nicolas Grekas
bc9c89eb44 Merge branch '4.2'
* 4.2:
  CS Fixes: Not double split with one array argument
2019-04-11 13:18:55 +02:00