Commit Graph

49010 Commits

Author SHA1 Message Date
Nicolas Grekas
02d9597a41 Merge branch '5.0'
* 5.0:
  Force doctrine/dbal <=2.10.2 when testing
2020-05-05 15:53:42 +02:00
Nicolas Grekas
cd21c8208e Merge branch '4.4' into 5.0
* 4.4:
  Force doctrine/dbal <=2.10.2 when testing
2020-05-05 15:53:15 +02:00
Nicolas Grekas
f8bedf4e79 Merge branch '3.4' into 4.4
* 3.4:
  Force doctrine/dbal <=2.10.2 when testing
2020-05-05 15:52:57 +02:00
Nicolas Grekas
a8b5b15c25 minor #36707 Force doctrine/dbal <=2.10.2 when testing (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Force doctrine/dbal <=2.10.2 when testing

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

Until https://github.com/doctrine/dbal/issues/3990 is resolved.

Commits
-------

d1953d61cd Force doctrine/dbal <=2.10.2 when testing
2020-05-05 15:52:00 +02:00
Nicolas Grekas
d1953d61cd Force doctrine/dbal <=2.10.2 when testing 2020-05-05 15:43:18 +02:00
Fabien Potencier
4228676b1a Merge branch '5.0'
* 5.0:
  [Console] fix "data lost during stream conversion" with QuestionHelper
2020-05-05 13:56:29 +02:00
Fabien Potencier
1f5eab2955 Merge branch '4.4' into 5.0
* 4.4:
  [Console] fix "data lost during stream conversion" with QuestionHelper
2020-05-05 13:56:08 +02:00
Fabien Potencier
cf6e499baf bug #36696 [Console] don't check tty on stdin, it breaks with "data lost during stream conversion" (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] don't check tty on stdin, it breaks with "data lost during stream conversion"

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

/cc @ostrolucky FYI

Commits
-------

6d089ac437 [Console] fix "data lost during stream conversion" with QuestionHelper
2020-05-05 13:55:38 +02:00
Nicolas Grekas
6d089ac437 [Console] fix "data lost during stream conversion" with QuestionHelper 2020-05-05 13:09:20 +02:00
Nicolas Grekas
11f4e8b475 Merge branch '5.0'
* 5.0:
  [PhpUnitBridge] fix PHP 5.3 compat
  [PhpUnitBridge] Mark parent class also covered in CoverageListener
  prevent notice for invalid octal numbers on PHP 7.4
2020-05-05 09:46:02 +02:00
Nicolas Grekas
bf1222621a Merge branch '4.4' into 5.0
* 4.4:
  [PhpUnitBridge] fix PHP 5.3 compat
  [PhpUnitBridge] Mark parent class also covered in CoverageListener
  prevent notice for invalid octal numbers on PHP 7.4
2020-05-05 09:39:14 +02:00
Nicolas Grekas
2732dda83c Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix PHP 5.3 compat
  [PhpUnitBridge] Mark parent class also covered in CoverageListener
  prevent notice for invalid octal numbers on PHP 7.4
2020-05-05 09:39:02 +02:00
Nicolas Grekas
f7fc3cf6cb [PhpUnitBridge] fix PHP 5.3 compat 2020-05-05 09:38:03 +02:00
Fabien Potencier
36c0ce7cfb feature #36681 [FrameworkBundle] use the router context by default for assets (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] use the router context by default for assets

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

Follows #36651 and #21027

This means assets are going to be configured automatically most of the time. The only case where `asset.request_context.base_path` is useful is when the webserver still keeps a `/index.php/` in URLs. (I'm not sure if the doc should tell ppl to use the parameter, or if we should tell ppl to improve the config of their server...)

Commits
-------

1ac5f68810 [FrameworkBundle] use the router context by default for assets
2020-05-05 09:03:13 +02:00
Fabien Potencier
3cb4056422 feature #35545 [Serializer] Allow to include the severity in ConstraintViolationList (dunglas)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Serializer] Allow to include the severity in ConstraintViolationList

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

The Validator component allow to attach severity and other data to a violation: https://symfony.com/doc/current/validation/severity.html
This feature allow to include all or some fields of this payload in serialized errors.

This feature is already supported in API Platform (https://api-platform.com/docs/core/validation/#error-levels-and-payload-serialization). Including this in Symfony will allow us to migrate from our own RFC7807 normalizer to the Symfony one.

Usage: see the test.

Commits
-------

be855a20bf [Serializer] Allow to include the severity in ConstraintViolationList
2020-05-05 08:59:32 +02:00
Kévin Dunglas
be855a20bf [Serializer] Allow to include the severity in ConstraintViolationList 2020-05-05 08:59:24 +02:00
Fabien Potencier
5a2aef1d7e feature #36471 [String] allow passing a string of custom characters to ByteString::fromRandom (azjezz)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[String] allow passing a string of custom characters to ByteString::fromRandom

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

Commits
-------

5d15c0be60 [String] allow passing a string of custom characters to ByteString::fromRandom
2020-05-05 08:58:12 +02:00
Fabien Potencier
ad01068b38 Revert "feature #36184 [FrameworkBundle] Deprecate renderView() in favor of renderTemplate() (javiereguiluz)"
This reverts commit b494beb5dc, reversing
changes made to b9d41490fe.
2020-05-05 08:53:10 +02:00
Fabien Potencier
3e737ec28f feature #35092 [Inflector][String] Move Inflector in String (fancyweb)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Inflector][String] Move Inflector in String

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | https://github.com/orgs/symfony/projects/1#card-30499514
| License       | MIT
| Doc PR        | -

Needs https://github.com/symfony/symfony/pull/35091.

Should we have a standalone inflector (like the Slugger) or 2 new methods (pluralize and singularize) on the AbstractString class? I implemented both but since we only handle English I finally preferred the first one.

TODO (after the "move" is OK):
- [x] Deprecate the Inflector component
- [x] Use the String inflector in Symfony's code

Commits
-------

9c6a5c0093 [String] Move Inflector in String
2020-05-05 08:52:01 +02:00
Fabien Potencier
341ea45219 feature #36302 [Form] Add the html5 option to ColorType to validate the input (fancyweb)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Form] Add the html5 option to ColorType to validate the input

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

Continuation of https://github.com/symfony/symfony/pull/35626.

I'm resubmitting the initial implementation, this time in the Form component.

This `Color` constraint is dedicated to the HTML5 input type="color".

Commits
-------

454b6ff48b [Form] Add the html5 option to ColorType to validate the input
2020-05-05 08:48:59 +02:00
Thomas Calvet
9c6a5c0093 [String] Move Inflector in String 2020-05-05 08:40:05 +02:00
Fabien Potencier
b494beb5dc feature #36184 [FrameworkBundle] Deprecate renderView() in favor of renderTemplate() (javiereguiluz)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] Deprecate renderView() in favor of renderTemplate()

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

Commits
-------

7b9ff2a445 [FrameworkBundle] Deprecate renderView() in favor of renderTemplate()
2020-05-05 08:26:36 +02:00
Javier Eguiluz
7b9ff2a445 [FrameworkBundle] Deprecate renderView() in favor of renderTemplate() 2020-05-05 08:26:27 +02:00
Fabien Potencier
b9d41490fe feature #36655 Automatically provide Messenger Doctrine schema to "diff" (weaverryan)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

Automatically provide Messenger Doctrine schema to "diff"

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Alternative to #36629
| License       | MIT
| Doc PR        | TODO - WILL be needed

This follows this conversation: https://github.com/symfony/symfony/pull/36629#issuecomment-621745821 - it automatically adds SQL to Doctrine's migration/diff system when features are added the require a database table:

The new feature works for:

### A) Messenger Doctrine transport
**FULL support**
Works perfectly: configure a doctrine transport and run `make:migration`

**Note**: There is no current way to disable this. So if you have `auto_setup` ON and you
run `make:migration` before trying Messenger, it will generate the table SQL. Adding a
flag to disable it might be very complicated, because we need to know (in DoctrineBundle, at compile time) whether or not this feature is enabled/disabled so that we can decide *not* to add `messenger_messages` to the `schema_filter`.

### B) `PdoAdapter` from Cache
**FULL support**
Works perfectly: configure a doctrine transport and run `make:migration`

### C) `PdoStore` from Lock
**PARTIAL support**
I added `PdoStore::configureSchema()` but did NOT add a listener. While `PdoStore` *does* accept a DBAL `Connection`, I don't think it's possible via the `framework.lock` config to create a `PdoStore` that is passed a `Connection`. In other words: if we added a listener that called `PdoStore::configureSchema` if the user configured a `pdo` lock, that service will *never* have a `Connection` object... so it's kind of worthless.

**NEED**: A proper way to inject a DBAL `Connection` into `PdoStore` via `framework.lock` config.

### D) `PdoSessionHandler`
**NO support**

This class doesn't accept a DBAL `Connection` object. And so, we can't reliably create a listener to add the schema because (if there are multiple connections) we wouldn't know which Connection to use.

We could compare (`===`) the `PDO` instance inside `PdoSessionHandler` to the wrapped `PDO` connection in Doctrine. That would only work if the user has configured their `PdoSessionHandler` to re-use the Doctrine PDO connection.

The `PdoSessionHandler` *already* has a `createTable()` method on it to help with manual migration. But... it's not easy to call from a migration because you would need to fetch the `PdoSessionHandler` service from the container. Adding something

**NEED**: Either:

A) A way for `PdoSessionHandler` to use a DBAL Connection
or
B) We try to hack this feature by comparing the `PDO` instances in the event subscriber
or
C) We add an easier way to access the `createTable()` method from inside a migration.

TODOs

* [X] Determine service injection XML needed for getting all PdoAdapter pools
* [ ] Finish DoctrineBundle PR: https://github.com/doctrine/DoctrineBundle/pull/1163

Commits
-------

2dd9c3c3c8 Automatically provide Messenger Doctrine schema to "diff"
2020-05-05 08:13:58 +02:00
Ryan Weaver
2dd9c3c3c8 Automatically provide Messenger Doctrine schema to "diff" 2020-05-05 08:13:52 +02:00
Fabien Potencier
3d30ff7677 feature #35849 [ExpressionLanguage] Added expression language syntax validator (Andrej-in-ua)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[ExpressionLanguage] Added expression language syntax validator

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | #35700
| License       | MIT
| Doc PR        | N/A <!-- required for new features -->

Proposal implementation #35700

The current solution is a compromise between support complexity and cleanliness.

I tried different solutions to the issue. A beautiful solution was obtained only with full duplication of the parser code. That is unacceptable because parser complexity is quite high.

The main problem in this solution is that nodes instances are created which are then not used. I do not think that linter can be a bottleneck and will greatly affect performance. If this is corrected, the parser code becomes a bunch of if's.

JFI: I did not added parsing without variable names, because this breaks caching and potential location for vulnerabilities.

Commits
-------

a5cd965494 [ExpressionLanguage] Added expression language syntax validator
2020-05-05 07:59:29 +02:00
Andrey Sevastianov
a5cd965494 [ExpressionLanguage] Added expression language syntax validator 2020-05-05 07:59:23 +02:00
Fabien Potencier
ac1a336040 Fix typo 2020-05-05 07:41:22 +02:00
Fabien Potencier
a0c2dd8a87 feature #36656 [Security/Core] Add CustomUserMessageAccountStatusException (VincentLanglet)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Security/Core] Add CustomUserMessageAccountStatusException

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

When implementing the `UserCheckerInterface`, we can throw `AccountStatusException`. Similar to `CustomUserMessageAuthenticationException`, this exception allow to throw an `AccountStatusException` with a custom message.

Commits
-------

9233efbe06 Add CustomUserMessageAccountStatusException
2020-05-05 07:40:46 +02:00
Fabien Potencier
c2cc99375d Fix changelog 2020-05-05 07:40:09 +02:00
Fabien Potencier
55706f75ac feature #36621 Log deprecations on a dedicated Monolog channel (l-vo)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

Log deprecations on a dedicated Monolog channel

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | https://github.com/orgs/symfony/projects/1#card-35233930
| License       | MIT
| Doc PR        |

This PR allows to activate a specific channel for deprecations.

## Base configuration

```yaml
monolog:
    handlers:
        #...
        deprecation:
            type: stream
            path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
        deprecation_filter:
            type: filter
            handler: deprecation
            max_level: info
            channels: ["php"]
```

## Deprecation specific channel enabled:

```yaml
monolog:
    channels: ['deprecation']
    handlers:
        #...
        deprecation:
            type: stream
            channels: ["deprecation"]
            path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
```

Commits
-------

3d415cb70d Log deprecations on a dedicated Monolog channel
2020-05-05 07:39:34 +02:00
Laurent VOULLEMIER
3d415cb70d Log deprecations on a dedicated Monolog channel 2020-05-05 07:39:28 +02:00
Fabien Potencier
9b8911598b bug #36569 [PhpUnitBridge] Mark parent class also covered in CoverageListener (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] Mark parent class also covered in CoverageListener

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

Commits
-------

dcb5653728 [PhpUnitBridge] Mark parent class also covered in CoverageListener
2020-05-05 07:34:36 +02:00
Fabien Potencier
09d78cf0d2 feature #34813 [Yaml] support YAML 1.2 octal notation, deprecate YAML 1.1 one (xabbuh)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Yaml] support YAML 1.2 octal notation, deprecate YAML 1.1 one

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

Commits
-------

440e0b7b63 support YAML 1.2 octal notation, deprecate YAML 1.1 one
2020-05-05 07:31:45 +02:00
Fabien Potencier
6340e87755 bug #36690 [Yaml] prevent notice for invalid octal numbers on PHP 7.4 (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] prevent notice for invalid octal numbers on PHP 7.4

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

Commits
-------

92bc19fd0c prevent notice for invalid octal numbers on PHP 7.4
2020-05-05 07:30:40 +02:00
Grégoire Pineau
dcb5653728 [PhpUnitBridge] Mark parent class also covered in CoverageListener 2020-05-05 00:33:45 +02:00
azjezz
5d15c0be60 [String] allow passing a string of custom characters to ByteString::fromRandom 2020-05-04 23:13:29 +01:00
Christian Flothmann
440e0b7b63 support YAML 1.2 octal notation, deprecate YAML 1.1 one 2020-05-04 22:33:22 +02:00
Christian Flothmann
92bc19fd0c prevent notice for invalid octal numbers on PHP 7.4 2020-05-04 18:58:31 +02:00
Fabien Potencier
0d4bba82b8 feature #36557 [Messenger] Add support for RecoverableException (jderusse)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Messenger] Add support for RecoverableException

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

The messenger supports the `UnrecoverableException` preventing the messenger retry mechanism
 when the Handler will never be able to process the Message.

This PR adds the opposite behavior to always retry the message.

UseCase:
- High concurency Consumers use non-blocking lock
- 503/429 errors from 3rd party API

Commits
-------

e7c31675f7 [Messenger] Add support for RecoverableException
2020-05-04 18:55:50 +02:00
Jérémy Derussé
e7c31675f7 [Messenger] Add support for RecoverableException 2020-05-04 18:55:44 +02:00
Nicolas Grekas
6852327eee minor #36689 [Yaml] properly handle empty lines (xabbuh)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Yaml] properly handle empty lines

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

Commits
-------

e91bb614ae properly handle empty lines
2020-05-04 18:38:20 +02:00
Christian Flothmann
e91bb614ae properly handle empty lines 2020-05-04 18:35:27 +02:00
Nicolas Grekas
ca1d4b4a93 minor #36688 [Form] fix tests (xabbuh)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Form] fix tests

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

Commits
-------

6d0195f3cd fix tests
2020-05-04 18:20:19 +02:00
Christian Flothmann
6d0195f3cd fix tests 2020-05-04 18:17:53 +02:00
Nicolas Grekas
39aab260d4 Merge branch '5.0'
* 5.0:
  Use PHP 7.2 minimum in tests run with github actions
  Fix exception messages containing exception messages
2020-05-04 17:54:21 +02:00
Nicolas Grekas
8cf8f5a5be minor #36686 [5.0] Use PHP 7.2 minimum in tests run with github actions (jakzal)
This PR was merged into the 5.0 branch.

Discussion
----------

[5.0] Use PHP 7.2 minimum in tests run with github actions

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

Commits
-------

8b386f2e81 Use PHP 7.2 minimum in tests run with github actions
2020-05-04 17:35:35 +02:00
Nicolas Grekas
992f50fee2 Merge branch '4.4' into 5.0
* 4.4:
  Fix exception messages containing exception messages
2020-05-04 17:34:58 +02:00
Nicolas Grekas
b0573cb418 Merge branch '3.4' into 4.4
* 3.4:
  Fix exception messages containing exception messages
2020-05-04 17:32:48 +02:00
Jakub Zalas
8b386f2e81
Use PHP 7.2 minimum in tests run with github actions 2020-05-04 16:21:41 +01:00