Commit Graph

44957 Commits

Author SHA1 Message Date
Nicolas Grekas
ff3e32c442 bug #33966 [FrameworkBundle] Improve the sorting of tagged services (krome162504)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Improve the sorting of tagged services

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/issues/33716
| License       | MIT
| Doc PR        | -

Little DX improvement, to sort the tags inside each service tagged.
More details in linked issue.

Commits
-------

f892289351 [FrameworkBundle] Improve the sorting of tagged services
2019-10-14 15:11:20 +02:00
Nicolas Grekas
6b3bbe4cc2 minor #33969 Increase limits for flakey appveyor tests (ostrolucky)
This PR was merged into the 4.3 branch.

Discussion
----------

Increase limits for flakey appveyor tests

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

See https://ci.appveyor.com/project/fabpot/symfony/builds/28063471 and https://ci.appveyor.com/project/fabpot/symfony/builds/27945625

Commits
-------

8a04886f26 Increase limits for flakey appveyor tests
2019-10-14 15:09:55 +02:00
Nicolas Grekas
85c106558d feature #33980 [HttpClient] try using php-http/discovery when nyholm/psr7 is not installed (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] try using php-http/discovery when nyholm/psr7 is not installed

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

In case one has `php-http/discovery`, we can leverage it...

Commits
-------

6e0cb581a1 [HttpClient] try using php-http/discovery when nyholm/psr7 is not installed
2019-10-14 15:04:42 +02:00
Yonel Ceruto
a676c7e4f7 Add show-deprecations option to lint:twig command 2019-10-14 08:41:58 -04:00
Christian Flothmann
ae808b0a74 Merge branch '4.3' into 4.4
* 4.3:
  fix PHP 5.6 compatibility
  [Cache] fixed TagAwareAdapter returning invalid cache
  Add plus character `+` to legal mime subtype
  Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract
  bug #33942 [DI] Add extra type check to php dumper
  [Dotenv] search variable values in ENV first then env file
  [PropertyInfo] Respect property name case when guessing from public method name
  [VarDumper] fix resetting the "bold" state in CliDumper
  Missing argument in method_exists
  SCA: added missing break in a loop
2019-10-14 14:27:06 +02:00
Christian Flothmann
eb5e01e063 Merge branch '3.4' into 4.3
* 3.4:
  fix PHP 5.6 compatibility
  [Cache] fixed TagAwareAdapter returning invalid cache
  [PropertyInfo] Respect property name case when guessing from public method name
2019-10-14 14:12:55 +02:00
Nicolas Grekas
a876748d93 [Serializer] fix typo 2019-10-14 13:43:44 +02:00
Nicolas Grekas
6e0cb581a1 [HttpClient] try using php-http/discovery when nyholm/psr7 is not installed 2019-10-14 12:53:45 +02:00
Julien Turby
f892289351 [FrameworkBundle] Improve the sorting of tagged services 2019-10-14 09:29:16 +04:00
Fabien Potencier
805449d1f4 feature #33967 [Mailer] Add Message-Id to SentMessage when sending an email (fabpot)
This PR was squashed before being merged into the 4.4 branch (closes #33967).

Discussion
----------

[Mailer] Add Message-Id to SentMessage when sending an email

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes-ish
| New feature?  | yes-ish as well
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | fixes #33681
| License       | MIT
| Doc PR        | -

This adds `SentMessage::getMessageId()` to retrieve the message id as generated internally OR by the provider sending the email.

Commits
-------

d97d1f9bb4 [Mailer] Fix Message ID for Postmark SMTP
b42c269760 Add Message-Id to SentMessage when sending an email
2019-10-13 21:48:43 +02:00
Nicolas Grekas
fb2a7a3d35 minor #33974 [Cache] fix PHP 5.6 compatibility (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix PHP 5.6 compatibility

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

5c82d301a7 fix PHP 5.6 compatibility
2019-10-13 21:35:09 +02:00
Fabien Potencier
004ee73665 feature #33896 [Serializer][CSV] Add context options to handle BOM (malarzm)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer][CSV] Add context options to handle BOM

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #33684
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/12461

This allows BOM handling in en/decoded CSV files. To keep current behaviour intact both skipping BOM at the beginning of the CSV and outputting BOM are an opt-in feature.

Personally I'd propose to make `SKIP_INPUT_BOM` default to `false` in 5.0 so the BOM is transparent and people that for some reasons expect BOM characters to be present in the parsed text explicitly opt-out of trimming it.

Commits
-------

3eb36684d8 Add context options to handle BOM
2019-10-13 21:13:17 +02:00
Christian Flothmann
5c82d301a7 fix PHP 5.6 compatibility 2019-10-13 20:43:12 +02:00
Nicolas Grekas
1aa9a118d6 [HttpClient] add HttpClient::createForBaseUri() 2019-10-13 19:52:56 +02:00
Gabriel Ostrolucký
8a04886f26
Increase limits for flakey appveyor tests 2019-10-13 14:02:04 +02:00
Maciej Malarz
3eb36684d8 Add context options to handle BOM 2019-10-13 10:45:12 +02:00
Fabien Potencier
0065f7579b bug #33948 [PropertyInfo] Respect property name case when guessing from public method name (antograssiot)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyInfo] Respect property name case when guessing from public method name

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #32656
| License       | MIT
| Doc PR        |

Using camelCase, with an attribute `$aFooBar`, naming the getter/setter `getAFooBar()`/`setAFooBar()`,  returns the property name as AFooBar instead of aFooBar.

# Before
Property name `'AFooBar'`

# After
Property name `'aFooBar'` as expected

Commits
-------

843bb76f8a [PropertyInfo] Respect property name case when guessing from public method name
2019-10-13 10:38:57 +02:00
Fabien Potencier
d97d1f9bb4 [Mailer] Fix Message ID for Postmark SMTP 2019-10-13 09:31:33 +02:00
Nicolas Grekas
211c651d2a bug #33944 [HttpClient] resolve promise chains on HttplugClient::wait() (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] resolve promise chains on HttplugClient::wait()

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #32142
| License       | MIT
| Doc PR        | -

Follow up of #33743

Right now, keeping a reference to promise objects returned by `HttplugClient::sendAsyncRequest()`, then calling their `wait()` method is the only way to actually resolve the promises. That's why when these promises are destructed, we cancel the corresponding HTTP request.

But thanks to the `HttplugClient::wait()` method, we have a hook to tick the event loop managed by the Symfony client.

I added a test case to run into this situation.

~It fails currently. I'd like asking @joelwurtz, @dbu and/or maybe @Nyholm if you could have a look and finish this PR? I'm not that familiar with promises and you might get faster and better to the goal. Anyone else is welcome also of course. Thank you for having a look :) PR welcome on my fork or as a separate one on this repos.~

Commits
-------

ea0be07a33 [HttpClient] resolve promise chains on HttplugClient::wait()
2019-10-12 11:46:32 +02:00
Nicolas Grekas
0e84d3d8c2 bug #33959 [Cache] fix 2RTT + race condition in AbstractTagAwareAdapter::deleteItems() (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] fix 2RTT + race condition in AbstractTagAwareAdapter::deleteItems()

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

A final improvement to `AbstractTagAwareAdapter::deleteItems()`: this PR makes `deleteItems()` operate in 1RTT instead of 2.

Commits
-------

0613c227ec [Cache] fix 2RTT + race condition in AbstractTagAwareAdapter::deleteItems()
2019-10-12 11:45:08 +02:00
Nicolas Grekas
1201085f72 bug #33962 [Cache] fixed TagAwareAdapter returning invalid cache (v-m-i)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fixed TagAwareAdapter returning invalid cache

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33953
| License       | MIT
| Doc PR        |

This PR fixes `TagAwareAdapter` returning `CacheItem` when item-tags pair is missing tag key in pool. Currently `TagAwareAdapter` returns `CacheItem` with empty tags and `isHit` set to `true`. With this PR it returns `CacheItem` with `isHit` set to `false` as we can't know if item is valid or invalid when it's missing tag entry so we treat it as cache miss.

Commits
-------

946f0a1e11 [Cache] fixed TagAwareAdapter returning invalid cache
2019-10-12 11:36:31 +02:00
Vedran Mihočinec
946f0a1e11 [Cache] fixed TagAwareAdapter returning invalid cache 2019-10-12 11:36:03 +02:00
Nicolas Grekas
6f54733a9c minor #33964 Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract (reedy)
This PR was merged into the 4.3 branch.

Discussion
----------

Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #33946
| License       | MIT

Commits
-------

c2dd804a24 Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract
2019-10-12 11:16:01 +02:00
Nicolas Grekas
831b00ff89 bug #33958 [DI] Add extra type check to php dumper (gquemener)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] Add extra type check to php dumper

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33942
| License       | MIT
| Doc PR

This PR adds a missing type check in the PHP Dumper. The bug has been detected while working on the https://github.com/prooph/service-bus-symfony-bundle and I haven't been able to reproduce it within a minimalist testcase.

I would like to add a unit test to cover it once I have figured out the exact context in which the bug occurs.

Any help would be greatly appreciated to do so, especially from "senior" contributors of the DependencyInjection component, many thanks in advance!

You will find more information about this bug in the linked ticket above.

Commits
-------

b17ebdf081 bug #33942 [DI] Add extra type check to php dumper
2019-10-12 11:12:58 +02:00
Nicolas Grekas
8d8a10c699 Merge branch '3.4' into 4.3
* 3.4:
  Add plus character `+` to legal mime subtype
  [Dotenv] search variable values in ENV first then env file
  [VarDumper] fix resetting the "bold" state in CliDumper
  SCA: added missing break in a loop
2019-10-12 11:11:50 +02:00
Nicolas Grekas
a8a4aadf24 bug #33965 [HttpFoundation] Add plus character + to legal mime subtype (ilzrv)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Add plus character `+` to legal mime subtype

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

For example, the following mime type (used for epub) is not recognized given the current regexp: `application/epub+zip; charset=binary`

Commits
-------

56895f12b9 Add plus character `+` to legal mime subtype
2019-10-12 10:56:52 +02:00
Ilia Lazarev
56895f12b9 Add plus character + to legal mime subtype
For example, the following mime type (used for epub) is not recognized given the current regexp: `application/epub+zip`
2019-10-12 10:55:17 +02:00
Nicolas Grekas
ea0be07a33 [HttpClient] resolve promise chains on HttplugClient::wait() 2019-10-12 10:50:39 +02:00
Fabien Potencier
b42c269760 Add Message-Id to SentMessage when sending an email 2019-10-12 10:43:49 +02:00
Fabien Potencier
a84ec3a636 feature #33883 [Mailer] added ReplyTo option for PostmarkApiTransport (pierregaste)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] added ReplyTo option for PostmarkApiTransport

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Supports "ReplyTo" option with Postmark transport

Commits
-------

d49a7387de [Mailer] added ReplyTo option for PostmarkApiTransport
2019-10-12 08:51:40 +02:00
Reedy
c2dd804a24 Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract
Also make getServiceLocator protected

As per https://github.com/symfony/symfony/issues/33946#issuecomment-541100439
2019-10-12 01:38:35 +01:00
Reedy
246c5fdf43 Add .gitignore to .gitattributes 2019-10-12 01:35:04 +01:00
Nicolas Grekas
0613c227ec [Cache] fix 2RTT + race condition in AbstractTagAwareAdapter::deleteItems() 2019-10-11 20:45:35 +02:00
Gildas Quéméner
b17ebdf081
bug #33942 [DI] Add extra type check to php dumper 2019-10-11 18:58:45 +02:00
Tobias Schultze
38b9a27976 feature #33053 [ErrorHandler] Rework fatal errors (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Rework fatal errors

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

Built on top of https://github.com/symfony/symfony/pull/33038 so review only the second commit : d5c3f7ed48

The goals of this PR is to replace current "fatal error handlers" with "error enhancers" since all our current fatal error handlers works on \Error since PHP7.

That means we won't use the FatalErrorException anymore, so we will be able to remove it (once we don't need it in the rest of the codebase).

The final goal btw is to handle \Throwable everywhere in the code so we can remove FatalThrowableError & FatalErrorException classes.

Commits
-------

aaa0cdf523 [ErrorHandler] Rework fatal error handlers
2019-10-11 16:10:55 +02:00
Nicolas Grekas
fefb2ff020 bug #32943 [Dotenv] search variable values in ENV first then env file (soufianZantar)
This PR was merged into the 3.4 branch.

Discussion
----------

[Dotenv] search variable values in ENV first then env file

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

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Bug fixes must be submitted against the lowest maintained 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 branch 4.4.
 - Legacy code removals go to the master branch.
-->

I think we must searhing the value of variables in $_ENV before the .env file to fix this issues.
before this fix Parse method will return the value in .env file and not the value passed in this command `composer dump-env prod `.

**the issue:**

In my .env file, I have a variable TEST that depends on the APP_ENV variable like this:

```
# .env file

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=2eb810c79fba0dd5c029a2fa53bfdb51
###< symfony/framework-bundle ###

TEST=foo_${APP_ENV}

```
I run composer dump-env dev command to generate my .env.locale.php, everything works fine, the value of my variable TEST is correct.

```
// .env.locale.php

return array (
  'APP_ENV' => 'dev',
  'TEST' => 'foo_dev',
  'APP_SECRET' => '2eb810c79fba0dd5c029a2fa53bfdb51',
);
```
Then I run the same command with prod environment (composer dump-env prod), the value of TEST is wrong (it is same as for dev)

```
// .env.locale.php

return array (
  'APP_ENV' => 'prod',
  'TEST' => 'foo_dev',
  'APP_SECRET' => '2eb810c79fba0dd5c029a2fa53bfdb51',
);
```

Commits
-------

3018041782 [Dotenv] search variable values in ENV first then env file
2019-10-11 15:39:49 +02:00
soufianZantar
3018041782 [Dotenv] search variable values in ENV first then env file 2019-10-11 15:36:17 +02:00
Nicolas Grekas
28f95361c6 feature #33939 [Cache] add TagAwareMarshaller to optimize data storage when using AbstractTagAwareAdapter (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] add TagAwareMarshaller to optimize data storage when using AbstractTagAwareAdapter

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | #33924
| License       | MIT
| Doc PR        | -

This is the final touch in my series of PR that fixes the linked issue.

Remarkably, the solutions I implemented for this issue are completely different than the one I described there. Fortunately, the issues themselves were correctly identified.

Plannification of implementation is gambling :)

/cc @andrerom

Commits
-------

5a4a30c6ef [Cache] add TagAwareMarshaller to optimize data storage when using AbstractTagAwareAdapter
2019-10-11 15:35:39 +02:00
Nicolas Grekas
49ad46e283 bug #33943 [VarDumper] fix resetting the "bold" state in CliDumper (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] fix resetting the "bold" state in CliDumper

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

21645a5b96 [VarDumper] fix resetting the "bold" state in CliDumper
2019-10-11 15:34:05 +02:00
Nicolas Grekas
5a4a30c6ef [Cache] add TagAwareMarshaller to optimize data storage when using AbstractTagAwareAdapter 2019-10-11 14:17:27 +02:00
Anto
843bb76f8a
[PropertyInfo] Respect property name case when guessing from public method name 2019-10-11 06:14:16 +02:00
Fabien Potencier
1c81349b42 feature #33941 Keeping backward compatibility with legacy FlattenException usage (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

Keeping backward compatibility with legacy FlattenException usage

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | yes
| Tickets       | Fix #33929
| License       | MIT
| Doc PR        | -

Commits
-------

928363c408 Keeping backward compatibility with legacy FlattenException usage
2019-10-11 06:10:30 +02:00
Fabien Potencier
b1ea2cd7a6 bug #33910 [Mime] added image/svg MIME support (0xB4LINT)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] added image/svg MIME support

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33909
| License       | MIT
| Doc PR        |

Added `image/svg` MIME type to `svg` extension.
More @#33909.

Commits
-------

015eb6625c added image/svg MIME support
2019-10-10 21:26:50 +02:00
Fabien Potencier
417222515b minor #33938 SCA: added missing break in a loop (kalessil)
This PR was merged into the 3.4 branch.

Discussion
----------

SCA: added missing break in a loop

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

6af04bbac6 SCA: added missing break in a loop
2019-10-10 21:22:59 +02:00
Nicolas Grekas
21645a5b96 [VarDumper] fix resetting the "bold" state in CliDumper 2019-10-10 13:03:19 +02:00
Nicolas Grekas
6e7f3257ce [HttpClient] fix merge 2019-10-10 10:55:24 +02:00
Nicolas Grekas
9c635615de bug #33936 [HttpClient] Missing argument in method_exists (detinkin)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Missing argument in method_exists

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

d2a8e94c79 Missing argument in method_exists
2019-10-10 10:42:52 +02:00
detinkin
d2a8e94c79 Missing argument in method_exists 2019-10-10 10:41:55 +02:00
Nicolas Grekas
f93b3a3653 Merge branch '4.3' into 4.4
* 4.3:
  [Cache] ignore unserialization failures in AbstractTagAwareAdapter::doDelete()
  [HttpClient] send `Accept: */*` by default, fix removing it when needed
2019-10-10 09:38:51 +02:00
Nicolas Grekas
76f44df8ff bug #33937 [Cache] ignore unserialization failures in AbstractTagAwareAdapter::doDelete() (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] ignore unserialization failures in AbstractTagAwareAdapter::doDelete()

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Making things more robust, part of #33924

Commits
-------

a1f334c1b7 [Cache] ignore unserialization failures in AbstractTagAwareAdapter::doDelete()
2019-10-10 09:36:50 +02:00