Commit Graph

48628 Commits

Author SHA1 Message Date
Christian Flothmann
c4e2c447ba silence E_NOTICE triggered since PHP 7.4 2020-04-12 11:28:02 +02:00
Fabien Potencier
55fef914cc Split a method 2020-04-12 11:15:20 +02:00
Fabien Potencier
d00b5b5e08 Remove default value 2020-04-12 11:14:14 +02:00
Fabien Potencier
6a27337333 bug #36365 [Validator] Fixed default group for nested composite constraints (HeahDude)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Fixed default group for nested composite constraints

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

Take a breath: when composite constraints are nested in a parent composite constraint without having non composite nested constraints (i.e empty), then the default group is not added, making the validator failing to validate in any group (including default), because there is no group at all, which should never happen.

Commits
-------

117ee34698 [Validator] Fixed default group for nested composite constraints
2020-04-12 09:44:21 +02:00
Fabien Potencier
d69b8bb730 feature #27444 [Console] Add Cursor class to control the cursor in the terminal (pierredup)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Console] Add Cursor class to control the cursor in the terminal

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

Add a new `Cursor` class to the Console component, that allows to manipulate the cursor in the terminal.

Options to move the cursor include: moveUp, moveDown, moveLeft, moveRight, show, hide, save and restore position, get current position etc.

Example usage:

```php
$cursor = new Cursor($output);

$parts = [
    ['x' => 9, 'y' => 5, 'string' => '#'],
    ['x' => 9, 'y' => 7, 'string' => '#'],
    ['x' => 2, 'y' => 7, 'string' => '#####'],
    ['x' => 9, 'y' => 1, 'string' => '#######'],
    ['x' => 7, 'y' => 6, 'string' => '#'],
    ['x' => 9, 'y' => 2, 'string' => '#'],
    ['x' => 9, 'y' => 6, 'string' => '#'],
    ['x' => 9, 'y' => 3, 'string' => '#'],
    ['x' => 2, 'y' => 1, 'string' => '#####'],
    ['x' => 7, 'y' => 2, 'string' => '#'],
    ['x' => 9, 'y' => 4, 'string' => '#####'],
    ['x' => 1, 'y' => 2, 'string' => '#'],
    ['x' => 1, 'y' => 6, 'string' => '#'],
    ['x' => 2, 'y' => 4, 'string' => '#####'],
    ['x' => 1, 'y' => 3, 'string' => '#'],
    ['x' => 7, 'y' => 5, 'string' => '#'],
];

foreach ($parts as $part) {
    $cursor->moveToPosition($part['x'], $part['y']);
    $output->write($part['string']);

    usleep(200000);
}

$cursor->moveToPosition(1, 8);
```

Result:

![kapture 2018-05-31 at 12 39 10](https://user-images.githubusercontent.com/144858/40777952-abb7c252-64cf-11e8-80a7-7417676c8b0b.gif)

Commits
-------

80d59d5c4a [Console] Add Cursor class to control the cursor in the terminal
2020-04-12 09:39:56 +02:00
Pierre du Plessis
80d59d5c4a [Console] Add Cursor class to control the cursor in the terminal 2020-04-12 09:39:50 +02:00
Fabien Potencier
f84592ac83 bug #36422 [HttpClient] fix HTTP/2 support on non-SSL connections - CurlHttpClient only (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix HTTP/2 support on non-SSL connections - CurlHttpClient only

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

Commits
-------

a5b884cd94 [HttpClient] fix HTTP/2 support on non-SSL connections - CurlHttpClient only
2020-04-12 09:39:11 +02:00
Fabien Potencier
280674f8bc bug #36417 Force ping after transport exception (oesteve)
This PR was merged into the 4.4 branch.

Discussion
----------

Force ping after transport exception

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

SMTP transport fails for long running processes after tranport exception, if stream is closed all messages will throw a transport exception until $lastMessageTime exceds $pingThreshold.

With this PR, after transport expception the transport will ping the server to check if the connection is still alive.

Commits
-------

7ccbef62f6 Force ping after transport Exception
2020-04-12 09:31:22 +02:00
Fabien Potencier
cd4a4bd3d1 bug #35591 [Validator] do not merge constraints within interfaces (greedyivan)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] do not merge constraints within interfaces

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

This fix disables merge constraints within interfaces.

There is no reason to merge constraints from one interface to another because each class merges the constraints of all its interfaces. Only one check is needed is to eliminate all interfaces that comes from parent class to avoid duplication.

Commits
-------

67f336b808 do not merge constraints within interfaces
2020-04-12 09:28:41 +02:00
Fabien Potencier
db733da440 minor #36428 [Form] Removed legacy check in ValidationListener (HeahDude)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Removed legacy check in `ValidationListener`

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

A left over of #13198, should have been removed in 3.0. The tests don't use `null` anymore, no update needed here, this is just about removing dead code.

Commits
-------

e479e51f7c [Form] Removed legacy check in `ValidationListener`
2020-04-12 09:19:14 +02:00
Fabien Potencier
7c98954920 feature #31390 [Serializer] UnwrappingDenormalizer (nonanerz)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Serializer] UnwrappingDenormalizer

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

UnwrappingDenormalizer, registered with very high priority. Unwrapping the data if UNWRAP_PATH is provided.

Very often some APIs give nested responses in which we need only the child object. With UnwrappingDenormalizer we can get the needed object without creating unnecessary Model class that we don't really need.

Regarding to https://github.com/symfony/symfony/pull/28887 and https://github.com/symfony/symfony/pull/30894

Usage:

`$serialiser->deserialize('{"baz": {"foo": "bar", "inner": {"title": "value", "numbers": [5,3]}}}', Object::class, ['UnwrappingDenormalizer::UNWRAP_PATH' => '[baz][inner]'])`

Commits
-------

00d103d5f7 UnwrappingDenormalizer
2020-04-12 09:17:11 +02:00
Fabien Potencier
607e8d6e76 minor #36353 [ErrorHandler] Remove trigger_deprecation frame from trace (fancyweb, nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[ErrorHandler] Remove trigger_deprecation frame from trace

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

This accounts for the new `trigger_deprecation` function from [symfony/deprecation-contracts](https://github.com/symfony/deprecation-contracts).

Replaces #36329

Commits
-------

d4eb4a4bd7 [ErrorHandler] Remove trigger_deprecation frame from trace (add tests)
c293aee9ab [ErrorHandler] Remove trigger_deprecation frame from trace
2020-04-12 09:13:14 +02:00
Fabien Potencier
1ee1c81d9a feature #36390 [DI] remove restriction and allow mixing "parent" and instanceof-conditionals/defaults/bindings (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[DI] remove restriction and allow mixing "parent" and instanceof-conditionals/defaults/bindings

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

We added these limitations because we didn't know how to merge all those dimensions. Yet, the code is perfectly able to handle all of them together.

This PR makes `parent` definitions first-class citizens again - no need to split them in a dedicated file anymore.

Commits
-------

622925300f [DI] remove restriction and allow mixing "parent" and instanceof-conditionals/defaults/bindings
2020-04-12 09:10:52 +02:00
Nicolas Grekas
622925300f [DI] remove restriction and allow mixing "parent" and instanceof-conditionals/defaults/bindings 2020-04-12 09:10:44 +02:00
Fabien Potencier
6ff7c2e1da feature #36388 [DI] deprecate the inline() function from the PHP-DSL in favor of service() (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[DI] deprecate the `inline()` function from the PHP-DSL in favor of `service()`

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

In the PHP-DSL, the `inline()` function helps declaring ... inline services.

I'm proposing to rename it to `service()`, for consistency with yaml tags. All other helpers but this one have the same name as the yaml tag.

Let's do this while "nobody" uses this format yet :)

Commits
-------

647d971ae4 [DI] deprecate the `inline()` function from the PHP-DSL in favor of `service()`
2020-04-12 09:00:32 +02:00
Fabien Potencier
9a6695c094 feature #36389 [DI] allow decorators to reference their decorated service using the special .inner id (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[DI] allow decorators to reference their decorated service using the special `.inner` id

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

Right now, when one wants to decorate a service, one needs to reference the decorated service using `foo.inner`, where `foo` is the id of the decorating service.

There are two issues with this IMHO:
- it's weird to have to repeat the name of declaring service inside of it;
- it doesn't play well with child definitions.

In this PR, I propose to use `.inner` to fix both issues.

Before:
```yaml
services:
  decorating_service:
    arguments: [@decorating_service.inner]
    decorates: decorated_service
```

After:
```yaml
services:
  decorating_service:
    arguments: [@.inner]
    decorates: decorated_service
```

Commits
-------

7b6f767fbe [DI] allow decorators to reference their decorated service using the special `.inner` id
2020-04-12 08:58:31 +02:00
Nicolas Grekas
c5bf92d64e Merge branch '5.0'
* 5.0:
  [travis][appveyor] don't cache .phpunit
2020-04-12 00:30:13 +02:00
Nicolas Grekas
82ea28d529 Merge branch '4.4' into 5.0
* 4.4:
  [travis][appveyor] don't cache .phpunit
2020-04-12 00:30:07 +02:00
Nicolas Grekas
0745ea4b1b Merge branch '3.4' into 4.4
* 3.4:
  [travis][appveyor] don't cache .phpunit
2020-04-12 00:30:01 +02:00
Nicolas Grekas
5182253aa2 [travis][appveyor] don't cache .phpunit 2020-04-12 00:02:45 +02:00
Nicolas Grekas
d1fd0b1949 Merge branch '5.0'
* 5.0:
  [travis] fix CI (bis)
2020-04-11 22:32:47 +02:00
Nicolas Grekas
4a64cb6633 Merge branch '4.4' into 5.0
* 4.4:
  [travis] fix CI (bis)
2020-04-11 22:32:34 +02:00
Nicolas Grekas
8302eedd26 [travis] fix CI (bis) 2020-04-11 22:32:21 +02:00
Jules Pietri
e479e51f7c
[Form] Removed legacy check in ValidationListener 2020-04-11 22:17:48 +02:00
Nicolas Grekas
2059db2896 Merge branch '5.0'
* 5.0:
  [travis] fix CI
2020-04-11 22:07:44 +02:00
Nicolas Grekas
f7606dbeda Merge branch '4.4' into 5.0
* 4.4:
  [travis] fix CI
2020-04-11 22:07:26 +02:00
Nicolas Grekas
3e441d3dbe minor #36429 [travis] fix CI (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[travis] fix CI

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

Commits
-------

f6410cbab2 [travis] fix CI
2020-04-11 22:05:25 +02:00
Nicolas Grekas
f6410cbab2 [travis] fix CI 2020-04-11 21:55:18 +02:00
Dimitri Gritsajuk
7854cb488e [Mailer][Messenger] add return statement for MessageHandler 2020-04-11 16:01:30 +02:00
Nicolas Grekas
a5b884cd94 [HttpClient] fix HTTP/2 support on non-SSL connections - CurlHttpClient only 2020-04-11 11:49:39 +02:00
Nicolas Grekas
6e3b9c7cd9 Merge branch '5.0'
* 5.0:
  [appveyor] bump cache
  [Twig][Mime] Removed extra quotes in missing package exception message
  [DI] µfix
  Allowing empty secrets to be set
  [DI] add missing property declarations in InlineServiceConfigurator
  [DI] fix detecting short service syntax in yaml
  Supress error from fread when reading a unix pipe
  [HttpClient] Fix scoped client without query option configuration
  [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore
  [Workflow] Use a strict comparison when retrieving raw markin in MarkingStore
2020-04-10 23:23:06 +02:00
Nicolas Grekas
c978b19e4f Merge branch '4.4' into 5.0
* 4.4:
  [appveyor] bump cache
  [Twig][Mime] Removed extra quotes in missing package exception message
  [DI] µfix
  Allowing empty secrets to be set
  [DI] add missing property declarations in InlineServiceConfigurator
  [DI] fix detecting short service syntax in yaml
  Supress error from fread when reading a unix pipe
  [HttpClient] Fix scoped client without query option configuration
  [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore
  [Workflow] Use a strict comparison when retrieving raw markin in MarkingStore
2020-04-10 23:22:25 +02:00
Nicolas Grekas
977276efa4 bug #36377 [HttpClient] Fix scoped client without query option configuration (X-Coder264)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Fix scoped client without query option configuration

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

The `query` key default value is an [empty array](https://github.com/symfony/symfony/blob/v4.4.7/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php#L30) and because of that it is always set. Processing a configuration for a scoped HTTP client (which has a `scope` and does not have a `base_uri`) results in the configuration being invalid. The error message says that query parameters cannot be aplied to the base URI since it is not defined (which doesn't make sense since the query parameters don't exist because they are empty).

Commits
-------

a07578dba3 [HttpClient] Fix scoped client without query option configuration
2020-04-10 23:11:29 +02:00
Nicolas Grekas
6f197466e5 bug #36387 [DI] fix detecting short service syntax in yaml (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] fix detecting short service syntax in yaml

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

We do allow interfaces/classes as keys in arguments, yet the short syntax fails to know about those.

This fixes it, allowing one to use:
```
services:
    App\Foo:
        App\BarInterface: '@App\BarClass'
```

As a reminder, by-name is also allowed:
```
services:
    App\Foo: {
        $bar: '@App\BarClass'
    }
```

Commits
-------

bf17165fb1 [DI] fix detecting short service syntax in yaml
2020-04-10 23:06:17 +02:00
Nicolas Grekas
ba58c6ff8e bug #36392 [DI] add missing property declarations in InlineServiceConfigurator (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] add missing property declarations in InlineServiceConfigurator

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

These are accessed by the traits used by the class.

Commits
-------

a6a4442cd9 [DI] add missing property declarations in InlineServiceConfigurator
2020-04-10 23:00:45 +02:00
Nicolas Grekas
2dd5fe67e0 bug #36400 Allowing empty secrets to be set (weaverryan)
This PR was merged into the 4.4 branch.

Discussion
----------

Allowing empty secrets to be set

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

Setting secrets to an empty string is a valid value - you can already do this by consuming from an empty file or `stdin` with no input. But it's *not* currently possible to use the interactive prompt to set a secret to an empty string. This fixes that.

Commits
-------

c9bf0c8683 Allowing empty secrets to be set
2020-04-10 22:51:50 +02:00
Nicolas Grekas
f2d4a2910d bug #36380 [Process] Fixed input/output error on PHP 7.4 (mbardelmeijer)
This PR was merged into the 4.4 branch.

Discussion
----------

[Process] Fixed input/output error on PHP 7.4

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

This PR aims to fix the error from #34945, but i'm unsure if this is the best solution. The issue is that on PHP 7.4 the input/output error may come up.

php.net/manual/en/migration74.incompatible.php#migration74.incompatible.core.fread-fwrite

> fread() and fwrite() will now return FALSE if the operation failed. Previously an empty string or 0 was returned. EAGAIN/EWOULDBLOCK are not considered failures. These functions now also raise a notice on failure, such as when trying to write to a read only file resource.

Commits
-------

b98abde65a Supress error from fread when reading a unix pipe
2020-04-10 22:46:28 +02:00
Nicolas Grekas
4be98cd992 Merge branch '3.4' into 4.4
* 3.4:
  [appveyor] bump cache
  [DI] µfix
2020-04-10 22:35:35 +02:00
Nicolas Grekas
8920f183fb [appveyor] bump cache 2020-04-10 22:35:26 +02:00
Nicolas Grekas
ac5f45b73a minor #36402 [Twig][Mime] Removed extra quotes in missing package exception message (mikemilano)
This PR was submitted for the master branch but it was squashed and merged into the 4.4 branch instead.

Discussion
----------

[Twig][Mime] Removed extra quotes in missing package exception message

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

The missing package exception copy had a double quote in the composer command disrupting the ability to copy/paste the command.

> try running "composer require "twig/cssinliner-extra twig/inky-extra"

This PR removes the quote before the package name so it reads:

> try running "composer require twig/cssinliner-extra twig/inky-extra"

Commits
-------

b2c9a6ea91 [Twig][Mime] Removed extra quotes in missing package exception message
2020-04-10 22:28:53 +02:00
Mike Milano
b2c9a6ea91 [Twig][Mime] Removed extra quotes in missing package exception message 2020-04-10 22:28:12 +02:00
Nicolas Grekas
015d8d7e86 [DI] µfix 2020-04-10 22:02:31 +02:00
Artem Lopata
728cd66a13 RepeatedType should always have inner types mapped 2020-04-10 21:29:36 +02:00
oesteve
7ccbef62f6 Force ping after transport Exception 2020-04-10 20:51:00 +02:00
Ryan Weaver
c9bf0c8683 Allowing empty secrets to be set 2020-04-09 10:53:24 -04:00
Ivan Grigoriev
67f336b808
do not merge constraints within interfaces 2020-04-09 15:51:11 +03:00
Nicolas Grekas
647d971ae4 [DI] deprecate the inline() function from the PHP-DSL in favor of service() 2020-04-09 10:45:03 +02:00
Nicolas Grekas
a6a4442cd9 [DI] add missing property declarations in InlineServiceConfigurator 2020-04-09 10:43:57 +02:00
Nicolas Grekas
7b6f767fbe [DI] allow decorators to reference their decorated service using the special .inner id 2020-04-08 17:02:25 +02:00
Nicolas Grekas
bf17165fb1 [DI] fix detecting short service syntax in yaml 2020-04-08 16:17:20 +02:00