Commit Graph

36808 Commits

Author SHA1 Message Date
Fabien Potencier
b1f6d0dbce minor #33519 Add types to constructors and private/final/internal methods (Batch I) (derrabus)
This PR was squashed before being merged into the 4.4 branch (closes #33519).

Discussion
----------

Add types to constructors and private/final/internal methods (Batch I)

| 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

As promised, now a larger batch with the following components:
* Asset
* BrowserKit
* Config
* Console
* ~~CssSelector~~
* Debug
* ~~DomCrawler~~
* DotEnv
* ErrorHandler
* ErrorRenderer
* ExpressionLanguage
* ~~Filesystem~~
* ~~Finder~~

Commits
-------

4039b95d22 Add types to constructors and private/final/internal methods (Batch I)
2019-09-27 07:43:13 +02:00
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
8f1c4f1f86 Merge branch '4.4'
* 4.4: (28 commits)
  [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
  [ErrorHandler] fix return-type patching logic
  [Messenger] Added support for `from_transport` attribute on `messenger.message_handler` tag
  [ErrorHandler] don't throw deprecations for return-types by default
  ensure legacy event dispatcher compatibility
  ensure legacy event dispatcher compatibility
  Fix return type of Process::restart().
  [Cache] fail gracefully when locking is not supported
  [HttpKernel] compress files generated by the profiler
  tweak deprecation messages and changelog
  fix version in @deprecated annotation
  Use VarCloner data instead of legacy array for query params
  [Security] use LegacyEventDispatcherProxy
  [HttpClient] fix undefined index access
  [HttpClient] fix race condition when reading response with informational status
  ...
2019-09-27 00:15:24 +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
Jérôme Vasseur
3a5fd486de Fix isGranted with object attribute 2019-09-26 15:32:08 +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
5d154fb304 feature #33553 [String] a new component for object-oriented strings management with an abstract unit system (nicolas-grekas, hhamon, gharlan)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[String] a new component for object-oriented strings management with an abstract unit system

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

This is a reboot of #22184 (thanks @hhamon for working on it) and a generalization of my previous work on the topic ([patchwork/utf8](https://github.com/tchwork/utf8)). Unlike existing libraries (including `patchwork/utf8`), this component provides a unified API for the 3 unit systems of strings: bytes, code points and grapheme clusters.

The unified API is defined by the `AbstractString` class. It has 2 direct child classes: `BinaryString` and `AbstractUnicodeString`, itself extended by `Utf8String` and `GraphemeString`.

All objects are immutable and provide clear edge-case semantics, using exceptions and/or (nullable) types!

Two helper functions are provided to create such strings:
```php
new GraphemeString('foo') == u('foo'); // when dealing with Unicode, prefer grapheme units
new BinaryString('foo') == b('foo');
```

`GraphemeString` is the most linguistic-friendly variant of them, which means it's the one ppl should use most of the time *when dealing with written text*.

Future ideas:
 - improve tests
 - add more docblocks (only where they'd add value!)
 - consider adding more methods in the string API (`is*()?`, `*Encode()`?, etc.)
 - first class Emoji support
 - merge the Inflector component into this one
 - use `width()` to improve `truncate()` and `wordwrap()`
 - move method `slug()` to a dedicated locale-aware service class
 - propose your ideas (send PRs after merge)

Out of (current) scope:
 - what [intl](https://php.net/intl) provides (collations, transliterations, confusables, segmentation, etc)

Here is the unified API I'm proposing in this PR, borrowed from looking at many existing libraries, but also Java, Python, JavaScript and Go.

```php
function __construct(string $string = '');
static function unwrap(array $values): array
static function wrap(array $values): array
function after($needle, bool $includeNeedle = false, int $offset = 0): self;
function afterLast($needle, bool $includeNeedle = false, int $offset = 0): self;
function append(string ...$suffix): self;
function before($needle, bool $includeNeedle = false, int $offset = 0): self;
function beforeLast($needle, bool $includeNeedle = false, int $offset = 0): self;
function camel(): self;
function chunk(int $length = 1): array;
function collapseWhitespace(): self
function endsWith($suffix): bool;
function ensureEnd(string $suffix): self;
function ensureStart(string $prefix): self;
function equalsTo($string): bool;
function folded(): self;
function ignoreCase(): self;
function indexOf($needle, int $offset = 0): ?int;
function indexOfLast($needle, int $offset = 0): ?int;
function isEmpty(): bool;
function join(array $strings): self;
function jsonSerialize(): string;
function length(): int;
function lower(): self;
function match(string $pattern, int $flags = 0, int $offset = 0): array;
function padBoth(int $length, string $padStr = ' '): self;
function padEnd(int $length, string $padStr = ' '): self;
function padStart(int $length, string $padStr = ' '): self;
function prepend(string ...$prefix): self;
function repeat(int $multiplier): self;
function replace(string $from, string $to): self;
function replaceMatches(string $fromPattern, $to): self;
function slice(int $start = 0, int $length = null): self;
function snake(): self;
function splice(string $replacement, int $start = 0, int $length = null): self;
function split(string $delimiter, int $limit = null, int $flags = null): array;
function startsWith($prefix): bool;
function title(bool $allWords = false): self;
function toBinary(string $toEncoding = null): BinaryString;
function toGrapheme(): GraphemeString;
function toUtf8(): Utf8String;
function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): self;
function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): self;
function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): self;
function truncate(int $length, string $ellipsis = ''): self;
function upper(): self;
function width(bool $ignoreAnsiDecoration = true): int;
function wordwrap(int $width = 75, string $break = "\n", bool $cut = false): self;
function __clone();
function __toString(): string;
```

`AbstractUnicodeString` adds these:
```php
static function fromCodePoints(int ...$codes): self;
function ascii(array $rules = []): self;
function codePoint(int $index = 0): ?int;
function folded(bool $compat = true): parent;
function normalize(int $form = self::NFC): self;
function slug(string $separator = '-'): self;
```

and `BinaryString`:
```php
static function fromRandom(int $length = 16): self;
function byteCode(int $index = 0): ?int;
function isUtf8(): bool;
function toUtf8(string $fromEncoding = null): Utf8String;
function toGrapheme(string $fromEncoding = null): GraphemeString;
```

Case insensitive operations are done with the `ignoreCase()` method.
e.g. `b('abc')->ignoreCase()->indexOf('B')` will return `1`.

For reference, CLDR transliterations (used in the `ascii()` method) are defined here:
https://github.com/unicode-org/cldr/tree/master/common/transforms

Commits
-------

dd8745aced [String] add more tests
82a00956bc [String] add tests
012e92a772 [String] a new component for object-oriented strings management with an abstract unit system
2019-09-26 10:14:27 +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
Gregor Harlan
dd8745aced [String] add more tests 2019-09-25 16:38:21 +02:00
Hugo Hamon
82a00956bc [String] add tests 2019-09-25 16:38:21 +02:00
Nicolas Grekas
012e92a772 [String] a new component for object-oriented strings management with an abstract unit system 2019-09-25 16:38:20 +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
4e0f034e11 remove tests for legacy behavior 2019-09-25 15:28:34 +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
2b6ce01a98 remove deprecated code paths 2019-09-25 10:10:24 +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
906aad95e6 Merge branch '4.4'
* 4.4:
  [Routing] fix bad fix
2019-09-24 18:23:35 +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
2d877b1804 Merge branch '4.4'
* 4.4:
  [Security/Http] fix typo in deprecation message
  [Security] Deprecate isGranted()/decide() on more than one attribute
  Fixed a minor typo in the UPGRADE to 5.0 guide
  Various tweaks 3.4
  Various tweaks 4.3
  [Security] Make stateful firewalls turn responses private only when needed
  [PhpUnit] Fix usleep mock return value
  Revert \"feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)\"
  [TwigBundle] typo
  [TwigBundle] fix test case
  [Lock] use Predis\ClientInterface instead of Predis\Client
  Allow Twig 3
  Minor tweaks
  Fix version typo in deprecation notice
  [Form][SubmitType] Add "validate" option
  hint to the --parse-tags when parsing tags fails
  Make legacy "wrong" RFC2047 encoding apply only to one header
2019-09-24 18:05:28 +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
Nicolas Grekas
80841851a7 Merge branch '4.4'
* 4.4:
  [Twig] Remove deprecated tag usage
2019-09-23 12:19:26 +02: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
798af3f43e Merge branch '4.4'
* 4.4:
  [FrameworkBundle] fix tests
  fix typo
2019-09-21 01:13:21 +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
94f5aee793 Merge branch '4.4'
* 4.4:
  [Cache] skip igbinary on PHP 7.4.0
2019-09-20 16:41:56 +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
Christian Flothmann
6233cce654 fix accessing service arguments 2019-09-20 14:27:46 +02:00
Nicolas Grekas
b6fc90ced7 Merge branch '4.4'
* 4.4:
  cleanup
  fix tests
2019-09-20 13:25:39 +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
a0ff8c12e3 Merge branch '4.4'
* 4.4:
  fix merge
2019-09-20 12:14:07 +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
b320c44b4e Merge branch '4.4'
* 4.4:
  [HttpKernel] fix merge
  fix tests
  [HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted
2019-09-20 11:29:01 +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
3f911bb20e Merge branch '4.4'
* 4.4:
  [PhpUnitBridge] more fixes for PHP 5.5
2019-09-19 19:42:14 +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
a447c4cf09 Merge branch '4.4'
* 4.4:
  [PhpUnitBridge] fix undefined variables
2019-09-19 19:32: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
47f1934899 Merge branch '4.4'
* 4.4:
  [Process] fix typo in tests
2019-09-19 19:12:13 +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
5e8f047a62 Merge branch '4.4'
* 4.4:
  [PhpUnitBridge] bump cache id
2019-09-19 18:15:10 +02: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
4442a3f2ac Merge branch '4.4'
* 4.4:
  Re-enable previously failing PHP 7.4 test cases
  [PhpUnitBridge] fix uninitialized variable
  [ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631
  [Twig] Add missing check
  Revert "bug #33618 fix tests depending on other components' tests (xabbuh)"
  install from source to include components tests
  Fix undefined constant and other minor issues
  [Twig] Add NotificationEmail
  ensure compatibility with type resolver 0.5
  Call AssertEquals with proper parameters
  [DependencyInjection] Allow binding iterable and tagged services
  [Twig] Fix Twig config extra keys
  fix tests depending on other components' tests
  Fix lint commands frozen on empty stdin
2019-09-19 18:03:37 +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
f1ebb04cb4 Cleanup 2019-09-18 17:49:21 -04: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