Commit Graph

49871 Commits

Author SHA1 Message Date
Nicolas Grekas
78e6fc4b42 bug #37449 [Translation] Fix caching of parent locales file in translator (jvasseur)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translation] Fix caching of parent locales file in translator

| Q             | A
| ------------- | ---
| Branch?       | 4.4 (this is the lowest maintained branch with this code)
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       |
| License       | MIT
| Doc PR        |

The `parentLocales` property was probably meant as a cache for the content of the `parents.json` file but instead the content is stored in a local variable and the property stays `null`. This means the file is read on each call to `computeFallbackLocales`.

This PR update the code to what was probably meant to be.

(Ref https://github.com/symfony/symfony/pull/28070)

Commits
-------

02c9ac68a4 Fix caching of parent locales file in translator
2020-06-30 15:55:33 +02:00
Nicolas Grekas
801f4cd7ac minor #37458 Removed comments and requirements relative to php <5.5 (not supported anymore) (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

Removed comments and requirements relative to php <5.5 (not supported anymore)

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

---

There is also https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php#L270-L276 but I think we could let it in place (and this file does not exist on master)

Commits
-------

5c5ea7500e Removed comments and requirements relative to php <5.5 (not supported anymore)
2020-06-30 14:59:42 +02:00
Grégoire Pineau
5c5ea7500e Removed comments and requirements relative to php <5.5 (not supported anymore) 2020-06-30 14:50:28 +02:00
Nicolas Grekas
d555112fbf feature #37443 [HttpClient] add StreamableInterface to ease turning responses into PHP streams (nicolas-grekas)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] add StreamableInterface to ease turning responses into PHP streams

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

Commits
-------

de103b31a9 [HttpClient] add StreamableInterface to ease turning responses into PHP streams
2020-06-30 14:30:51 +02:00
Nicolas Grekas
f42893c022 CS fix 2020-06-30 13:54:22 +02:00
Nicolas Grekas
3ce43915bd minor #37433 Console ProgressBar: Change redraw default value to 25fps (flack)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Console ProgressBar: Change redraw default value to 25fps

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

`ProgressBar` has a default value of `0.1` for `$minSecondsBetweenRedraws` which works out to 10 fps, so below the threshhold at which the human eye perceives it as a moving image instead of a series of individual images. Of course, the console's progress bar is not really an animation tool, but it seems like a low-hanging fruit to change the redraw frequency to something that can be perceived as a fluid motion. So I'm proposing to change `$minSecondsBetweenRedraws` to `0.016666666666667`, i.e. 60 fps, which is a fairly typical refresh rate for computer screens, so redrawing more often than that would be pointless. It means of course to redraw six times more often than currently, but i guess performance is not such a big concern here, right?

Commits
-------

b1c38bada7 Console ProgressBar: Change redraw default value to 25fps
2020-06-30 11:12:36 +02:00
flack
b1c38bada7 Console ProgressBar: Change redraw default value to 25fps 2020-06-30 11:11:53 +02:00
Christian Flothmann
6aecad7438 Merge branch '5.1'
* 5.1:
  fix compatibility with Doctrine DBAL 3.0
  skip test if guesser is not supported
  Added missing license headers
2020-06-29 16:32:23 +02:00
Christian Flothmann
eb58ea6a26 Merge branch '5.0' into 5.1
* 5.0:
  fix compatibility with Doctrine DBAL 3.0
  skip test if guesser is not supported
2020-06-29 16:31:29 +02:00
Christian Flothmann
5a91e51154 Merge branch '4.4' into 5.0
* 4.4:
  fix compatibility with Doctrine DBAL 3.0
  skip test if guesser is not supported
2020-06-29 16:24:36 +02:00
Christian Flothmann
f194602c30 minor #37450 [Mime] skip test if guesser is not supported (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] skip test if guesser is not supported

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

fixes tests on AppVeyor

Commits
-------

3b77abea65 skip test if guesser is not supported
2020-06-29 16:24:11 +02:00
Christian Flothmann
4e16dfdb09 minor #37448 [Messenger] fix compatibility with Doctrine DBAL 3.0 (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] fix compatibility with Doctrine DBAL 3.0

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

see doctrine/dbal#4100 and doctrine/dbal#4125

Commits
-------

b17df8cdd7 fix compatibility with Doctrine DBAL 3.0
2020-06-29 16:22:04 +02:00
Christian Flothmann
b17df8cdd7 fix compatibility with Doctrine DBAL 3.0 2020-06-29 15:55:34 +02:00
Christian Flothmann
3b77abea65 skip test if guesser is not supported 2020-06-29 15:46:05 +02:00
Jérôme
02c9ac68a4
Fix caching of parent locales file in translator 2020-06-29 15:31:43 +02:00
Christian Flothmann
776daf28b4 fix validating lazy properties that evaluate to null 2020-06-29 12:55:42 +02:00
Fabien Potencier
f706d6a276 minor #37445 [Security] Added missing license headers (wouterj)
This PR was merged into the 5.1 branch.

Discussion
----------

[Security] Added missing license headers

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

See 3be6ce121b

Seems like the fabbot reviews (and I) missed quite a lot of these in my big security PR.

Commits
-------

ea81b61e5f Added missing license headers
2020-06-29 10:19:14 +02:00
Wouter de Jong
ea81b61e5f Added missing license headers 2020-06-28 20:41:01 +02:00
Nicolas Grekas
de103b31a9 [HttpClient] add StreamableInterface to ease turning responses into PHP streams 2020-06-28 17:56:16 +02:00
Nicolas Grekas
75031a1230 Merge branch '5.1'
* 5.1:
  Fix test that fails on old distros
  Fix: compatibility with phpunit 9.3
  [DoctrineBridge] work around Connection::ping() deprecation
  [MimeType] Duplicated MimeType due to PHP Bug
  [HttpClient] fix casting TraceableResponse to php streams
  [DI] fix parsing of argument type=binary in xml
  fix guessing form types for DateTime types
  fix handling typed properties as constraint options
  Fix the 'supports' method argument type of the security voter
  Use the driverConnection executeUpdate method
2020-06-28 17:36:15 +02:00
Nicolas Grekas
009961795b bug #37440 [HttpClient] fix casting TraceableResponse to php streams (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[HttpClient] fix casting TraceableResponse to php streams

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

We'd better replace these checks by an `instanceof` one, but that'd be for master.

Commits
-------

5733289278 [HttpClient] fix casting TraceableResponse to php streams
2020-06-28 17:33:45 +02:00
Nicolas Grekas
4ad5079082 Merge branch '5.0' into 5.1
* 5.0:
  Fix test that fails on old distros
  Fix: compatibility with phpunit 9.3
  [DoctrineBridge] work around Connection::ping() deprecation
  [MimeType] Duplicated MimeType due to PHP Bug
  [DI] fix parsing of argument type=binary in xml
  fix guessing form types for DateTime types
  fix handling typed properties as constraint options
  Fix the 'supports' method argument type of the security voter
  Use the driverConnection executeUpdate method
2020-06-28 17:32:35 +02:00
Nicolas Grekas
55768b18c9 Merge branch '4.4' into 5.0
* 4.4:
  Fix test that fails on old distros
  Fix: compatibility with phpunit 9.3
  [DoctrineBridge] work around Connection::ping() deprecation
  [MimeType] Duplicated MimeType due to PHP Bug
  [DI] fix parsing of argument type=binary in xml
  fix guessing form types for DateTime types
  fix handling typed properties as constraint options
  Use the driverConnection executeUpdate method
2020-06-28 17:28:17 +02:00
Nicolas Grekas
27290714b7 Merge branch '3.4' into 4.4
* 3.4:
  Fix test that fails on old distros
2020-06-28 17:22:55 +02:00
Nicolas Grekas
b344f6d7db Fix test that fails on old distros 2020-06-28 17:22:27 +02:00
Nicolas Grekas
9709500d29 bug #37418 [PhpUnitBridge] Fix compatibility with phpunit 9.3 (Gennadi Janzen)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Fix compatibility with phpunit 9.3

| Q             | A
| ------------- | ---
| Branch?       | master for features / 4.4 <!-- 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       | - <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | -<!-- required for new features -->

In PHPUnit 9.3 some Classes were moved or renamed, to make the PhpunitBridge compatible with PhpUnit 9.3 it necessary to call the new Loader instead of the Registry.
<!--
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/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - 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 master.
-->

Commits
-------

de71a12f3b Fix: compatibility with phpunit 9.3
2020-06-28 17:12:52 +02:00
Gennadi Janzen
de71a12f3b Fix: compatibility with phpunit 9.3 2020-06-28 17:12:40 +02:00
Nicolas Grekas
9c6d53a78b bug #37441 [DoctrineBridge] work around Connection::ping() deprecation (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] work around Connection::ping() deprecation

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

Follows e603a2e233

Commits
-------

9ccf043c7c [DoctrineBridge] work around Connection::ping() deprecation
2020-06-28 17:08:21 +02:00
Nicolas Grekas
2e2fac8766 Merge branch '3.4' into 4.4
* 3.4:
  [MimeType] Duplicated MimeType due to PHP Bug
  fix guessing form types for DateTime types
  fix handling typed properties as constraint options
2020-06-28 17:07:02 +02:00
Nicolas Grekas
9ccf043c7c [DoctrineBridge] work around Connection::ping() deprecation 2020-06-28 16:59:58 +02:00
Nicolas Grekas
6ef3fee863 bug #37291 [MimeType] Duplicated MimeType due to PHP Bug (juanmrad)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[MimeType] Duplicated MimeType due to PHP Bug

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

## Issue:

Currently there is a PHP bug https://bugs.php.net/bug.php?id=77784 that is causing several MimeTypes to be given as duplicated:

```
application/vnd.openxmlformats-officedocument.spreadsheetml.sheetapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
```
Instead of:
```
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
```

This Patch will fix the Issues by checking if a returned MimeType is duplicated and return appropriate MimeType.

This patch should be reverted if the PHP Bug is ever fixed.

Commits
-------

7cb29c8b4b [MimeType] Duplicated MimeType due to PHP Bug
2020-06-28 16:49:48 +02:00
Juan Mrad
7cb29c8b4b [MimeType] Duplicated MimeType due to PHP Bug 2020-06-28 16:49:36 +02:00
Nicolas Grekas
5733289278 [HttpClient] fix casting TraceableResponse to php streams 2020-06-28 16:07:40 +02:00
Nicolas Grekas
0492099432 Merge branch '5.1'
* 5.1:
  [Notifier] Notifier 5.2 is incompatible with 5.1 bridges.
  [DI] fix minor perf regression when creating non-shared services
2020-06-28 15:35:06 +02:00
Nicolas Grekas
b57f414d4a minor #37438 [Notifier] Notifier 5.2 is incompatible with 5.1 bridges (derrabus)
This PR was merged into the 5.1 branch.

Discussion
----------

[Notifier] Notifier 5.2 is incompatible with 5.1 bridges

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

#36611 introduced a breaking change that made the Notifier 5.2 incompatible with all Notifier bridges 5.0-5.1. Because of this, the tests are currently failing on Travis. This PR attempts to fix this.

Commits
-------

1b6bbc2e71 [Notifier] Notifier 5.2 is incompatible with 5.1 bridges.
2020-06-28 15:31:24 +02:00
Fabien Potencier
7f0338e039 bug #37435 [DI] fix minor perf regression when creating non-shared services (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[DI] fix minor perf regression when creating non-shared services

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

This PR restores some dumped code that was too aggressively removed in  #36193.

Commits
-------

75e2ee17b0 [DI] fix minor perf regression when creating non-shared services
2020-06-28 09:02:59 +02:00
Fabien Potencier
36538369ca bug #37429 [DI] fix parsing of argument type=binary in xml (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] fix parsing of argument type=binary in xml

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

Parameters and arguments can be of type="binary" since #25928. But the XSD forgot to be updated for arguments.
So if you try to run `bin/console debug:container` you'd get an error like

```
In XmlFileLoader.php line 385:

  Unable to parse file "var/cache/dev/App_KernelDevDebugContainer.xml": [ERROR 1840] Element '{ht
  tp://symfony.com/schema/dic/services}argument', attribute 'type': [facet 'enumeration'] The value 'binary' is not a
  n element of the set {'abstract', 'collection', 'service', 'expression', 'string', 'constant', 'iterator', 'service
  _locator', 'tagged', 'tagged_iterator', 'tagged_locator'}. (in /home/benny/project/ - line 505, column 0)
  [ERROR 1824] Element '{http://symfony.com/schema/dic/services}argument', attribute 'type': 'binary' is not a valid
  value of the atomic type '{http://symfony.com/schema/dic/services}argument_type'. (in /home/benny/project/ - line 5
  05, column 0)`
```

Commits
-------

70b6a00148 [DI] fix parsing of argument type=binary in xml
2020-06-28 08:59:54 +02:00
Alexander M. Turek
1b6bbc2e71 [Notifier] Notifier 5.2 is incompatible with 5.1 bridges. 2020-06-27 23:56:40 +02:00
Nicolas Grekas
75e2ee17b0 [DI] fix minor perf regression when creating non-shared services 2020-06-27 15:48:04 +02:00
Tobias Schultze
70b6a00148 [DI] fix parsing of argument type=binary in xml 2020-06-26 19:49:20 +02:00
Fabien Potencier
9566cff6e7 bug #37425 [Form] fix guessing form types for DateTime types (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] fix guessing form types for DateTime types

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

Commits
-------

9ba90bf1f8 fix guessing form types for DateTime types
2020-06-26 18:00:04 +02:00
Christian Flothmann
9ba90bf1f8 fix guessing form types for DateTime types 2020-06-26 14:15:21 +02:00
Tobias Schultze
80d1f44983 remove empty form xml service config files 2020-06-25 21:35:39 +02:00
Fabien Potencier
9660e6b1e2 bug #37392 [Validator] fix handling typed properties as constraint options (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] fix handling typed properties as constraint options

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

Commits
-------

4a66a6098f fix handling typed properties as constraint options
2020-06-25 12:06:33 +02:00
Christian Flothmann
4a66a6098f fix handling typed properties as constraint options 2020-06-25 11:23:26 +02:00
Fabien Potencier
24350138b9 bug #37325 Fix the supports() method argument type of the security voter (francoispluchino)
This PR was submitted for the master branch but it was merged into the 5.0 branch instead.

Discussion
----------

Fix the supports() method argument type of the security voter

| Q             | A
| ------------- | ---
| Branch?       | 5.0 and 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | ~
| License       | MIT
| Doc PR        | ~

Since adding types to method arguments in the version 5.0 (and therefore also 5.1), there is a type mismatch on the first argument of the `supports()` method of the abstract class `Symfony\Component\Security\Core\Authorization\Voter\Voter`.

Indeed, the `supports()` method had in previous versions (4.x), the phpdoc indicating that the argument `$attribute` must be a `string`, but this one is not compatible with the `isGranted()` method of the interface `Symfony\Component\Security\Core\AuthorizationAuthorizationCheckerInterface` whose the `$attribute` argument is of type `mixed`.

The problem arises when you have voters extending the abstract class `Voter` positioned before a vote with an attribute of a type other than `string`.

Apart from Voters created by third parties, there is the voter `ExpressionVoter` which waits in attribute, an instance of the class `Symfony\Component\ExpressionLanguage\Expression` (you can see the [doc](https://symfony.com/doc/current/security/expressions.html) for an example). Just add a voter extending the abstract class `Voter` with a higher priority than the voter `ExpressionVoter` to get the error:

```
Argument 1 passed to FooVoter::supports() must be of the type string, object given
```

To avoid removing the type of the `$attribute` argument from the method `Symfony\Component\Security\Core\Authorization\Voter\Voter::supports(string $attribute, $subject)`, which can break the backward compatibility, you just have to test in the `vote()` method if the attribute is not a `string` and continue before calling the `supports()` method.

Commits
-------

b8192eecab Fix the 'supports' method argument type of the security voter
2020-06-25 11:02:02 +02:00
François Pluchino
b8192eecab Fix the 'supports' method argument type of the security voter 2020-06-25 11:01:55 +02:00
Fabien Potencier
7bac792328 Fix logic 2020-06-25 10:39:34 +02:00
Fabien Potencier
73596ef4f7 bug #37358 Directly use the driverConnection executeUpdate method (TristanPouliquen)
This PR was merged into the 4.4 branch.

Discussion
----------

Directly use the driverConnection executeUpdate method

executeUpdate & executeQuery methods do not throw a TableNotFoundException. No need for the try/catch as it is done for executeQuery

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

As explained in https://github.com/symfony/symfony/issues/37355, when doing a write operation, one should avoid using the `executeQuery` method of a Connection, as Doctrine's MasterSlaveConnection can pick a slave instance (usually read-only) for these operations.

Commits
-------

eec12ecd23 Use the driverConnection executeUpdate method
2020-06-25 10:28:26 +02:00
Fabien Potencier
213c6ab6d5 bug #36347 [Notifier][Slack] Error trown when having more than 10 fields specified #36346 (birkof)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Notifier][Slack] Error trown when having more than 10 fields specified #36346

| 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       | Fix #36346 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

As written in [docs](https://api.slack.com/reference/block-kit/blocks#section) of Section block, for fields we have to had maximum 10 items specified.

Commits
-------

68b2490ee2 [Notifier][Slack] Error trown when having more than 10 fields specified #36346
2020-06-25 09:24:04 +02:00