Commit Graph

36335 Commits

Author SHA1 Message Date
Alexander M. Turek
4039b95d22 Add types to constructors and private/final/internal methods (Batch I) 2019-09-27 07:43:04 +02:00
Fabien Potencier
66f8f68e13 feature #33574 [Http][DI] Replace REMOTE_ADDR in trusted proxies with the current REMOTE_ADDR (mcfedr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Http][DI] Replace REMOTE_ADDR in trusted proxies with the current REMOTE_ADDR

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

Currently handling trusted ips when deploying behind some CDNs/Load balancers such as ELB is difficult because they dont have a constant IP address, its possible to overcome this as is suggested by the docs - https://symfony.com/doc/current/deployment/proxies.html#but-what-if-the-ip-of-my-reverse-proxy-changes-constantly - by settings trusted proxies to `$request->server->get('REMOTE_ADDR')` - but this has to be done in code, and so becomes dangerous if you code is deployed in different environments.

This change would allow the developer to stick to providing the envvar `TRUSTED_PROXIES`, and in the environment behind a ELB set the value to the literal string `REMOTE_ADDR`, and have it replaced at run time. This way in environments that are not using ELB his app is kept safe.

I think doing this replacement in `Request:: setTrustedProxies` is the best place because it means this feature isn't exposed to other parts of the code that might call `Request::getTrustedProxies`.

Commits
-------

643c9ff257 Replace REMOTE_ADDR in trusted proxies with the current REMOTE_ADDR
2019-09-27 07:42:32 +02:00
Fabien Potencier
7a3bfac209 minor #33725 [HttpFoundation] optimize normalization of headers (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] optimize normalization of headers

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

I was experimenting with using maps to bypass calls to normalization functions, but that didn't lead to any significant perf improvement.

I still found this, the new call is twice as fast :)

Commits
-------

9c676d37a0 [HttpFoundation] optimize normalization of headers
2019-09-27 07:33:30 +02:00
Nicolas Grekas
fc78e200db Merge branch '4.3' into 4.4
* 4.3:
  [FrameworkBundle] Fix framework bundle lock configuration not working as expected
  [Validator] Add the missing translations for the Azerbaijani locale
  [HttpClient] workaround bad Content-Length sent by old libcurl
  [Cache] dont override native Memcached options
  Fix CS
  Fix exceptions (PDOException) error code type
  Fix return type of Process::restart().
  [Cache] fail gracefully when locking is not supported
  [HttpClient] fix race condition when reading response with informational status
  Names for buttons should start with lowercase
2019-09-27 00:09:58 +02:00
Nicolas Grekas
dff71cef48 bug #33691 [HttpClient] fix race condition when reading response with informational status (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix race condition when reading response with informational status

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

Spotted by some transiently failing jobs on Travis.

Commits
-------

450c3c4998 [HttpClient] fix race condition when reading response with informational status
2019-09-26 23:20:52 +02:00
Nicolas Grekas
c8dbd1ad75 bug #33727 [HttpClient] workaround bad Content-Length sent by old libcurl (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] workaround bad Content-Length sent by old libcurl

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

Issue described in https://curl.haxx.se/mail/lib-2014-01/0106.html, happens with curl 7.29 at least.

Commits
-------

b8d2496979 [HttpClient] workaround bad Content-Length sent by old libcurl
2019-09-26 23:18:02 +02:00
Nicolas Grekas
0d05f3e765 Merge branch '3.4' into 4.3
* 3.4:
  [FrameworkBundle] Fix framework bundle lock configuration not working as expected
  [Validator] Add the missing translations for the Azerbaijani locale
  [Cache] dont override native Memcached options
  Fix return type of Process::restart().
2019-09-26 23:17:10 +02:00
Nicolas Grekas
4b2019db78 bug #31198 [FrameworkBundle] Fix framework bundle lock configuration not working as expected (HypeMC)
This PR was squashed before being merged into the 3.4 branch (closes #31198).

Discussion
----------

[FrameworkBundle] Fix framework bundle lock configuration not working as expected

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31197
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/11465 & https://github.com/symfony/symfony-docs/pull/11466

This fixes #31197 and makes the lock configuration work with installations that are not full stack ones and configurations that use xml files.

Commits
-------

c7af2df340 [FrameworkBundle] Fix framework bundle lock configuration not working as expected
2019-09-26 22:59:16 +02:00
HypeMC
c7af2df340 [FrameworkBundle] Fix framework bundle lock configuration not working as expected 2019-09-26 22:59:09 +02:00
Nicolas Grekas
ad66a160b1 bug #33719 [Cache] dont override native Memcached options (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] dont override native Memcached options

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

Commits
-------

894a78e812 [Cache] dont override native Memcached options
2019-09-26 22:41:00 +02:00
Fabien Potencier
7f43dc446b minor #33661 [DoctrineBridge] Use VarCloner data instead of legacy array for query params (ostrolucky)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] Use VarCloner data instead of legacy array for query params

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

When I implemented Symfony 4.0 support in DoctrineBundle, I have run into issue that DoctrineBridge does not return VarCloner instance here, so I had to introduce [conversion inside DoctrineBundle](af8ac792c9/DataCollector/DoctrineDataCollector.php (L135-L141)).

We need this because `WebProfilerBundle\Twig\WebProfilerExtension::dumpData()` requires this instance since Symfony 4.0. Not returning this instance here was oversight during work on Symfony 4.0. I did not contribute this sooner, because we can't remove code in DoctrineBundle until we drop Symfony 3.4 support anyways. But not doing this in Symfony 4.4 would mean having to keep transformation code not just during 3.4 LTS lifetime, but 4.4 LTS lifetime too.

Commits
-------

81c6df511d Use VarCloner data instead of legacy array for query params
2019-09-26 22:20:31 +02:00
Farhad Safarov
dde0256e63 [Validator] Add the missing translations for the Azerbaijani locale 2019-09-26 23:00:18 +03:00
Nicolas Grekas
b8d2496979 [HttpClient] workaround bad Content-Length sent by old libcurl 2019-09-26 21:42:07 +02:00
Nicolas Grekas
9c676d37a0 [HttpFoundation] optimize normalization of headers 2019-09-26 19:33:29 +02:00
Nicolas Grekas
0b5b3ed7f9 [HttpKernel] wrap compilation of the container in an opportunistic lock 2019-09-26 13:25:44 +02:00
Nicolas Grekas
894a78e812 [Cache] dont override native Memcached options 2019-09-26 13:13:54 +02:00
Fabien Potencier
0222ea5df9 bug #33703 [Cache] fail gracefully when locking is not supported (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] fail gracefully when locking is not supported

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

Commits
-------

93485190f9 [Cache] fail gracefully when locking is not supported
2019-09-26 10:04:46 +02:00
Fabien Potencier
d52515ab1b Fix CS 2019-09-26 09:59:37 +02:00
fruty
9efa025a2a Fix exceptions (PDOException) error code type 2019-09-26 09:58:46 +02:00
Nicolas Grekas
b56a4b4f3a minor #33711 [ErrorHandler] fix return-type patching logic (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] fix return-type patching logic

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

My bad.

Commits
-------

302a921976 [ErrorHandler] fix return-type patching logic
2019-09-25 22:41:38 +02:00
Nicolas Grekas
302a921976 [ErrorHandler] fix return-type patching logic 2019-09-25 22:29:01 +02:00
Fabien Potencier
d04fdee000 bug #32335 [Form] Names for buttons should start with lowercase (mcfedr)
This PR was merged into the 4.3 branch.

Discussion
----------

[Form] Names for buttons should start with lowercase

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

This fix changes the messages related to the changes in https://github.com/symfony/symfony/pull/28969 - the message used to state that names should start with a letter, a digit ... - so I got a confusing message:

```
Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated since Symfony 4.3 and will throw an exception in 5.0 ("Search" given).'
```

Which made me find the message, look at the regex that was used, and work out that actually it should start with a lowercase letter, and hence this PR - where I assume there is a reason that the name must start with lowercase letters.

Commits
-------

f65524e4e0 Names for buttons should start with lowercase
2019-09-25 21:19:30 +02:00
Fabien Potencier
b0c2112fb7 feature #33113 [Messenger][DX] Display real handler if handler is wrapped (DavidBadura)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger][DX] Display real handler if handler is wrapped

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

Execute:

```
bin/console debug:messenger
```

Before:

<img width="718" alt="Bildschirmfoto 2019-08-11 um 15 35 10" src="https://user-images.githubusercontent.com/470138/62834539-5faaa280-bc4e-11e9-99d6-a7e98822108c.png">

After:

<img width="673" alt="Bildschirmfoto 2019-08-11 um 15 34 27" src="https://user-images.githubusercontent.com/470138/62834540-646f5680-bc4e-11e9-9aa7-c5fb5219204c.png">

Commits
-------

e6ce9b560c display real handler if handler is wrapped
2019-09-25 21:12:09 +02:00
Fabien Potencier
098584a33c feature #33128 [FrameworkBundle] Sort tagged services (krome162504)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Sort tagged services

| Q             | A
| ------------- | ---
| Branch?       | 4.4  <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- 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 |  https://github.com/symfony/symfony/issues/32439 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |  -

Hi

This PR it's to improve DX when `debug:container` command is use with tag argument by sorting them by priority (More details in linked issue).
Currently they are sort by alphabetical order.

Commits
-------

54cef2a3a3 [FrameworkBundle] Sort tagged service by priority
2019-09-25 21:10:01 +02:00
Fabien Potencier
db5cf1a83e bug #33350 [DI] scope singly-implemented interfaces detection by file (daniel-iwaniec, nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] scope singly-implemented interfaces detection by file

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

[DependencyInjection] fixed handling singly implemented interfaces when importing multiple resources

for example:
```yaml
App\Adapter\:
    resource: '../src/Adapter/*'
App\Port\:
    resource: '../src/Port/*'
```

this configuration wont create service for interface (in other words singly implemented interface wont be autowired) and this chage fixes it

**Also** this will prevent false positives - for example if I had one implementation in \App\Port namespace and another in \App\Adapter then interface service would still be registered

but that could potentially break exisitng code not aware of this bug

Commits
-------

c1f39709ff [DI] add FileLoader::registerAliasesForSinglyImplementedInterfaces()
bec38900d8 [DI] scope singly-implemented interfaces detection by file
2019-09-25 21:03:45 +02:00
Fabien Potencier
4cf7ec1ecf feature #33658 [Yaml] fix parsing inline YAML spanning multiple lines (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Yaml] fix parsing inline YAML spanning multiple lines

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

Commits
-------

85a5c31e05 fix parsing inline YAML spanning multiple lines
2019-09-25 20:53:23 +02:00
Fabien Potencier
b1802085ec bug #33674 [ErrorHandler] Show fallback error page when default error controller is disabled (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Show fallback error page when default error controller is disabled

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

This would avoid a blank page on errors when we've disabled the default error controller. e.g:
```yaml
framework:
    error_controller: null
```
So, we will show you the default HTML error page.

Commits
-------

8eea11cc26 Show fallback error page when framework.error_controller is null
2019-09-25 20:52:25 +02:00
Fabien Potencier
745248f329 minor #33708 [ErrorHandler] don't throw deprecations for return-types by default (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] don't throw deprecations for return-types by default

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

As discussed a few times already,  in 4.4, `DebugClassLoader` shouldn't trigger deprecations when return types are missing. We'll enable them back in 5.1.

Commits
-------

2cb419edf4 [ErrorHandler] don't throw deprecations for return-types by default
2019-09-25 20:45:24 +02:00
Fabien Potencier
89d7931fdf feature #33698 [HttpKernel] compress files generated by the profiler (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] compress files generated by the profiler

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

I've recently seen several reports of fastly growing profiler storages. Let's compress them when possible.

Locally for the skeleton homepage, a single profile goes from 150k to 15k. Level 3 is producing significant compression ratio while being measurably faster than level 6 (the default), that's why I'm using it.

Commits
-------

08f9470556 [HttpKernel] compress files generated by the profiler
2019-09-25 20:41:47 +02:00
Fabien Potencier
e2e73eff1d feature #33317 [Messenger] Added support for from_transport attribute on messenger.message_handler tag (ruudk)
This PR was squashed before being merged into the 4.4 branch (closes #33317).

Discussion
----------

[Messenger] Added support for `from_transport` attribute on `messenger.message_handler` tag

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

Right now, it's only possible to have dynamic `from_transport` when using `MessageSubscriberInterface`. Things like `priority` and `bus` can already be added as attributes on the  messenger.message_handler` tag.

With this PR it now also supports `from_transport`.

Commits
-------

c965e4e844 [Messenger] Added support for `from_transport` attribute on `messenger.message_handler` tag
2019-09-25 20:39:14 +02:00
Ruud Kamphuis
c965e4e844 [Messenger] Added support for from_transport attribute on messenger.message_handler tag 2019-09-25 20:39:09 +02:00
Nicolas Grekas
2cb419edf4 [ErrorHandler] don't throw deprecations for return-types by default 2019-09-25 19:39:21 +02:00
Fabien Potencier
a0bbae7514 Merge branch '4.3' into 4.4
* 4.3:
  ensure legacy event dispatcher compatibility
2019-09-25 17:04:11 +02:00
Nicolas Grekas
5cd1d7b4cc [Security] add "anonymous: lazy" mode to firewalls 2019-09-25 16:50:19 +02:00
Christian Flothmann
860688ff2e ensure legacy event dispatcher compatibility 2019-09-25 16:41:08 +02:00
Christian Flothmann
1595d307cf Merge branch '4.3' into 4.4
* 4.3:
  fix version in @deprecated annotation
  [Security] use LegacyEventDispatcherProxy
  Add missing row_attr option to FormType
2019-09-25 16:40:34 +02:00
Christian Flothmann
4fcc1bc6fa ensure legacy event dispatcher compatibility 2019-09-25 16:27:22 +02:00
Alexander M. Turek
7d7380d9e7 Fix return type of Process::restart(). 2019-09-25 16:09:38 +02:00
Nicolas Grekas
93485190f9 [Cache] fail gracefully when locking is not supported 2019-09-25 15:53:41 +02:00
Christian Flothmann
479d8ee2a3 bug #33688 Add missing row_attr option to FormType (mcsky)
This PR was merged into the 4.3 branch.

Discussion
----------

Add missing row_attr option to FormType

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix: #33682 - related issue #33573
| License       | MIT

The #33573 modified Symfony's form themes. But the [FormType](https://github.com/symfony/form/blob/master/Extension/Core/Type/FormType.php) don't allow the option `row_attr` so the OptionResolver throw an exception that the option is unknown.

This PR basically add the option and give it to the form view (like `label_attr` do)

Commits
-------

d711ea2b54 Add missing row_attr option to FormType
2019-09-25 12:11:53 +02:00
Christian Flothmann
042f5b5a9d bug #33692 [HttpClient] fix undefined index access (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix undefined index access

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

When the request fails.

Commits
-------

7fce184d25 [HttpClient] fix undefined index access
2019-09-25 12:04:37 +02:00
Christian Flothmann
a53732f28d bug #33693 [Security] use LegacyEventDispatcherProxy (dmaicher)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security] use LegacyEventDispatcherProxy

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

I ran into an issue on one of my apps that has its own event dispatcher class using the old dispatch method signature

```php
public function dispatch($eventName, Event $event = null)
```

This leads to

```
TypeError: Argument 2 passed to X\Tests\Base\TestEventDispatcher::dispatch() must be an instance of Symfony\Component\EventDispatcher\Event or null, string given, called in /var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php on line 230

/var/www/x/symfony/tests/Base/TestEventDispatcher.php:20
/var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php:230
/var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php:111
```

since the event here is dispatched using the new signature:

https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Security/Http/Firewall/ContextListener.php#L259

Commits
-------

7067e48165 [Security] use LegacyEventDispatcherProxy
2019-09-25 11:50:36 +02:00
Nicolas Grekas
08f9470556 [HttpKernel] compress files generated by the profiler 2019-09-25 10:55:08 +02:00
Christian Flothmann
eceb0e595c tweak deprecation messages and changelog 2019-09-25 10:01:37 +02:00
Christian Flothmann
e01614527f fix version in @deprecated annotation 2019-09-25 09:46:23 +02:00
Gabriel Ostrolucký
81c6df511d
Use VarCloner data instead of legacy array for query params 2019-09-24 23:50:47 +02:00
David Maicher
7067e48165 [Security] use LegacyEventDispatcherProxy 2019-09-24 20:49:43 +02:00
Nicolas Grekas
7fce184d25 [HttpClient] fix undefined index access 2019-09-24 20:17:30 +02:00
Nicolas Grekas
450c3c4998 [HttpClient] fix race condition when reading response with informational status 2019-09-24 20:09:31 +02:00
Nicolas Grekas
373469b53f Merge branch '4.3' into 4.4
* 4.3:
  [Routing] fix bad fix
2019-09-24 18:23:28 +02:00
Nicolas Grekas
3ab7d57659 Merge branch '3.4' into 4.3
* 3.4:
  [Routing] fix bad fix
2019-09-24 18:23:04 +02:00
Nicolas Grekas
04fe347df9 [Routing] fix bad fix 2019-09-24 18:22:08 +02:00
Nicolas Grekas
51a2cb6e3c Merge branch '4.3' into 4.4
* 4.3:
  [Security/Http] fix typo in deprecation message
  Various tweaks 3.4
  Various tweaks 4.3
  [PhpUnit] Fix usleep mock return value
  [Lock] use Predis\ClientInterface instead of Predis\Client
  Fix version typo in deprecation notice
  Make legacy "wrong" RFC2047 encoding apply only to one header
2019-09-24 17:57:39 +02:00
Nicolas Grekas
1ccc970469 minor #33690 [Security/Http] fix typo in deprecation message (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security/Http] fix typo in deprecation message

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

spotted by @stof in #33676

Commits
-------

e70057aed4 [Security/Http] fix typo in deprecation message
2019-09-24 17:54:42 +02:00
Nicolas Grekas
7031e83a8f Merge branch '3.4' into 4.3
* 3.4:
  Various tweaks 3.4
  [PhpUnit] Fix usleep mock return value
  [Lock] use Predis\ClientInterface instead of Predis\Client
2019-09-24 17:54:14 +02:00
Nicolas Grekas
e70057aed4 [Security/Http] fix typo in deprecation message 2019-09-24 17:43:44 +02:00
Kevin Grenier
d711ea2b54 Add missing row_attr option to FormType 2019-09-24 17:38:26 +02:00
Fabien Potencier
3c7172d81e feature #33584 [Security] Deprecate isGranted()/decide() on more than one attribute (wouterj)
This PR was squashed before being merged into the 4.4 branch (closes #33584).

Discussion
----------

[Security] Deprecate isGranted()/decide() on more than one attribute

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

While I expect it not be used much, it is currently possible to call `isGranted()` on more than one attribute:

```php
if ($this->authorizationChecker->isGranted(['ROLE_USER', 'ROLE_ADMIN'])) {
    // ...
}
```

Supporting this includes a couple of problems/questions:

- It is not clear whether this is `OR` or `AND`;
- In fact, this is left over to the voter to decide upon. So it can vary for each voter and writers of new voters need to consider this (otherwise, you get issues like https://github.com/LeaseWeb/LswSecureControllerBundle/issues/4 );
- It promotes to vote over roles instead of actions.

I think we can do better. In the past, we've created all tooling for this to be self-explaining and easier:

```php
// ExpressionLanguage component (also includes other functions, like `is_granted('EDIT')`)
if ($this->authorizationChecker->isGranted("has_role('ROLE_USER') or has_role('ROLE_ADMIN')")) {
    // ...
}

// calling it multiple times in PHP (may reduce performance)
if ($this->authorizationChecker->isGranted('ROLE_USER')
    || $this->authorizationChecker->isGranted('ROLE_ADMIN')
) {
    // ...
}

// or by using Role Hierarchy, if a user really wants to vote on roles
```

This PR deprecates passing more than one attribute to `isGranted()` and `decide()` to remove this confusing bit in Security usage.

Backwards compatiblity help
---

I need some help in how to approach changing the `VoterInterface::vote(TokenInterface $token, $subject, array $attributes)` method in a backwards compatible way. Removing `array` breaks all Voters, so does changing it to `string` and removed the parameter all together.

Commits
-------

c64b0beffb [Security] Deprecate isGranted()/decide() on more than one attribute
2019-09-24 17:21:06 +02:00
Wouter J
c64b0beffb [Security] Deprecate isGranted()/decide() on more than one attribute 2019-09-24 17:21:01 +02:00
Fabien Potencier
e84bd65e91 feature #33663 [Security] Make stateful firewalls turn responses private only when needed (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Make stateful firewalls turn responses private only when needed

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26769 *et al.*
| License       | MIT
| Doc PR        | -

Replaces #28089

By taking over session usage tracking and replacing it with token usage tracking, we can prevent responses that don't actually use the token from turning responses private without changing anything to the lifecycle of security listeners. This makes the behavior much more seamless, allowing to still log the user with the monolog processor, and display it in the profiler toolbar.

This works by using two separate token storage services:
- `security.token_storage` now tracks access to the token and increments the session usage tracker when needed. This is the service that is injected in userland.
- `security.untracked_token_storage` is a raw token storage that just stores the token and is disconnected from the session. This service is injected in places where reading the session doesn't impact the generated output in any way (as e.g. in Monolog processors, etc.)

Commits
-------

20df3a125c [Security] Make stateful firewalls turn responses private only when needed
2019-09-24 17:09:00 +02:00
Fabien Potencier
7c04a82a47 bug #33675 [PhpUnit] Fix usleep mock return value (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnit] Fix usleep mock return value

| Q             | A
| ------------- | ---
| Branch?       | 3.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       | n/a| License       | MIT
| Doc PR        | n/a

`usleep` does not return anything.

Commits
-------

8198d93c5b [PhpUnit] Fix usleep mock return value
2019-09-24 07:30:09 +02:00
Fabien Potencier
47cb83a6ec Various tweaks 3.4 2019-09-24 07:29:29 +02:00
Fabien Potencier
7596f99a12 Various tweaks 4.3 2019-09-24 07:27:42 +02:00
Nicolas Grekas
20df3a125c [Security] Make stateful firewalls turn responses private only when needed 2019-09-23 21:34:59 +02:00
Fabien Potencier
8198d93c5b [PhpUnit] Fix usleep mock return value 2019-09-23 21:21:37 +02:00
Yonel Ceruto
8eea11cc26 Show fallback error page when framework.error_controller is null 2019-09-23 12:22:17 -04:00
Christian Flothmann
b00b633665 feature #33609 [Form][SubmitType] Add "validate" option (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form][SubmitType] Add "validate" option

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

The second part of the ticket requires more work but is kind of unrelated.

Commits
-------

a2bc06d811 [Form][SubmitType] Add "validate" option
2019-09-23 17:54:07 +02:00
Grégoire Pineau
e767bb1b42 Revert \"feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)\" 2019-09-23 17:45:34 +02:00
Nicolas Grekas
c1ab2c64c5 [TwigBundle] typo 2019-09-23 16:56:34 +02:00
Nicolas Grekas
4ca6eea758 [TwigBundle] fix test case 2019-09-23 16:55:33 +02:00
Fabien Potencier
acca7ad939 minor #33641 Make legacy "wrong" RFC2047 encoding apply only to one header (terjebraten-certua)
This PR was merged into the 4.3 branch.

Discussion
----------

Make legacy "wrong" RFC2047 encoding apply only to one header

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

It says in a comment in the code that "We have to go against RFC 2183/2231 in some areas for interoperability". But I would like that to be the exception and not the rule. As the code was, all parameterized headers except from "Content-Disposition" was not encoded according to RFC 2231.

This change is to make it so that the exception (to not follow the RFC) is for the header "Content-Type" only, and all other parameterized headers will follow the rule of RFC 2231.

The code kind of worked before, because in emails we generally only have two parameterized headers; "Content-Disposition" and "Content-Type". But I think it is a good thing that if another  parameterized header would happen to be added, by default it should follow the rule of the RFC and not by default be an exception.

Commits
-------

3817a8b036 Make legacy "wrong" RFC2047 encoding apply only to one header
2019-09-23 16:42:16 +02:00
Fabien Potencier
8eaa5a86f4 minor #33649 Allow Twig 3 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Allow Twig 3

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

Needs https://github.com/twigphp/Twig/pull/3156
And https://github.com/twigphp/Twig/pull/3158

Commits
-------

09f4eb5cd8 Allow Twig 3
2019-09-23 16:39:44 +02:00
Fabien Potencier
ca108747e3 minor #33651 [Yaml] hint to the --parse-tags when parsing tags fails (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Yaml] hint to the --parse-tags when parsing tags fails

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

Commits
-------

012111524b hint to the --parse-tags when parsing tags fails
2019-09-23 16:33:39 +02:00
Farhad Safarov
5c01f0a7e5 [Lock] use Predis\ClientInterface instead of Predis\Client 2019-09-23 16:31:27 +02:00
Nicolas Grekas
09f4eb5cd8 Allow Twig 3 2019-09-23 16:04:59 +02:00
Yonel Ceruto
9e44f58054 minor #33660 Minor tweaks to the Welcome Page (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

Minor tweaks to the Welcome Page

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

Sorry, I'm late on https://github.com/symfony/symfony/pull/33613 and https://github.com/symfony/symfony/pull/33614 but I realized 3 minor visual issues:
 * the background color of the warning message for consistency should be `$lightColor()` and imho a little bit smaller.
 * the check icon has a very wide margin in relation to the edge of the rounded box:
![check-margin-before](https://user-images.githubusercontent.com/2028198/65379790-3ee95a00-dc9c-11e9-97d6-af6c10837c6d.png) vs ![check-margin-after](https://user-images.githubusercontent.com/2028198/65379810-b1f2d080-dc9c-11e9-8167-7ebbd0f92927.png)
 * and the resources (doc links) on wide screens have a very small space between them.

I've also removed some useless css classes (footer).

| before | after |
| --- | --- |
| ![welcome-page-before](https://user-images.githubusercontent.com/2028198/65379730-e2d20600-dc9a-11e9-8a8a-10763baadfda.png) | ![welcome-page-after](https://user-images.githubusercontent.com/2028198/65379731-ecf40480-dc9a-11e9-88a1-bda59bf04814.png) |

tested on Chrome and Firefox.

Commits
-------

8484378 Minor tweaks
2019-09-23 09:57:08 -04:00
Yonel Ceruto
84843780de Minor tweaks 2019-09-23 09:09:39 -04:00
Fabien Potencier
be5cd6903f bug #33662 [Twig] Remove deprecated tag usage (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Twig] Remove deprecated tag usage

| 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       | n/a
| License       | MIT
| Doc PR        | n/a
<!--
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):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

cd74cb32ef [Twig] Remove deprecated tag usage
2019-09-23 11:08:11 +02:00
Teoh Han Hui
bd13271016
Fix version typo in deprecation notice 2019-09-23 11:00:33 +02:00
Thomas Calvet
a2bc06d811 [Form][SubmitType] Add "validate" option 2019-09-23 10:33:29 +02:00
Fabien Potencier
cd74cb32ef [Twig] Remove deprecated tag usage 2019-09-22 21:45:18 +02:00
Christian Flothmann
85a5c31e05 fix parsing inline YAML spanning multiple lines 2019-09-21 11:59:49 +02:00
Nicolas Grekas
3e48be0301 Merge branch '4.3' into 4.4
* 4.3:
  [FrameworkBundle] fix tests
  fix typo
2019-09-21 01:13:17 +02:00
Nicolas Grekas
8ccb42bb72 [FrameworkBundle] fix tests 2019-09-21 01:13:06 +02:00
Nicolas Grekas
27a400281c Merge branch '4.3' into 4.4
* 4.3:
  [Cache] skip igbinary on PHP 7.4.0
2019-09-20 16:40:59 +02:00
Nicolas Grekas
2c0c131142 [Cache] skip igbinary on PHP 7.4.0 2019-09-20 16:26:56 +02:00
Christian Flothmann
012111524b hint to the --parse-tags when parsing tags fails 2019-09-20 16:23:06 +02:00
Nicolas Grekas
fb6d5913e6 minor #33647 [Messenger] fix tests (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] fix tests

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

Commits
-------

cfd6d645ef fix tests
2019-09-20 13:15:00 +02:00
Christian Flothmann
cfd6d645ef fix tests 2019-09-20 12:40:48 +02:00
Nicolas Grekas
13640b9422 Merge branch '4.3' into 4.4
* 4.3:
  fix merge
2019-09-20 12:12:04 +02:00
Nicolas Grekas
b4e2ba2c04 fix merge 2019-09-20 12:11:58 +02:00
Nicolas Grekas
bbf2ae576e Merge branch '4.3' into 4.4
* 4.3:
  [HttpKernel] fix merge
  fix tests
  [HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted
2019-09-20 11:28:18 +02:00
Nicolas Grekas
e323097dac [HttpKernel] fix merge 2019-09-20 11:25:35 +02:00
Nicolas Grekas
1575e27c31 bug #33643 [HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted

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

Spotted while discussing the client with @Seldaek
The current behavior is transient: depending on the speed of the network/server, the exception can be thrown, or not.

This forces one do deal with 3/4/5xx when the first chunk is yielded.

Commits
-------

3c93764f10 [HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted
2019-09-20 09:51:43 +02:00
Nicolas Grekas
f550ca983e Merge branch '3.4' into 4.3
* 3.4:
  fix tests
2019-09-20 09:50:55 +02:00
Christian Flothmann
04f79c5536 fix tests 2019-09-20 09:04:12 +02:00
Nicolas Grekas
3c93764f10 [HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted 2019-09-19 20:56:12 +02:00
Nicolas Grekas
dee76144e5 Merge branch '4.3' into 4.4
* 4.3:
  [PhpUnitBridge] more fixes for PHP 5.5
2019-09-19 19:42:09 +02:00
Nicolas Grekas
3a520f2813 [PhpUnitBridge] more fixes for PHP 5.5 2019-09-19 19:42:00 +02:00
Nicolas Grekas
de346f1fe3 Merge branch '4.3' into 4.4
* 4.3:
  [PhpUnitBridge] fix undefined variables
2019-09-19 19:31:55 +02:00
Nicolas Grekas
5274edaa86 [PhpUnitBridge] fix undefined variables 2019-09-19 19:31:51 +02:00
Nicolas Grekas
86ffecb556 Merge branch '4.3' into 4.4
* 4.3:
  [Process] fix typo in tests
2019-09-19 19:12:09 +02:00
Nicolas Grekas
a23c3ef42a Merge branch '3.4' into 4.3
* 3.4:
  [Process] fix typo in tests
2019-09-19 19:12:04 +02:00
Nicolas Grekas
20ab3b75fd [Process] fix typo in tests 2019-09-19 19:10:56 +02:00
Terje Bråten
3817a8b036 Make legacy "wrong" RFC2047 encoding apply only to one header 2019-09-19 18:00:15 +01:00
Nicolas Grekas
bc24be6ab4 Merge branch '4.3' into 4.4
* 4.3:
  [PhpUnitBridge] bump cache id
2019-09-19 18:15:04 +02:00
Nicolas Grekas
bd7b44a08c Merge branch '3.4' into 4.3
* 3.4:
  [PhpUnitBridge] bump cache id
2019-09-19 18:14:31 +02:00
Nicolas Grekas
76d4ef83e9 [PhpUnitBridge] bump cache id 2019-09-19 18:13:23 +02:00
Nicolas Grekas
4c69a26d82 Merge branch '4.3' into 4.4
* 4.3:
  Re-enable previously failing PHP 7.4 test cases
  [PhpUnitBridge] fix uninitialized variable
  Revert "bug #33618 fix tests depending on other components' tests (xabbuh)"
  install from source to include components tests
2019-09-19 17:56:27 +02:00
Nicolas Grekas
627833b5e6 Merge branch '3.4' into 4.3
* 3.4:
  Re-enable previously failing PHP 7.4 test cases
  Revert "bug #33618 fix tests depending on other components' tests (xabbuh)"
  install from source to include components tests
2019-09-19 17:51:53 +02:00
Nicolas Grekas
9e4e191535 Re-enable previously failing PHP 7.4 test cases 2019-09-19 17:32:51 +02:00
Nicolas Grekas
2f6dc5eed1 [PhpUnitBridge] fix uninitialized variable 2019-09-19 16:48:53 +02:00
Fabien Potencier
b5ff9966fe bug #33632 [ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631 (k0d3r1s)
This PR was squashed before being merged into the 4.4 branch (closes #33632).

Discussion
----------

[ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631

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

This fixes exception thrown when trying to render ErrorException as an array

Commits
-------

063dc78b49 [ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631
2019-09-19 16:05:18 +02:00
k0d3r1s
063dc78b49 [ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631 2019-09-19 16:05:07 +02:00
Fabien Potencier
5b5b7de660 [Twig] Add missing check 2019-09-19 14:48:09 +02:00
Christian Flothmann
5aa4328b08 Revert "bug #33618 fix tests depending on other components' tests (xabbuh)"
This reverts commit 47fb0900fb, reversing
changes made to 6fad4f1215.
2019-09-19 09:17:54 +02:00
Yonel Ceruto
85d10114e0 minor #33633 [TwigBridge] Fix undefined constant and other minor issues (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBridge] Fix undefined constant and other minor issues

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

/cc @fabpot

Commits
-------

e9e004e Fix undefined constant and other minor issues
2019-09-18 15:23:15 -04:00
Christian Flothmann
672a544e8e Merge branch '4.3' into 4.4
* 4.3:
  ensure compatibility with type resolver 0.5
  Call AssertEquals with proper parameters
  [Twig] Fix Twig config extra keys
  fix tests depending on other components' tests
2019-09-18 20:25:57 +02:00
Yonel Ceruto
e9e004ea07 Fix undefined constant and other minor issues 2019-09-18 14:21:39 -04:00
Christian Flothmann
9d882e8ce2 Merge branch '3.4' into 4.3
* 3.4:
  ensure compatibility with type resolver 0.5
  Call AssertEquals with proper parameters
  [Twig] Fix Twig config extra keys
  fix tests depending on other components' tests
2019-09-18 18:13:55 +02:00
Fabien Potencier
6230465838 feature #33605 [Twig] Add NotificationEmail (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Twig] Add NotificationEmail

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

This PR is an extract of the new Notifier component. It's a default template to send standardized emails with the Mailer component, which can be used independently of the Notifier component.

Such emails look like the following:

<img width="618" alt="image" src="https://user-images.githubusercontent.com/47313/65018883-694cb780-d92a-11e9-940a-875ea68f9e5d.png">

More info on SpeakerDeck (be warned that names have change since my presentation): https://speakerdeck.com/fabpot/symfony-notifier?slide=7

It requires Twig 1.12 which should be released later this week.

Usage example:

```php
$email = (new NotificationEmail())
    ->from('fabien@example.com')
    ->to('fabien@example.org')
    ->subject('My first notification email via Symfony')
    ->markdown(<<<EOF
There is a **problem** on your website, you should investigate it right now.
Or just wait, the problem might solves itself automatically, we never know.
EOF
    )
    ->action('More info?', 'https://example.com/')
    ->importance('high')
    //->exception(new \LogicException('That does not work at all...'))
;
```

Instead of `markdown()`, you can also use `content()` for simple emails.

Note that you can use Inky tags in the content:

```php
$email = (new NotificationEmail())
    ->from('fabien@example.com')
    ->to('fabien@example.org')
    ->subject('My first notification email via Symfony')
    ->markdown(<<<EOF
There is a **problem** on your website, you should investigate it right now.
Or just wait, the problem might solves itself automatically, we never know.

Some Title
==========

<center>
    <button href="https://example.com/">Go?</button>
</center>

EOF
);
```

There is also the concept of a theme. By default, it uses the `default` theme,  which is an alias for the `zurb_2` theme.

You can use `setTheme()` to override the theme for a given instance, or override the themes globally via the following config in `twig.yaml`:

```yaml
twig:
    paths:
        templates/email: email
```

Then, create `templates/email/default/notification/body.html.twig` and `templates/email/default/notification/body.txt.twig`. Extends the existing template via `{% extends "@!email/default/notification/body.html.twig" %}` (note  the `!`).

Commits
-------

f6c6cf7dc9 [Twig] Add NotificationEmail
2019-09-18 17:30:43 +02:00
Fabien Potencier
f6c6cf7dc9 [Twig] Add NotificationEmail 2019-09-18 17:08:12 +02:00
Fabien Potencier
47fb0900fb bug #33618 fix tests depending on other components' tests (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

fix tests depending on other components' tests

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

Commits
-------

cd2f3a6056 fix tests depending on other components' tests
2019-09-18 16:58:24 +02:00
Fabien Potencier
6fad4f1215 bug #33626 [PropertyInfo] ensure compatibility with type resolver 0.5 (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyInfo] ensure compatibility with type resolver 0.5

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

same as #33588 but for the `3.4` branch

Commits
-------

2d708b3e60 ensure compatibility with type resolver 0.5
2019-09-18 16:55:47 +02:00
Fred Cox
643c9ff257 Replace REMOTE_ADDR in trusted proxies with the current REMOTE_ADDR 2019-09-18 17:03:24 +03:00
Christian Flothmann
2d708b3e60 ensure compatibility with type resolver 0.5 2019-09-18 15:36:31 +02:00
Nicolas Grekas
41a450b727 minor #33523 Fix lint commands frozen on empty stdin (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix lint commands frozen on empty stdin

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

Running e.g. `lint:yaml -` with no piped content makes the command hangs currently, this makes it fail instead. Also fixes the command help which we forgot to update

Commits
-------

b60e0c1454 Fix lint commands frozen on empty stdin
2019-09-18 14:09:11 +02:00
mmokhi
6a8ab6cb73 Call AssertEquals with proper parameters
Since `$response->getContent()` returns string and our first parameter is already string as well, in some cases (with different precisions) it may "compare strings" as "strings" and this is not what the test wants.
By changing the first parameter to actual number we force `AssertEquals` to compare them numerically rather than literally by string content.
2019-09-18 13:43:43 +02:00
Grégoire Pineau
2055a558fe [DependencyInjection] Allow binding iterable and tagged services 2019-09-18 13:00:14 +02:00
Fabien Potencier
e2043ff53e [Twig] Fix Twig config extra keys 2019-09-18 10:28:50 +02:00
Christian Flothmann
cd2f3a6056 fix tests depending on other components' tests 2019-09-17 17:53:02 +02:00
Fabien Potencier
1efae63e64 bug #33617 [Console] Fix tests (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Fix tests

| 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       | n/a
| License       | MIT
| Doc PR        | n/a
<!--
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):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

abe11a3024 [Console] Fix tests
2019-09-17 17:01:44 +02:00
Fabien Potencier
abe11a3024 [Console] Fix tests 2019-09-17 16:59:18 +02:00
Fabien Potencier
0b1946e5fe Fix wrong namespace 2019-09-17 16:46:41 +02:00
Fabien Potencier
e004102756 minor #33586 [Cache][FrameworkBundle] fix tests (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache][FrameworkBundle] fix tests

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

Commits
-------

b468776b44 fix tests
2019-09-17 13:20:26 +02:00
Fabien Potencier
8ccacab443 minor #33614 New tweaks to the Welcome Page (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

New tweaks to the Welcome Page

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

Sorry for the noise! This is hopefully the last pull request related to the Welcome Page design tweaks. This one tweaks some margins, makes it look better on ultra-wide screens and prevents some unwanted horizontal/vertical scrollbars on some browsers.

Commits
-------

2737a00233 New tweaks to the Welcome Page
2019-09-17 13:14:50 +02:00
Fabien Potencier
3c78fde548 Merge branch '4.3' into 4.4
* 4.3:
  [Twig] Remove dead code
  Add gitignore file for Symfony 4.3
  Add gitignore file for Symfony 3.4
  [Inflector] Add .gitignore file
  [Messenger] Fix exception message of failed message is dropped on retry
  Add default value for Accept header
  [HttpClient] Add .gitignore file
  [Finder] Adjust regex to correctly match comments in gitignore contents
  [Security] Removed unused argument in Test
  [Console] Get dimensions from stty on windows if possible
  [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
2019-09-17 13:12:18 +02:00
Fabien Potencier
9072ba8b58 Merge branch '3.4' into 4.3
* 3.4:
  [Twig] Remove dead code
  Add gitignore file for Symfony 3.4
  [Inflector] Add .gitignore file
  [Security] Removed unused argument in Test
  [Console] Get dimensions from stty on windows if possible
  [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
2019-09-17 13:12:06 +02:00
Fabien Potencier
d9ce895cee minor #33612 [Twig] Remove dead code (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

[Twig] Remove dead code

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| 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
| License       | MIT
| Doc PR        | n/a

As the min version of Twig is 1.41, we can remove some dead code.

Commits
-------

786d136b5e [Twig] Remove dead code
2019-09-17 13:08:49 +02:00
Javier Eguiluz
2737a00233 New tweaks to the Welcome Page 2019-09-17 13:07:57 +02:00
Fabien Potencier
786d136b5e [Twig] Remove dead code 2019-09-17 12:59:55 +02:00
Javier Eguiluz
4517319e53 Minor updates in the new Welcome page 2019-09-17 12:22:46 +02:00
Fabien Potencier
fa7d74a3a6 minor #33611 Add gitignore file for Symfony 4.3 (ValentineBoineau)
This PR was squashed before being merged into the 4.3 branch (closes #33611).

Discussion
----------

Add gitignore file for Symfony 4.3

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

Commits
-------

856b9a8a6e Add gitignore file for Symfony 4.3
2019-09-17 11:54:11 +02:00
Valentine Boineau
856b9a8a6e Add gitignore file for Symfony 4.3 2019-09-17 11:54:03 +02:00
Valentine Boineau
16a422b8be Add gitignore file for Symfony 3.4 2019-09-17 11:52:54 +02:00
Fabien Potencier
2ae76f9723 bug #33600 [Messenger] Fix exception message of failed message is dropped on retry (tienvx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fix exception message of failed message is dropped on retry

| Q             | A
| ------------- | ---
| Branch?       | 4.3 <!-- 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 #32719
| License       | MIT
| Doc PR        | NA <!-- 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):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

8f9f44eb21 [Messenger] Fix exception message of failed message is dropped on retry
2019-09-17 11:16:58 +02:00
Valentine Boineau
fdd7ef593e [Inflector] Add .gitignore file 2019-09-17 10:36:34 +02:00
tien.xuan.vo
8f9f44eb21 [Messenger] Fix exception message of failed message is dropped on retry 2019-09-17 14:04:59 +07:00
geoffrey
48eebfc77b Add default value for Accept header 2019-09-16 21:57:32 +02:00
Fabien Potencier
21a05de9bf feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)
This PR was squashed before being merged into the 4.4 branch (closes #33507).

Discussion
----------

[WebProfiler] Deprecated intercept_redirects in 4.4

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #33467
| License       | MIT
| Doc PR        | -

Deprecated `web_profiler.intercept_redirects` config option in symfony 4.4.

Commits
-------

514c736924 [WebProfiler] Deprecated intercept_redirects in 4.4
2019-09-16 21:21:09 +02:00
Dorel Mardari
514c736924 [WebProfiler] Deprecated intercept_redirects in 4.4 2019-09-16 21:21:02 +02:00
Valentine Boineau
a2868f12a6 [HttpClient] Add .gitignore file 2019-09-16 14:30:38 +02:00
Fabien Potencier
ad6dc2ec06 bug #33340 [Finder] Adjust regex to correctly match comments in gitignore contents (Jeroeny)
This PR was squashed before being merged into the 4.3 branch (closes #33340).

Discussion
----------

[Finder] Adjust regex to correctly match comments in gitignore contents

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32985
| License       | MIT

Description from issue:

When using `ignoreVCSIgnored`  as argument with the Symfony Finder, it will construct a regex equivalent of the gitignore pattern. However it seems that when a comment line (prefixed with `#`) is present in the `.gitignore`, the regex used to remove comment lines matches every line and thus returns `$gitignoreFileContent` as empty.

Commits
-------

e56fc7cb58 [Finder] Adjust regex to correctly match comments in gitignore contents
2019-09-16 13:29:48 +02:00
=
e56fc7cb58 [Finder] Adjust regex to correctly match comments in gitignore contents 2019-09-16 13:29:41 +02:00
Fabien Potencier
c7911ae92f Merge branch '4.3' into 4.4
* 4.3:
  ensure compatibility with type resolver 0.5
2019-09-16 10:45:43 +02:00
Fabien Potencier
9a019d7201 minor #33587 [WebProfilerBundle] Clean time.js (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebProfilerBundle] Clean time.js

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

The `classnames` property was removed in https://github.com/symfony/symfony/pull/33535.

Commits
-------

997ca70385 [WebProfilerBundle] Clean time.js
2019-09-16 10:31:03 +02:00
Fabien Potencier
5b531b6f76 feature #33579 Adding .gitattributes to remove Tests directory from "dist" (Nyholm)
This PR was merged into the 4.4 branch.

Discussion
----------

Adding .gitattributes to remove Tests directory from "dist"

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

This is a controversial topic that have been mentioned before. We recently had some discussions on Slack about it and the community not in an agreement. This was asked back in 2014 already.

Im making this PR again, because I think this will help more people than it hurts to keep the tests in the "dist" version.

### Reasons for keeping the tests with the source

* You can look at the tests to understand how the code works
* It is convenient

In the past there were an argument of people might depend on Symfony's classes in Tests. That is no longer the case since we moved reusable classes from Tests to Test.

### Reasons for removing them (merging this PR)

* There should be difference between `composer update --prefer-source` and `composer update --prefer-dist`
* Smaller packages when deploying with Docker or on Serverless.
* Static analysis tools will not complain on PHP syntax errors in our tests ([example](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/xml_with_wrong_ext.php))

## How to decide?

Merging this PR or not is tricky because no side has a solid technical argument. It is basically just personal preference. Please give this PR a 👍 or 👎 if you want to give your opinion.

## Other PRs and issues related to this:

Add .gitattributes file (https://github.com/symfony/symfony/pull/29277)
Added .gitattributes files to root and all components (https://github.com/symfony/symfony/pull/26472)
Exclude non-essential files from Composer package (https://github.com/symfony/symfony/issues/25414)
[HttpFoundation] optimize files for distribution (https://github.com/symfony/symfony/pull/24427)
Add .gitattributes files (https://github.com/symfony/symfony/pull/23926)
[Suggestion] Adding .gitattributes to ignore unnecessary folders and files for production env (https://github.com/symfony/symfony/issues/20057)
Add lightweight and root only .gitattributes (https://github.com/symfony/symfony/pull/18004)
Add .gitattributes to exclude tests from ZIPs (https://github.com/symfony/symfony/pull/17995)
[RFC] Move tests out of the source and source out of the tests (https://github.com/symfony/symfony/issues/17749)
Removal of development & testing files using .gitattributes (https://github.com/symfony/symfony/issues/16174)
Please add .gitattributes files and fix line endings (https://github.com/symfony/symfony/issues/13521)
making use of .gitattributes (https://github.com/symfony/symfony/issues/11810)

## Workarounds

There are workarounds for both sides. Example:

### Workaround if merged

* `composer update --prefer-source`

### Workaround if closed

* `find vendor/symfony -name "Tests" -type d -exec rm -r "{}" \;`
* https://github.com/editorconfig/editorconfig/issues/228
* https://github.com/dg/composer-cleaner

Commits
-------

ac7dc24bcb Adding .gitattributes to remove Tests directory from "dist"
2019-09-16 10:15:34 +02:00
Nyholm
ac7dc24bcb Adding .gitattributes to remove Tests directory from "dist" 2019-09-16 10:12:51 +02:00
Christian Flothmann
4c70de6c8f ensure compatibility with type resolver 0.5 2019-09-16 10:02:06 +02:00
Thomas Calvet
997ca70385 [WebProfilerBundle] Clean time.js 2019-09-16 10:00:25 +02:00
Christian Flothmann
b468776b44 fix tests 2019-09-16 08:43:17 +02:00
Fabien Potencier
7f81cb5308 bug #32970 [Messenger] Don't deep-merge senders configuration (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Don't deep-merge senders configuration

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32953
| License       | MIT
| Doc PR        | -

Commits
-------

20d19ac100 [Messenger] Don't deep merge routing.senders config option
2019-09-16 08:21:04 +02:00
Sebastiaan Stok
7c7422f384
[Security] Removed unused argument in Test
After #32998 there was a minor left over, the `testHandleAuthenticationClearsToken`
`$tokenClass` argument is no longer used and can be safely removed.
2019-09-15 19:41:45 +02:00
Fabien Potencier
e82fdbf97f bug #33582 [Mailer] Fix SmtpEnvelope renaming to Envelope (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Fix SmtpEnvelope renaming to Envelope

| 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       | n/a
| License       | MIT
| Doc PR        | n/a
<!--
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):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

5796c780ba [Mailer] Fix SmtpEnvelope renaming to Envelope
2019-09-15 10:47:53 +02:00
Fabien Potencier
428367f8cf Merge branch '4.3' into 4.4
* 4.3:
  fixed "link" to Contracts packages
  [WebProfilerBundle] Fix time panel legend buttons
  Fixed cache pools affecting each other due to an overwritten seed variable
  properly catch legacy tag syntax usages
2019-09-15 10:41:08 +02:00
Fabien Potencier
5796c780ba [Mailer] Fix SmtpEnvelope renaming to Envelope 2019-09-15 10:37:41 +02:00
Thomas Calvet
7f4c8d3271 [WebProfilerBundle] Fix time panel legend buttons 2019-09-13 18:20:59 +02:00
Fabien Potencier
60e3de6334 bug #33510 Minor tweaks to the welcome page (yceruto, javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

Minor tweaks to the welcome page

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

/cc @fabpot

Commits
-------

acd50615e7 Some styling tweaks
ddffc972a8 minor tweaks to the welcome page
2019-09-13 16:44:53 +01:00
Javier Eguiluz
acd50615e7
Some styling tweaks 2019-09-13 17:40:37 +02:00
Fabien Potencier
cac27b2abc bug #33571 [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee' (maxhelias)
This PR was merged into the 3.4 branch.

Discussion
----------

[Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'

| Q             | A
| ------------- | ---
| Branch?       | 3.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       | - <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | - <!-- 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):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->
I don't know if this is considered a bug or a new feature ? Tell me if I need to change target branch

This PR improves the singularization of words such as "trees", "employees" or "fees"

Commits
-------

45b4edc2dc [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
2019-09-13 15:35:37 +01:00
Fabien Potencier
5d94ace5ea bug #33568 [Validator] don't change state in case of exception (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] don't change state in case of exception

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

Commits
-------

dcd47335a8 don't change state in case of exception
2019-09-13 15:19:20 +01:00
Fabien Potencier
b07df9d205 feature #33562 [Mailer] rename SmtpEnvelope to Envelope (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] rename SmtpEnvelope to Envelope

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

Drop the Smtp prefix so that arbitrary transports do not have to depend
on SMTP specific concepts.

Commits
-------

5e2c6da349 rename SmtpEnvelope to Envelope
2019-09-13 15:15:15 +01:00
rtek
52650803bf [Console] Get dimensions from stty on windows if possible 2019-09-13 13:40:57 +01:00
Robin Chalas
20d19ac100 [Messenger] Don't deep merge routing.senders config option 2019-09-13 13:13:51 +01:00
Ruud Arentsen
29ba7a8cf1 Fixed cache pools affecting each other due to an overwritten seed variable 2019-09-13 12:59:08 +02:00
Christian Flothmann
dcd47335a8 don't change state in case of exception 2019-09-13 12:19:20 +02:00
Maxime Helias
45b4edc2dc [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee' 2019-09-13 12:10:01 +02:00
Robin Chalas
b60e0c1454 Fix lint commands frozen on empty stdin 2019-09-12 20:34:14 +01:00
Fabien Potencier
2c58dcc34b [Mailer] Rename an exception class 2019-09-12 19:43:44 +01:00
Christian Flothmann
5e2c6da349 rename SmtpEnvelope to Envelope
Drop the Smtp prefix so that arbitrary transports do not have to depend
on SMTP specific concepts.
2019-09-12 16:17:57 +02:00
Grégoire Pineau
1862cb3ec5 [Workflow] Use a better exception message when many workflow are found 2019-09-12 11:37:54 +02:00
Yonel Ceruto
4b701bb953 minor #33557 [FrameworkBundle][ErrorRenderer] Use FileLinkFormatter service when possible (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle][ErrorRenderer] Use FileLinkFormatter service when possible

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

Consistent the way TwigBundle defines the `Symfony\Bridge\Twig\Extension\CodeExtension` service:
789448b65c/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml (L88)

Commits
-------

d4a6867 use debug.file_link_formatter service when possible
2019-09-11 15:08:12 -04:00
Yonel Ceruto
d4a68673be use debug.file_link_formatter service when possible 2019-09-11 12:31:57 -04:00
Fabien Potencier
5914a1fdef bug #33517 [Yaml] properly catch legacy tag syntax usages (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[Yaml] properly catch legacy tag syntax usages

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #25534
| License       | MIT
| Doc PR        |

Commits
-------

d5894a4ff9 properly catch legacy tag syntax usages
2019-09-11 17:41:19 +02:00
Christian Flothmann
d5894a4ff9 properly catch legacy tag syntax usages 2019-09-11 15:36:32 +02:00
Nicolas Grekas
789448b65c Merge branch '4.3' into 4.4
* 4.3:
  Re-enable push support for HttpClient
  [DependencyInjection] Accept existing interfaces as valid named args
  Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property
2019-09-11 10:38:59 +02:00
Nicolas Grekas
6ea7f30b89 bug #33546 [DependencyInjection] Accept existing interfaces as valid named args (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[DependencyInjection] Accept existing interfaces as valid named args

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

Commits
-------

6612e9a939 [DependencyInjection] Accept existing interfaces as valid named args
2019-09-11 10:33:14 +02:00
Kévin Dunglas
8483842888
Re-enable push support for HttpClient 2019-09-11 09:53:13 +02:00
Thomas Calvet
6612e9a939 [DependencyInjection] Accept existing interfaces as valid named args 2019-09-11 09:42:51 +02:00
Fabien Potencier
27383a5ca8 bug #33521 Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property (a-menshchikov)
This PR was squashed before being merged into the 4.3 branch (closes #33521).

Discussion
----------

Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #33355
| License       | MIT
| Doc PR        |

Commits
-------

954dad44a1 Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property
2019-09-11 07:04:03 +02:00
Zmey
954dad44a1 Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property 2019-09-11 07:03:51 +02:00
Fabien Potencier
9c3345f384 feature #33516 [Cache] Added reserved characters constant for CacheItem (andyexeter)
This PR was squashed before being merged into the 4.4 branch (closes #33516).

Discussion
----------

[Cache] Added reserved characters constant for CacheItem

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | no
| 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 | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A <!-- required for new features -->

This PR introduces a `RESERVED_CHARACTERS` constant to the `CacheItem` class to keep things DRY.

The rationale for making the constant public is so that developers can access the list of reserved characters so they could - for example - sanitise keys before passing them to the Cache component.

Commits
-------

d8533066de [Cache] Added reserved characters constant for CacheItem
2019-09-11 06:59:36 +02:00
andyexeter
d8533066de [Cache] Added reserved characters constant for CacheItem 2019-09-11 06:59:27 +02:00
Fabien Potencier
419be6a6e5 feature #33503 [SecurityBundle] Move Anonymous DI integration to new AnonymousFactory (wouterj)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Move Anonymous DI integration to new AnonymousFactory

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

For some reason, all security authentication providers/listeners have a `SecurityFactory` that adds configuration and registers the necessary services, except from anonymous security. I'm not sure why that has not been done. The only thing I can think of is making sure it is added to the end.

I've added a new "internal" factory position, to make sure it is always the last registered provider and moved everything to a new `AnonymousFactory`.

Nothing changes on the usage side, but it makes internal code a bit easier to understand and makes sure we don't break anything while refactoring the `SecurityExtension` in the future.

Commits
-------

0da2761c15 Move Anonymous config to a SecurityFactory
2019-09-11 06:57:59 +02:00
Nicolas Grekas
0e3ea8f8c9 [DI] cascade preloading only to public parameters/properties 2019-09-10 19:54:02 +02:00
Nicolas Grekas
3536b1371b Merge branch '4.3' into 4.4
* 4.3:
  Update GitHub PR template
  don't dump a scalar tag value on its own line
2019-09-10 18:53:10 +02:00
Nicolas Grekas
13ff9f94c5 Merge branch '3.4' into 4.3
* 3.4:
  Update GitHub PR template
  don't dump a scalar tag value on its own line
2019-09-10 18:53:00 +02:00
Nicolas Grekas
8ca975ddf4 bug #33532 [HttpKernel] fix compat with legacy DebugClassLoader (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] fix compat with legacy DebugClassLoader

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

Commits
-------

73198c6d51 [HttpKernel] fix compat with legacy DebugClassLoader
2019-09-10 18:52:40 +02:00
Fabien Potencier
bed6511c26 feature #33535 [WebProfilerBundle] Assign automatic colors to custom Stopwatch categories (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebProfilerBundle] Assign automatic colors to custom Stopwatch categories

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #33514
| License       | MIT
| Doc PR        | not needed

### Before

![image](https://user-images.githubusercontent.com/73419/64624345-d2907000-d3ea-11e9-9320-5b316768273d.png)

### After

![image](https://user-images.githubusercontent.com/73419/64624358-d6bc8d80-d3ea-11e9-875d-99396782d95a.png)

- - - - -

I'd appreciate reviews from JavaScript experts. Thanks!

Commits
-------

329a74fe47 [WebProfilerBundle] Assign automatic colors to custom Stopwatch categories
2019-09-10 18:15:51 +02:00
Nicolas Grekas
e25c5957e0 [DI] fix related to preloading 2019-09-10 17:50:40 +02:00
Nicolas Grekas
73198c6d51 [HttpKernel] fix compat with legacy DebugClassLoader 2019-09-10 17:04:34 +02:00
Javier Eguiluz
329a74fe47 [WebProfilerBundle] Assign automatic colors to custom Stopwatch categories 2019-09-10 16:46:44 +02:00
Nicolas Grekas
541f80c635 minor #33529 [DI] use dirname() when possible (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] use dirname() when possible

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

On second look, I think this works :)

Commits
-------

2eae300537 [DI] use dirname() when possible
2019-09-10 15:08:12 +02:00
Nicolas Grekas
2eae300537 [DI] use dirname() when possible 2019-09-10 15:02:59 +02:00
Thomas Calvet
62483ed305 [ErrorHandler] Forward \Throwable 2019-09-10 14:09:52 +02:00
Fabien Potencier
f7130e332f bug #33518 [Yaml] don't dump a scalar tag value on its own line (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] don't dump a scalar tag value on its own line

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

This commit fine tunes the bugfix made in #33377 with the feedback provided in https://github.com/symfony/symfony/issues/33464#issuecomment-528290985.

Commits
-------

a549069a49 don't dump a scalar tag value on its own line
2019-09-10 13:35:27 +02:00
Fabien Potencier
51ffc18b6d Simplify usage of dirname() 2019-09-10 13:34:21 +02:00
Fabien Potencier
c709d43878 Merge branch '4.3' into 4.4
* 4.3:
  Remove Google references when not needed
  Simplify usage of dirname()
  Remove Google references when not needed
2019-09-10 13:27:29 +02:00
Fabien Potencier
1517d1682f Remove Google references when not needed 2019-09-10 13:27:19 +02:00
Fabien Potencier
6f459b9419 Merge branch '3.4' into 4.3
* 3.4:
  Remove Google references when not needed
2019-09-10 13:25:17 +02:00
Fabien Potencier
c4d44eb089 Simplify usage of dirname() 2019-09-10 13:22:25 +02:00
Christian Flothmann
a549069a49 don't dump a scalar tag value on its own line 2019-09-10 12:38:46 +02:00
Fabien Potencier
9665d7633d Remove Google references when not needed 2019-09-10 12:13:59 +02:00
Fabien Potencier
1c3d409490 bug #33525 [DI] fix Preloader (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] fix Preloader

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

Commits
-------

4cc8641326 [DI] fix Preloader
2019-09-10 11:48:59 +02:00
Nicolas Grekas
4cc8641326 [DI] fix Preloader 2019-09-10 11:11:45 +02:00
Nicolas Grekas
0e28518b33 [HttpClient] fix calling the buffer-enabling callback 2019-09-10 10:51:24 +02:00
Nicolas Grekas
6a7b77ecb2 [HttpClient] fix php notice on push 2019-09-10 08:36:23 +02:00
Robin Chalas
92e64a1dfa minor #33511 Require exact match when reading from stdin with a dash (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Require exact match when reading from stdin with a dash

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

I think reading from stdin should happen only when the argument is exactly a dash, with no other files on the command line.

The alternative is to allow a dash at any position in the list of files, but I'm not sure that'd make sense.

Commits
-------

3d14b79dad Require exact match when reading from stdin with a dash
2019-09-09 18:45:50 +02:00
Yonel Ceruto
ddffc972a8 minor tweaks to the welcome page 2019-09-09 09:46:27 -04:00
Christian Flothmann
600bde9562 do not perform string operations on null 2019-09-09 12:09:16 +02:00
Nicolas Grekas
e9f524a37e feature #32565 [HttpClient] Allow enabling buffering conditionally with a Closure (rjwebdev)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Allow enabling buffering conditionally with a Closure

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31883
| License       | MIT
| Doc PR        | symfony/symfony-docs#12043

With this PR, responses can be buffered automatically from a closure passed to the `buffer` option.

```php
$resp = $client->request('GET', $url, [
    'buffer' => function (array $headers): bool { return true/false; },
]);
```

When no option is provided, buffering is now enabled only for json, xml and text/* content types.

Commits
-------

f705ac9dc4 [HttpClient] Allow enabling buffering conditionally with a Closure
2019-09-09 09:21:48 +02:00
Nicolas Grekas
3d14b79dad Require exact match when reading from stdin with a dash 2019-09-09 08:40:31 +02:00
Alexander M. Turek
919afd2112 [Cache] Add types to constructors and private/final/internal methods. 2019-09-08 23:57:26 +02:00
Nicolas Grekas
81ac674b61 Merge branch '4.3' into 4.4
* 4.3:
  SCA: minor code tweaks
  [HttpClient] fallbackto CURLMOPT_MAXCONNECTS when CURLMOPT_MAX_HOST_CONNECTIONS is not available
  fixed typo
  [HttpKernel] Fix Apache mod_expires Session Cache-Control issue
  Fix getFileLinkFormat() to avoid returning the wrong URL in Profiler
2019-09-08 22:40:04 +02:00
Nicolas Grekas
5a06f94c08 Merge branch '3.4' into 4.3
* 3.4:
  SCA: minor code tweaks
  [HttpKernel] Fix Apache mod_expires Session Cache-Control issue
  Fix getFileLinkFormat() to avoid returning the wrong URL in Profiler
2019-09-08 22:39:53 +02:00
Nicolas Grekas
26954bc4ff minor #33410 [HttpFoundation] Add types to private/final/internal methods and constructors (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Add types to private/final/internal methods and constructors

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32179, #33228
| License       | MIT
| Doc PR        | N/A

Commits
-------

1978d88f1b [HttpFoundation] Add types to private/final/internal methods and constructors.
2019-09-08 22:35:39 +02:00
Alexander M. Turek
1978d88f1b [HttpFoundation] Add types to private/final/internal methods and constructors. 2019-09-08 21:38:13 +02:00
Alexander M. Turek
def0ac7a2b Add types to private/final/internal methods and constructors. 2019-09-08 21:37:35 +02:00
Fabien Potencier
4d10d9e0c6 bug #33505 [HttpClient] fallbackto CURLMOPT_MAXCONNECTS when CURLMOPT_MAX_HOST_CONNECTIONS is not available (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fallbackto CURLMOPT_MAXCONNECTS when CURLMOPT_MAX_HOST_CONNECTIONS is not available

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #33462
| License       | MIT
| Doc PR        | -

Commits
-------

0aae1d7c0a [HttpClient] fallbackto CURLMOPT_MAXCONNECTS when CURLMOPT_MAX_HOST_CONNECTIONS is not available
2019-09-08 19:52:35 +02:00
Vladimir Reznichenko
32ea449679 SCA: minor code tweaks 2019-09-08 19:26:24 +02:00
Fabien Potencier
afad96285e feature #32032 [DI] generate preload.php file for PHP 7.4 in cache folder (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] generate preload.php file for PHP 7.4 in cache folder

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29105
| License       | MIT
| Doc PR        | -

This PR makes the PhpDumper generate a preloading file suited for PHP 7.4.
On a skeleton app, the generated file is `var/cache/dev/srcApp_KernelDevDebugContainer.preload.php` (of course, this varies by env name + kernel class)

One missing thing is listing some classes that are always needed but are not related to services.

Typically: `Request` and `Response`. We might need a new mechanism to make this list extensible.

I did not measure the benefit of this on PHP 7.4. I would really appreciate if someone could give it a try on PHP 7.4 with preloading enabled.

Commits
-------

c4dad0de5d [DI] generate preload.php file for PHP 7.4 in cache folder
2019-09-08 19:24:47 +02:00
Fabien Potencier
b29775ec03 minor #33500 Allow version 2 of the contracts package (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

Allow version 2 of the contracts package

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

The plan is to release a version 2 of the contracts package that will require php 7.2 but remains compatible to Symfony 4.

Commits
-------

a1ee32039b Allow version 2 of the contracts package.
2019-09-08 19:17:13 +02:00
Fabien Potencier
70a1843878 Tweak output 2019-09-08 19:15:29 +02:00
k0d3r1s
3249a4e850 [FrameworkBundle] Added --sort option for TranslationUpdateCommand 2019-09-08 19:13:44 +02:00
Nicolas Grekas
0aae1d7c0a [HttpClient] fallbackto CURLMOPT_MAXCONNECTS when CURLMOPT_MAX_HOST_CONNECTIONS is not available 2019-09-08 18:59:44 +02:00
Nicolas Grekas
c4dad0de5d [DI] generate preload.php file for PHP 7.4 in cache folder 2019-09-08 17:48:39 +02:00
Wouter J
0da2761c15 Move Anonymous config to a SecurityFactory 2019-09-08 16:32:40 +02:00
Alexander M. Turek
a1ee32039b Allow version 2 of the contracts package. 2019-09-08 12:38:38 +02:00
Fabien Potencier
47a87849c0 bug #32818 [HttpKernel] Fix getFileLinkFormat() to avoid returning the wrong URL in Profiler (Arman-Hosseini)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Fix getFileLinkFormat() to avoid returning the wrong URL in Profiler

| Q             | A
| ------------- | ---
| Branch?       | >= 3.4 <!-- see below -->
| 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 | #32444   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A <!-- required for new features -->

I had this problem and I noticed that an issue had already been registered.
So I registered the pull request.

Commits
-------

9ed5f03b98 Fix getFileLinkFormat() to avoid returning the wrong URL in Profiler
2019-09-08 09:16:45 +02:00
Alejandro Diaz Torres
ea03f6d664 [Serializer] Allow multi-dimenstion object array in AbstractObjectNormalizer 2019-09-08 09:15:36 +02:00
Fabien Potencier
1bfbaeb894 fixed typo 2019-09-08 09:09:18 +02:00
Fabien Potencier
dc75ae2614 feature #33189 New welcome page on startup for 4.4 LTS & 5.0 (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

New welcome page on startup for 4.4 LTS & 5.0

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

A new LTS version of Symfony is coming and a new major version too. That deserves a little more ❤️ than usual.

This picture simulate two components of the live: the Ocean and the sky/Universe, with the aim of inspiring calm at the same time desire to build good & great things:

 ![welcome-page](https://user-images.githubusercontent.com/2028198/63116799-77dd3300-bf68-11e9-8bb5-8c03b301c9e2.gif)

The HUE value changes randomly each time you enter to the homepage. That's just an idea to make it dynamic. I invite you to try it and send your ideas too. I'd like this experience to be extremely exciting for newcomers.

About all text & message this would be a good time to say what people want to hear :) Symfony's amazing \o/. Some communication skills are required here.

I'm not a designer, so I'd want some expert on this topic destroying the proposal making it even better :)

HTML+CSS only: I tried to use some moderm features that were compatible with most of browser, but I might be forgetting something.

The icons were taken from https://material.io/resources/icons/ (free), but I don't know how to deal with this license:
> Our icons are free for everyone to use. Please don’t try to sell them.
> Available under [Apache license version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html).

Should we copy it somewhere? should it be visible to the user?

**Before:**
![old-welcome-page](https://user-images.githubusercontent.com/2028198/63117275-6cd6d280-bf69-11e9-9ffc-cce6000e3518.png)

A good first feeling is really really important, is it worth it? Thoughts!

ping to my friend @javiereguiluz this is for sure something you would like to check.

Cheers!

Commits
-------

328b97ec71 New welcome page
2019-09-08 09:00:00 +02:00
Fabien Potencier
e776419cee feature #33295 [OptionsResolver] Display full nested option hierarchy in exceptions (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[OptionsResolver] Display full nested option hierarchy in exceptions

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

It kind of improve the DX, especially when you define a lot of nested form options since the file and line cannot be displayed.

```php
$resolver->setDefaults([
    'array' => function (OptionsResolver $arrayResolver): void {
        $arrayResolver->setRequired('foo');
    },
]);

```

Before:
`The required option "foo" is missing.`

After:
`The required option "array[foo]" is missing.`

That can go to 4.3 I guess.

Commits
-------

a981fc3b50 [OptionsResolver] Display full nested options hierarchy in exceptions
2019-09-08 08:56:26 +02:00
Fabien Potencier
8aa708eeb9 feature #33486 [VarDumper] Display fully qualified title (pavinthan, nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] Display fully qualified title

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

We can see the objects with namespace that help us to navigate to the file easily.

Before: These are diffrent Collection class
<img width="203" alt="Screen Shot 2019-09-06 at 1 02 37 PM" src="https://user-images.githubusercontent.com/13897936/64410319-663f0500-d0a8-11e9-98d5-743e2ccf2737.png">

Now: we can see the diffrent
<img width="376" alt="Screen Shot 2019-09-06 at 1 02 20 PM" src="https://user-images.githubusercontent.com/13897936/64410304-60e1ba80-d0a8-11e9-9cb1-f88c0f8c3de9.png">

Commits
-------

a8252a23ff [VarDumper] display ellipsed FQCN for nested classes
84682eaa03 [VarDumper] Display fully qualified title
2019-09-08 08:52:49 +02:00
Peter Bowyer
9e942768c9 [HttpKernel] Fix Apache mod_expires Session Cache-Control issue 2019-09-08 08:50:59 +02:00
Fabien Potencier
4234601bd9 feature #33496 Deprecated not passing dash symbol (-) to STDIN commands (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

Deprecated not passing dash symbol (-) to STDIN commands

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

Follow-up https://github.com/symfony/symfony/pull/33446

> There's a conflict here: when no argument was provided, the command also reads from STDIN.
So now, it reads from STDIN, and if there is nothing there, reads from the default template.
This has been caught in php/php-src#4672

> This creates an ambiguous situation - maybe one did pipe nothing but doesn't expect the default template dir to be linted.

> I'd suggest resolving the ambiguity by reading from STDIN only when explicitly asked for. Passing - as argument could the way. And we could trigger a deprecation for now.

For consistency, the other 2 lint commands (`lint:yaml` and `lint:xliff`) have been touched as well.

The plan for 5.0 is read from the STDIN only when `-` is given.

/cc @nicolas-grekas

Commits
-------

586f299ebd deprecated not passing dash symbol (-) to STDIN commands
2019-09-08 08:49:29 +02:00
Fabien Potencier
8f84347ec3 feature #32742 [Console] Added support for definition list and horizontal table (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Added support for definition list and horizontal table

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

I need that in a projet where I want to display some data horizontally.

Usage:
```php
<?php

use Symfony\Component\Console\Helper\TableSeparator;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Style\SymfonyStyle;

require __DIR__.'/vendor/autoload.php';

$io = new SymfonyStyle(new ArrayInput([]), new ConsoleOutput());

$io->table(['a', 'b', 'c'], [[1, 2, 3], [4, 5, 6]]);

$io->table(['a', 'b', 'c'], [[1, 2, 3], [4, 5, 6]], true);

$io->definitionList(
    ['foo' => 'bar'],
    new TableSeparator(),
    'this is a title',
    new TableSeparator(),
    ['foo2' => 'bar2']
);
```

![image](https://user-images.githubusercontent.com/408368/63788677-2df43580-c8f6-11e9-9ce6-b7abcecf7f24.png)

Commits
-------

66028fe19f [Console] Added support for definition list
2019-09-08 08:47:16 +02:00
Nicolas Grekas
c1f39709ff [DI] add FileLoader::registerAliasesForSinglyImplementedInterfaces() 2019-09-07 23:26:04 +02:00
Daniel Iwaniec
bec38900d8 [DI] scope singly-implemented interfaces detection by file 2019-09-07 22:48:51 +02:00
Yonel Ceruto
586f299ebd deprecated not passing dash symbol (-) to STDIN commands 2019-09-07 09:00:46 -04:00