Commit Graph

50815 Commits

Author SHA1 Message Date
Christian Flothmann
01b253969a fix bitwise operations 2020-08-31 11:42:54 +02:00
Alexander M. Turek
1055a7f29b [Validator] Fix PhpUnitBridge version constraint. 2020-08-31 11:01:51 +02:00
Fabien Potencier
0b65634439 Bump Symfony version to 5.1.5 2020-08-31 08:22:19 +02:00
Fabien Potencier
8f58b61278
Merge pull request #37999 from fabpot/release-5.1.4
released v5.1.4
2020-08-31 08:18:30 +02:00
Fabien Potencier
94ca568810 Update VERSION for 5.1.4 2020-08-31 08:18:12 +02:00
Fabien Potencier
4cdd8279e8 Update CHANGELOG for 5.1.4 2020-08-31 08:18:02 +02:00
Fabien Potencier
6e59396ff9 Bump Symfony version to 4.4.13 2020-08-31 08:14:12 +02:00
Fabien Potencier
da9869f693
Merge pull request #37998 from fabpot/release-4.4.12
released v4.4.12
2020-08-31 08:09:59 +02:00
Fabien Potencier
529eac9795 Update VERSION for 4.4.12 2020-08-31 08:09:42 +02:00
Fabien Potencier
3b0112b521 Update CHANGELOG for 4.4.12 2020-08-31 08:09:33 +02:00
Fabien Potencier
f4f7683861 Bump Symfony version to 3.4.45 2020-08-31 07:58:19 +02:00
Fabien Potencier
d7f1e2c760
Merge pull request #37997 from fabpot/release-3.4.44
released v3.4.44
2020-08-31 07:54:22 +02:00
Fabien Potencier
b1e65241ca Update VERSION for 3.4.44 2020-08-31 07:53:42 +02:00
Fabien Potencier
7981fe0a04 Update CONTRIBUTORS for 3.4.44 2020-08-31 07:52:54 +02:00
Fabien Potencier
0defe5380b Update CHANGELOG for 3.4.44 2020-08-31 07:51:46 +02:00
Fabien Potencier
63d7b222e6 minor #37989 Remove unneeded code (fabpot)
This PR was merged into the 5.2-dev branch.

Discussion
----------

Remove unneeded code

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a<!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

5ed8ebe50e Remove unneeded code
2020-08-30 13:55:14 +02:00
Fabien Potencier
3a9d588c4a minor #37990 Fix Composer constraint (fabpot)
This PR was merged into the 5.2-dev branch.

Discussion
----------

Fix Composer constraint

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

cbbca0e6ea Fix Composer constraint
2020-08-30 13:54:03 +02:00
Fabien Potencier
5ed8ebe50e Remove unneeded code 2020-08-30 12:31:26 +02:00
Fabien Potencier
cbbca0e6ea Fix Composer constraint 2020-08-30 12:30:32 +02:00
Fabien Potencier
2ffb6ba7e3 Merge branch '5.1'
* 5.1:
  [FrameworkBundle] fix tests
2020-08-30 11:59:17 +02:00
Fabien Potencier
96151f391a Merge branch '4.4' into 5.1
* 4.4:
  [FrameworkBundle] fix tests
2020-08-30 11:59:07 +02:00
Fabien Potencier
936196bc6e minor #37988 [FrameworkBundle] fix tests (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] fix tests

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/37967#issuecomment-683387401
| License       | MIT
| Doc PR        |

Commits
-------

19015ec404 [FrameworkBundle] fix tests
2020-08-30 11:56:37 +02:00
Fabien Potencier
2912fb9b6c minor #37987 [PropertyAccess] fix the deprecation message (xabbuh)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[PropertyAccess] fix the deprecation message

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

Commits
-------

a9cbac77eb fix the deprecation message
2020-08-30 11:43:36 +02:00
Christian Flothmann
19015ec404 [FrameworkBundle] fix tests 2020-08-30 11:40:10 +02:00
Christian Flothmann
a9cbac77eb fix the deprecation message 2020-08-30 11:27:09 +02:00
Fabien Potencier
e23a06400d bug #37986 [Translation] Fix logic (fabpot)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Translation] Fix logic

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a<!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

19f8cd423a [Translation] Fix logic
2020-08-30 10:30:45 +02:00
Fabien Potencier
0885ebb706 Merge branch '5.1'
* 5.1:
  Revert "bug #37622 [PropertyAccess] Fix accessing dynamic properties (andreyserdjuk)"
2020-08-30 10:30:09 +02:00
Fabien Potencier
47b9b5cf21 Revert "bug #37622 [PropertyAccess] Fix accessing dynamic properties (andreyserdjuk)"
This reverts commit 92cb709222, reversing
changes made to fc3095ff2f.
2020-08-30 10:29:58 +02:00
Fabien Potencier
19f8cd423a [Translation] Fix logic 2020-08-30 10:02:21 +02:00
Fabien Potencier
45329ab77d Merge branch '5.1'
* 5.1:
  Fix CS
  [HttpClient][MockHttpClient][DX] Throw when the response factory callable does not return a valid response
  [FrameworkBundle] Do not pass the base uri twice to scoped http clients
2020-08-30 09:26:26 +02:00
Fabien Potencier
c367e26e3e Merge branch '4.4' into 5.1
* 4.4:
  Fix CS
  [HttpClient][MockHttpClient][DX] Throw when the response factory callable does not return a valid response
  [FrameworkBundle] Do not pass the base uri twice to scoped http clients
2020-08-30 09:26:18 +02:00
Fabien Potencier
ba48f00516 feature #37979 [Workflow] Expose the Metadata Store in the DIC (lyrixx)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Workflow] Expose the Metadata Store in the DIC

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

I did not updated the CHANGELOG, because IMHO it not worth it

Commits
-------

aa7a444c86 [Workflow] Expose the Metadata Store in the DIC
2020-08-30 09:24:06 +02:00
Fabien Potencier
2adacbcff8 Fix CS 2020-08-30 09:21:38 +02:00
Fabien Potencier
4affb4622f Fix CS 2020-08-30 09:20:37 +02:00
Fabien Potencier
241af8057f feature #37371 [Translation] Add support for calling 'trans' with ICU formatted messages (someonewithpc)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Translation] Add support for calling 'trans' with ICU formatted messages

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | maybe, see https://github.com/symfony/symfony/issues/37228
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #37228
| License       | MIT
| Doc PR        | symfony/symfony-docs#13875

Motivation:

```
$apples = [0 => 'No apples', 1 => '1 apple', '# apples'];
echo _m($apples, ['count' => 0]); // Outputs 'No apples'
echo _m($apples, ['count' => 2]); // Outputs '2 apples'
```

where `_m` is a wrapper my application is using, but we obviously don't want to replicate many of the effort of the translation component, so it relies on `trans`.

This wrapper itself could be integrated into Symfony, if deemed appropriate.

See #37228

Commits
-------

d2ec41f4ef [Translation] Add support for calling 'trans' with ICU formatted messages
2020-08-30 09:19:50 +02:00
Hugo Sales
d2ec41f4ef [Translation] Add support for calling 'trans' with ICU formatted messages 2020-08-30 09:19:43 +02:00
Fabien Potencier
4d6ea775b7 bug #37966 [HttpClient][MockHttpClient][DX] Throw when the response factory callable does not return a valid response (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient][MockHttpClient][DX] Throw when the response factory callable does not return a valid response

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

The current message is `TypeError: Argument 4 passed to Symfony\Component\HttpClient\Response\MockResponse::fromRequest() must implement interface Symfony\Contracts\HttpClient\ResponseInterface, instance of Generator given`.

I lost some time with this because I was passing a callable that returns a \Generator instead of passing the resulting \Generator directly. We could support that case but I guess with the added exception message, it is clear we don't support it at all.

Commits
-------

564dce39f8 [HttpClient][MockHttpClient][DX] Throw when the response factory callable does not return a valid response
2020-08-30 08:55:38 +02:00
Fabien Potencier
943cbd804e minor #37967 [FrameworkBundle] Do not pass the base uri twice to scoped http clients (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Do not pass the base uri twice to scoped http clients

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

I looked at my dumped scoped http client PHP file and I noticed the base uri was passed two times. I thought there was a bug somewhere in my configuration. Actually, we only need to pass it as the method argument here.

Commits
-------

e2fce0d89f [FrameworkBundle] Do not pass the base uri twice to scoped http clients
2020-08-30 08:53:37 +02:00
Fabien Potencier
dc54cc9f5e feature #37670 [Translation] Translatable objects (natewiebe13)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Translation] Translatable objects

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | None
| License       | MIT
| Doc PR        | symfony/symfony-docs#... - Will be added if this gets approval

**Scenario**
When writing business logic, this code typically lives within services. With complex situations, there can be lots of business logic exceptions or messages being created. In order to have the best user experience, we try to display detailed messages to the end user so if it's an error with some data, they know what they need to do to correct the situation. Sometimes this is through a message on a page, an email, etc. In some cases a generic message might be displayed and we log the message instead or send the message in an email to a 3rd party.

The service shouldn't need to care how the message is going to be handled, but just needs to create it in a way that it can be translated if needed.

**Options**
Translating when the message is created. There are two issues with this approach. Autowiring the translator interface to services that will display an error isn't ideal as it will increase the dependencies the service has. The larger issue is that because we would be throwing an exception that contains a string or passing a message that's a string (what the translator returns), if we have generic twig templates that run the translator function on a message, we're doing a double translation and the debug toolbar will indicate that there is a missing message and turn red. This makes finding missing translations much more difficult as we have to determine if there are any false positives and turns the red indicator into white noise.

Translating when displaying on a template. This option is possible, but adds complexity to our templates. Each time we display a message, we need to have some kind of logic that checks to see if it should be ran through the translator as-is or we need to get the data from the object and pass into the translator.

**Proposed Solution**
Adding a Phrase object that we can create and pass around reduces the template complexity and adds a nice way to create objects that can be translated at any point. This something that will be very familiar with Magento developers and other platforms also have similar solutions.

**TODO**
- [x] Determine if overwriting the parameters should be allowed (currently implemented this way)
- [x] Determine the name of the translatable class, currently `Phrase` as `Message` will likely get confused with Messenger
- [x] Determine if there should be a global function to allow quickly creating these. Similar to `__()` in Magento
- [ ] Add docs
- [x] Add tests

Happy to get as much feedback as possible. I know a feature like this would be very welcomed by my team.

Commits
-------

dc6b3bf62d [Translation] Translatable objects
2020-08-28 18:48:27 +02:00
Nate Wiebe
dc6b3bf62d [Translation] Translatable objects 2020-08-28 18:48:14 +02:00
Fabien Potencier
6c094cce73 bug #37983 [PropertyInfo] Fix ReflectionExtractor::getTypesFromConstructor (ogizanagi)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[PropertyInfo] Fix ReflectionExtractor::getTypesFromConstructor

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | N/A <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | N/A

Fixes https://travis-ci.org/github/symfony/symfony/jobs/721953907#L4274-L4296

Relates to #30335

Commits
-------

6423d8a827 [PropertyInfo] Fix ReflectionExtractor::getTypesFromConstructor
2020-08-28 18:21:59 +02:00
Fabien Potencier
5472cf61fd Merge branch '5.1'
* 5.1:
  Fix typo
2020-08-28 18:19:43 +02:00
Fabien Potencier
5189571300 Merge branch '4.4' into 5.1
* 4.4:
  Fix typo
2020-08-28 18:19:35 +02:00
Fabien Potencier
4dc9ac0acc Fix typo 2020-08-28 18:19:28 +02:00
Fabien Potencier
5b3ebdc7e6 Merge branch '5.1'
* 5.1:
  [PhpUnitBridge] Create a predictable symlink pointing to the local install
  [PropertyInfo] Backport support for typed properties (PHP 7.4)
  [PhpUnitBridge] Polyfill new phpunit 9.1 assertions
  [PhpUnitBridge] Move assertMatchesRegularExpression in PolyfillAssertTrait
  [PhpUnit] Add polyfill for assertMatchesRegularExpression()
  Update Notifier bridge readme
  [TwigBridge] Fix #37931: BC break where filter method `trans` did not allow null values for `$message` parameter anymore
  [PropertyAccess] Fix accessing dynamic properties
2020-08-28 18:19:10 +02:00
Fabien Potencier
f6c0706762 Merge branch '4.4' into 5.1
* 4.4:
  [PhpUnitBridge] Create a predictable symlink pointing to the local install
  [PropertyInfo] Backport support for typed properties (PHP 7.4)
  [PhpUnitBridge] Polyfill new phpunit 9.1 assertions
  [PhpUnitBridge] Move assertMatchesRegularExpression in PolyfillAssertTrait
  [PhpUnit] Add polyfill for assertMatchesRegularExpression()
2020-08-28 18:18:32 +02:00
Maxime Steinhausser
6423d8a827 [PropertyInfo] Fix ReflectionExtractor::getTypesFromConstructor 2020-08-28 18:07:48 +02:00
Grégoire Pineau
aa7a444c86 [Workflow] Expose the Metadata Store in the DIC 2020-08-28 16:51:18 +02:00
Grégoire Pineau
3c943b94ed [Semaphore] Fixed some bugs 2020-08-28 16:01:04 +02:00
Thomas Calvet
564dce39f8 [HttpClient][MockHttpClient][DX] Throw when the response factory callable does not return a valid response 2020-08-28 14:30:47 +02:00