Commit Graph

33013 Commits

Author SHA1 Message Date
Nicolas Grekas
33b881b9b7 Merge branch '3.4' into 4.2
* 3.4:
  [TwigBridge] remove deprecation triggered when using Twig 2.7
2019-03-10 18:09:50 +01:00
Nicolas Grekas
c17a5b25b5 [TwigBridge] remove deprecation triggered when using Twig 2.7 2019-03-10 18:07:42 +01:00
Jules Pietri
53a6ff88f7 [Routing] Fixed XML options resolution 2019-03-10 17:02:59 +01:00
Nicolas Grekas
6fd6b94628 Merge branch '4.2'
* 4.2:
  fix merge
2019-03-10 11:16:53 +01:00
Nicolas Grekas
11ac27d0b2 fix merge 2019-03-10 11:16:46 +01:00
Nicolas Grekas
bed7694132 Merge branch '4.2'
* 4.2: (27 commits)
  cs fix
  cs fix
  [PHPUnit-Bridge] override some environment variables
  [TwigBridge] Remove use spaceless tag
  Upgrade zookeeper ext
  [translation] Update defaut format from yml to yaml
  Change default log level for output streams
  update docblock to match the actual behavior
  Don't resolve the Deprecation error handler mode until a deprecation is triggered
  compatibility with phpunit8
  Make 'headers' key optional for encoded messages
  [Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods
  Fix undefined variable fromConstructor when passing context to getTypes
  Added translations for chineese language.
  Allow 3rd argument to be null
  Remove whitespace (tab on blank line)
  [Monolog] Really reset logger when calling logger::reset()
  [Form] Fixes debug:form appears many times as type extensions configured with new getExtendedTypes method
  Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
  Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
  ...
2019-03-10 11:14:34 +01:00
Nicolas Grekas
a5951cef91 Merge branch '3.4' into 4.2
* 3.4:
  cs fix
  cs fix
  [PHPUnit-Bridge] override some environment variables
  [TwigBridge] Remove use spaceless tag
  [translation] Update defaut format from yml to yaml
  Change default log level for output streams
  update docblock to match the actual behavior
  compatibility with phpunit8
  [Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods
  Added translations for chineese language.
2019-03-10 11:08:12 +01:00
Nicolas Grekas
b43cfc831d cs fix 2019-03-10 11:07:44 +01:00
Nicolas Grekas
504d4f2716 cs fix 2019-03-10 11:06:19 +01:00
Nicolas Grekas
42626744b2 bug #30496 [PHPUnit-Bridge] override some Composer environment variables (nicoweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[PHPUnit-Bridge] override some Composer environment variables

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

Override `COMPOSER_VENDOR_DIR` and `COMPOSER_BIN_DIR` with their default values in PHPUnit Bridge: #30467

Commits
-------

628502645e [PHPUnit-Bridge] override some environment variables
2019-03-10 10:59:01 +01:00
Nicolas Grekas
c6a35ac106 bug #30505 [TwigBridge] Remove usages of the spaceless tag (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] Remove usages of the spaceless tag

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

The spaceless tag is deprecated since version 2.7.

Commits
-------

2ee178b5c5 [TwigBridge] Remove use spaceless tag
2019-03-10 10:57:46 +01:00
nicoweb
628502645e [PHPUnit-Bridge] override some environment variables 2019-03-10 10:48:28 +01:00
Nicolas Grekas
2ee178b5c5 [TwigBridge] Remove use spaceless tag 2019-03-10 10:14:34 +01:00
Fabien Potencier
9c60490798 bug #30466 [Messenger] Make 'headers' key optional for encoded messages (yceruto)
This PR was merged into the 4.2 branch.

Discussion
----------

[Messenger] Make 'headers' key optional for encoded messages

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

Commits
-------

bb881c9cd0 Make 'headers' key optional for encoded messages
2019-03-09 20:40:16 +01:00
Fabien Potencier
c207cc7940 feature #30472 [Translation] Add XLIFF 1 source to metadata to differentiate from attr (ostrolucky)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Translation] Add XLIFF 1 source to metadata to differentiate from attr

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

Here's our use case this patch solves:

We have 2 translation files. One is created by developer and has empty `<target>`. Second one is created by translator and has non-empty `<target>`, but same `<source>`.

Now, unlike Symfony fixtures, we also use `resname=` XLIFF1 attribute. This allows us to detect when translation is out of date, which happens when `<source>` in dev translation is changed, but `resname=` is not. As visualization which better illustrates problem:

dev.xlf:
```xml
<trans-unit id="source_is_different" resname="source_is_different">
    <source>Welcome to Calida</source>
</trans-unit>
```
real.xlf:
```xml
<trans-unit id="source_is_different" resname="source_is_different">
    <source>Welcome to Jacqueline</source>
    <target>Willkommen bei Jacqueline</target>
</trans-unit>
```

We need to be able to tell `<source>` for this pair is different (so we prepend alert glyph to translation message, to alert developer something is wrong). In current XliffFileLoader there is no way for consumer to figure out if translation key came from `resname` or `<source>`, so we had to copy whole loader.

Commits
-------

ab04f25da4 [Translation] Add XLIFF 1 source to metadata to differentiate from attr
2019-03-09 20:39:00 +01:00
Fabien Potencier
d583f80319 bug #30474 compatibility with phpunit8 (garak)
This PR was merged into the 3.4 branch.

Discussion
----------

compatibility with phpunit8

This basically adds the same phpunit8 compatibility layer added in https://github.com/symfony/symfony/pull/30084 (but for other test classes)
See also discussion in https://github.com/symfony/symfony/issues/30071

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

Commits
-------

5ef254fa65 compatibility with phpunit8
2019-03-09 20:37:12 +01:00
Fabien Potencier
cf728a599b bug #30497 [HttpKernel] Change default log level for output streams (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Change default log level for output streams

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes (visual)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27510
| License       | MIT

**BEFORE**
![default-logger-level-before](https://user-images.githubusercontent.com/2028198/54072209-94e93980-4245-11e9-855a-2d32de797072.png)

**AFTER**
![default-logger-level-after](https://user-images.githubusercontent.com/2028198/54072210-9a468400-4245-11e9-96ec-ce5334aba72c.png)

This should improve the first DX/UX for console-based apps.

Commits
-------

d69d5717cd Change default log level for output streams
2019-03-09 20:34:41 +01:00
Fabien Potencier
ee62741c43 bug #30498 [translation] Update defaut format from yml to yaml (GaryPEGEOT)
This PR was squashed before being merged into the 3.4 branch (closes #30498).

Discussion
----------

[translation] Update defaut format from yml to yaml

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #30443
| License       | MIT
| Doc PR        |

As stated in #30443 , command `php bin/console translation:update --dump-messages --force fr` will by default output the translation to yml format, which is not supported by Symfony

Commits
-------

ba42030641 [translation] Update defaut format from yml to yaml
2019-03-09 20:33:48 +01:00
Gary PEGEOT
ba42030641 [translation] Update defaut format from yml to yaml 2019-03-09 20:33:41 +01:00
Nicolas Grekas
aabd1d455e [HttpClient] add ResponseInterface::toArray() 2019-03-09 17:49:48 +01:00
Fabien Potencier
836970c776 [Mime] fixed wrong logic 2019-03-09 17:40:15 +01:00
Nicolas Grekas
0e2ea87199 [HttpClient] Remove dead code 2019-03-09 17:08:21 +01:00
Yonel Ceruto
d69d5717cd Change default log level for output streams 2019-03-09 08:26:56 -05:00
Christian Flothmann
83826daba9 update docblock to match the actual behavior 2019-03-08 19:10:13 +01:00
Emmanuel BORGES
f3a5b74dfd Don't resolve the Deprecation error handler mode until a deprecation is triggered 2019-03-08 18:11:28 +01:00
Fabien Potencier
d4326b238e bug #30491 [HttpClient] fixes (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpClient] fixes

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

Spotted while playing with the client.
There is an issue with 307/308 redirects + streamed body that is not fixed here; use string bodies for now.
I'm going to look for a solution in another PR.

Commits
-------

3eca2b448d [HttpClient] fixes
2019-03-08 18:04:23 +01:00
Nicolas Grekas
3eca2b448d [HttpClient] fixes 2019-03-08 17:57:56 +01:00
Fabien Potencier
788bb812bf [Mime] added Headers::toArray() 2019-03-08 08:20:15 +01:00
Fabien Potencier
ed4a74a83a fixed logic 2019-03-08 00:10:16 +01:00
Fabien Potencier
c7a22910db fixed typo 2019-03-08 00:01:31 +01:00
Fabien Potencier
c01347fd38 feature #30482 [Mime] Fix support for date form parts (fabpot)
This PR was squashed before being merged into the 4.3-dev branch (closes #30482).

Discussion
----------

[Mime] Fix support for date form parts

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Commits
-------

5c8a4e3deb [Mime] removed the 2 parts constraints on Multipart (not true for DataFormPart for instance)
0450c4f244 [Mime] fixed support for date form parts
2019-03-07 23:47:35 +01:00
Fabien Potencier
5c8a4e3deb [Mime] removed the 2 parts constraints on Multipart (not true for DataFormPart for instance) 2019-03-07 23:36:31 +01:00
Fabien Potencier
0450c4f244 [Mime] fixed support for date form parts 2019-03-07 23:26:34 +01:00
Fabien Potencier
ba727ec509 minor #30480 [Mime] Use "yield from" when possible (fabpot)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Mime] Use "yield from" when possible

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

df1b627417 [Mime] used yield-from when possible
2019-03-07 23:09:42 +01:00
Fabien Potencier
df1b627417 [Mime] used yield-from when possible 2019-03-07 22:33:41 +01:00
Robin Chalas
ddd676723f feature #30385 [SecurityBundle] Validate the IPs configured in access_control (javiereguiluz)
This PR was squashed before being merged into the 4.3-dev branch (closes #30385).

Discussion
----------

[SecurityBundle] Validate the IPs configured in access_control

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

Commits
-------

857ac9519e [SecurityBundle] Validate the IPs configured in access_control
2019-03-07 21:34:44 +01:00
Javier Eguiluz
857ac9519e [SecurityBundle] Validate the IPs configured in access_control 2019-03-07 21:34:33 +01:00
Fabien Potencier
790854989e feature #30413 [HttpClient][Contracts] introduce component and related contracts (nicolas-grekas)
This PR was squashed before being merged into the 4.3-dev branch (closes #30413).

Discussion
----------

[HttpClient][Contracts] introduce component and related contracts

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

This PR introduces new `HttpClient` contracts and
component. It makes no compromises between DX, performance, and design.
Its surface should be very simple to use, while still flexible enough
to cover most advanced use cases thanks to streaming+laziness.

Common existing HTTP clients for PHP rely on PSR-7, which is complex
and orthogonal to the way Symfony is designed. More reasons we need
this in core are the [package principles](https://en.wikipedia.org/wiki/Package_principles): if we want to be able to keep our
BC+deprecation promises, we have to build on more stable and more
abstract dependencies than Symfony itself. And we need an HTTP client
for e.g. Symfony Mailer or #27738.

The existing state-of-the-art puts a quite high bar in terms of features we must
support if we want any adoption. The code in this PR aims at implementing an
even better HTTP client for PHP than existing ones, with more (useful) features
and a better architecture. What a pitch :)

Two full implementations are provided:
 - `NativeHttpClient` is based on the native "http" stream wrapper.
   It's the most portable one but relies on a blocking `fopen()`.
 - `CurlHttpClient` relies on the curl extension. It supports full
   concurrency and HTTP/2, including server push.

Here are some examples that work with both clients.

For simple cases, all the methods on responses are synchronous:

```php
$client = new NativeHttpClient();

$response = $client->get('https://google.com');

$statusCode = $response->getStatusCode();
$headers = $response->getHeaders();
$content = $response->getContent();
```

By default, clients follow redirects. On `3xx`, `4xx` or `5xx`, the `getHeaders()` and `getContent()` methods throw an exception, unless their `$throw` argument is set to `false`.
This is part of the "failsafe" design of the component. Another example of this
failsafe property is that broken dechunk or gzip streams always trigger an exception,
unlike most other HTTP clients who can silently ignore the situations.

An array of options allows adjusting the behavior when sending requests.
They are documented in `HttpClientInterface`.

When several responses are 1) first requested in batch, 2) then accessed
via any of their public methods, requests are done concurrently while
waiting for one.

For more advanced use cases, when streaming is needed:

Streaming the request body is possible via the "body" request option.
Streaming the response content is done via client's `stream()` method:

```php
$client = new CurlHttpClient();

$response = $client->request('GET', 'http://...');

$output = fopen('output.file', 'w');

foreach ($client->stream($response) as $chunk) {
    fwrite($output, $chunk->getContent());
}
```

The `stream()` method also works with multiple responses:

```php
$client = new CurlHttpClient();
$pool = [];

for ($i = 0; $i < 379; ++$i) {
    $uri = "https://http2.akamai.com/demo/tile-$i.png";
    $pool[] = $client->get($uri);
}

$chunks = $client->stream($pool);

foreach ($chunks as $response => $chunk) {
    // $chunk is a ChunkInterface object
    if ($chunk->isLast()) {
        $content = $response->getContent();
    }
}
```

The `stream()` method accepts a second `$timeout` argument: responses that
are *inactive* for longer than the timeout will emit an empty chunk to signal
it. Providing `0` as timeout allows monitoring responses in a non-blocking way.

Implemented:
 - flexible contracts for HTTP clients
 - `fopen()` + `curl`-based clients with close feature parity
 - gzip compression enabled when possible
 - streaming multiple responses concurrently
 - `base_uri` option for scoped clients
 - progress callback with detailed info and able to cancel the request
 - more flexible options for precise behavior control
 - flexible timeout management allowing e.g. server sent events
 - public key pinning
 - auto proxy configuration via env vars
 - transparent IDN support
 - `HttpClient::create()` factory
 - extensive error handling, e.g. on broken dechunk/gzip streams
 - time stats, primary_ip and other info inspired from `curl_getinfo()`
 - transparent HTTP/2-push support with authority validation
 - `Psr18Client` for integration with libs relying on PSR-18
 - free from memory leaks by avoiding circular references
 - fixed handling of redirects when using the `fopen`-based client
 - DNS cache pre-population with `resolve` option

Help wanted (can be done after merge):
 - `FrameworkBundle` integration: autowireable alias + semantic configuration for default options
 - add `TraceableHttpClient` and integrate with the profiler
 - logger integration
 - add a mock client

More ideas:
 - record/replay like CsaGuzzleBundle
 - use raw sockets instead of the HTTP stream wrapper
 - `cookie_jar` option
 - HTTP/HSTS cache
 - using the symfony CLI binary to test ssl-related options, HTTP/2-push, etc.
 - add "auto" mode to the "buffer" option, based on the content-type? or array of content-types to buffer
 - *etc.*

Commits
-------

fc83120691 [HttpClient] Add Psr18Client - aka a PSR-18 adapter
8610668c1c [HttpClient] introduce the component
d2d63a28e1 [Contracts] introduce HttpClient contracts
2019-03-07 17:32:39 +01:00
Nicolas Grekas
fc83120691 [HttpClient] Add Psr18Client - aka a PSR-18 adapter 2019-03-07 17:16:39 +01:00
Nicolas Grekas
8610668c1c [HttpClient] introduce the component 2019-03-07 17:16:39 +01:00
Nicolas Grekas
d2d63a28e1 [Contracts] introduce HttpClient contracts 2019-03-07 17:16:38 +01:00
Massimiliano Arione
5ef254fa65
compatibility with phpunit8 2019-03-07 15:35:35 +01:00
Yonel Ceruto
bb881c9cd0 Make 'headers' key optional for encoded messages 2019-03-07 07:30:32 -05:00
Gabriel Ostrolucký
ab04f25da4
[Translation] Add XLIFF 1 source to metadata to differentiate from attr 2019-03-07 09:54:57 +01:00
Nicolas Grekas
81faf423ff feature #30377 [Validator] add MIR card scheme (antonch1989)
This PR was squashed before being merged into the 4.3-dev branch (closes #30377).

Discussion
----------

[Validator] add MIR card scheme

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

Commits
-------

aecb33a620 [Validator] add MIR card scheme
2019-03-07 09:22:46 +01:00
Anton Chernikov
aecb33a620 [Validator] add MIR card scheme 2019-03-07 09:22:39 +01:00
Nicolas Grekas
eb2972e7f7 bug #30396 [Form] Avoid a form type extension appears many times in debug:form (markitosgv)
This PR was merged into the 4.2 branch.

Discussion
----------

[Form] Avoid a form type extension appears many times in debug:form

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30394    <!-- #-prefixed issue number(s), if any -->
| License       | MIT

This PR fixes #30394. Avoid a form type extension appears many times in debug:form command. This is caused by new 4.2 feature getExtendedTypes().

Commits
-------

c4be39ce21 [Form] Fixes debug:form appears many times as type extensions configured with new getExtendedTypes method
2019-03-07 09:16:29 +01:00
Grégoire Pineau
7d5b7a3392 [Workflow] Added a context to Workflow::apply() 2019-03-06 19:14:46 +01:00
Thomas Calvet
e97ea77af5 [Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods 2019-03-06 15:53:23 +01:00
Fabien Potencier
f8664e7703 feature #30433 [Form] Allow to disable and customize PercentType symbol (Ken Stanley, OskarStark)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] Allow to disable and customize PercentType symbol

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #28796   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#11078

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

## `PercentType` `symbol` option
As of this writing, Symfony will forcibly append a percentage sign (`%`) to all input fields that are of the PercentType form type. This PR will introduce a boolean flag called `symbol` that, when `false`, will not display the percentage sign. Each of the default layouts that define percent_widget will respect this option. You could also use a customised string as value for `symbol` option.

By default, this new option will be set to `true` so that it maintains backward compatibility. The unit tests have been updated where appropriate, and a new unit test has been added (as appropriate).

Commits
-------

53c5f41f37 [Form] Allow to disable and customize PercentType symbol
9aeaea06fc Add ‘symbol’ option to PercentType
2019-03-05 11:16:31 +01:00
alfidinouhail
3be1850dcb Added translations for chineese language. 2019-03-05 11:00:34 +01:00
Oskar Stark
53c5f41f37 [Form] Allow to disable and customize PercentType symbol 2019-03-05 11:00:13 +01:00
Fabien Potencier
af52f6e7d8 bug #30361 [PropertyInfo] Fix undefined variable fromConstructor when passing context to getTypes (mantis, OskarStark)
This PR was merged into the 4.2 branch.

Discussion
----------

[PropertyInfo] Fix undefined variable fromConstructor when passing context to getTypes

| Q             | A
| ------------- | ---
| Branch?       | 4.1, 4.2, master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/symfony-docs#10969
| License       | MIT
| Doc PR        |

If passing context to getTypes, it checks value of $context['enable_constructor_extraction'] for true/false or the constructor value of enableConstructorExtraction and should then populate fromConstructor if necessary. The missing brackets around the first part of this check mean that fromConstructor is only applied if context is not set.

This fixes the issue described at [symfony/symfony-docs#10969](https://github.com/symfony/symfony-docs/pull/10969)

Commits
-------

8e401afa37 Allow 3rd argument to be null
04dc6921bd Remove whitespace (tab on blank line)
a0aa15a41e Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
c2986d5e40 Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
42995c859c Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
2d88298ace Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
e43a3bce11 Update ReflectionExtractorTest.php
2c91c754bc Update ReflectionExtractorTest.php
5acc85c48b Update ReflectionExtractorTest.php
d0a2dc0a2d Update ReflectionExtractorTest.php
be8d14a129 Fix undefined variable fromConstructor when passing context to getTypes
2019-03-05 10:45:59 +01:00
Fabien Potencier
c877cf8264 feature #30408 [HttpKernel] Better exception page when the invokable controller returns nothing (dimabory)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpKernel] Better exception page when the invokable controller returns nothing

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

---

__Prerequisites__
_Configure invokable controller_
```php
# config/routes.yaml
index:
    path: /
    controller: App\Controller\Start
```

__Before:__
![before](https://user-images.githubusercontent.com/11414342/53577698-ca739000-3b7e-11e9-98ac-8c8e27626fbe.png)

__After:__
![after](https://user-images.githubusercontent.com/11414342/53577733-df502380-3b7e-11e9-8377-a4a97ea73df8.png)

---

Take a look for an enhancement/refactoring in `HttpKernel.php`

Commits
-------

f6c1622fb5 [HttpKernel] Better exception page when the invokable controller returns nothing
2019-03-05 10:44:46 +01:00
Fabien Potencier
203cfc47b4 bug #30410 [Monolog] Really reset logger when calling logger::reset() (lyrixx)
This PR was merged into the 4.2 branch.

Discussion
----------

[Monolog] Really reset logger when calling logger::reset()

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

Commits
-------

08a20ee0ba [Monolog] Really reset logger when calling logger::reset()
2019-03-05 10:43:41 +01:00
Ken Stanley
9aeaea06fc Add ‘symbol’ option to PercentType 2019-03-05 09:34:20 +01:00
Dmytro
f6c1622fb5 [HttpKernel] Better exception page when the invokable controller returns nothing 2019-03-05 10:07:05 +02:00
Mantis Development
8e401afa37
Allow 3rd argument to be null 2019-03-04 22:36:58 +00:00
Mantis Development
04dc6921bd
Remove whitespace (tab on blank line) 2019-03-04 22:04:58 +00:00
Fabien Potencier
0034e14463 feature #30325 [HttpKernel] Prevent search engines from indexing dev applications (GaryPEGEOT)
This PR was squashed before being merged into the 4.3-dev branch (closes #30325).

Discussion
----------

[HttpKernel] Prevent search engines from indexing dev applications

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

Add the *X-Robots-Tag: noindex* to dev (and test) applications to prevent search engines to index them.

Commits
-------

3dd86719bf [HttpKernel] Prevent search engines from indexing dev applications
2019-03-04 21:45:15 +01:00
Gary PEGEOT
3dd86719bf [HttpKernel] Prevent search engines from indexing dev applications 2019-03-04 21:45:08 +01:00
Fabien Potencier
11f1660b93 bug #30445 [Mime] Fix generate message id with named address (Jibbarth)
This PR was squashed before being merged into the 4.3-dev branch (closes #30445).

Discussion
----------

[Mime] Fix generate message id with named address

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |

When using a NamedAddress in from(), the generated MessageId don't pass the validation.
In effect, the email passed to generateMessageId look like this `Fabien <fabien@symfony.com>` and the strstr transform email in this `4641b2b294b53fe983a05b1a@symfony.com>`
By passing the address only instead of toString, it's fixed.

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Commits
-------

375ac9237f [Mime] Fix generate message id with named address
2019-03-04 21:36:48 +01:00
Jibé Barth
375ac9237f [Mime] Fix generate message id with named address 2019-03-04 21:36:41 +01:00
Fabien Potencier
a75dd9feb1 feature #30390 [FrameworkBundle] Fix UrlGenerator::generate to return an empty string instead of null (Emmanuel BORGES)
This PR was squashed before being merged into the 4.3-dev branch (closes #30390).

Discussion
----------

[FrameworkBundle] Fix UrlGenerator::generate to return an empty string instead of null

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

Fix #30306 : Controller::generateUrl() must be of the type string, null returned

Commits
-------

c5b1247977 [FrameworkBundle] Fix UrlGenerator::generate to return an empty string instead of null
2019-03-04 21:07:50 +01:00
Emmanuel BORGES
c5b1247977 [FrameworkBundle] Fix UrlGenerator::generate to return an empty string instead of null 2019-03-04 21:07:39 +01:00
Christian Flothmann
fff93acf92 [Mime] remove some @final annotations 2019-03-04 14:12:17 +01:00
Christian Flothmann
22ef4589a9 add back accidentally removed code 2019-03-04 13:19:55 +01:00
Nicolas Grekas
07c4a61681 Merge branch '4.2'
* 4.2:
  Fix typo
  fix required DependencyInjection component version
2019-03-04 12:48:42 +01:00
Nicolas Grekas
ed78e71c88 Merge branch '3.4' into 4.2
* 3.4:
  Fix typo
  fix required DependencyInjection component version
2019-03-04 12:47:55 +01:00
Nicolas Grekas
e03545a299 Fix typo 2019-03-04 12:46:21 +01:00
Nicolas Grekas
c360f845df minor #30438 fix required DependencyInjection component version (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

fix required DependencyInjection component version

| 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        |

Commits
-------

ec64d8c94d fix required DependencyInjection component version
2019-03-04 12:43:52 +01:00
Christian Flothmann
ec64d8c94d fix required DependencyInjection component version 2019-03-04 12:28:05 +01:00
Fabien Potencier
de72deacc3 Merge branch '4.2'
* 4.2:
  detect annotations before blank docblock lines
  Serializer: Use the context in supports calls
2019-03-04 12:23:10 +01:00
Fabien Potencier
981550ba14 Merge branch '3.4' into 4.2
* 3.4:
  detect annotations before blank docblock lines
2019-03-04 12:23:00 +01:00
Fabien Potencier
9d791132d9 bug #30437 [Debug] detect annotations before blank docblock lines (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] detect annotations before blank docblock lines

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

This fixes the tests and a small issue after the CS changes made in df1d50dcc2 for #29920.

Commits
-------

dedd526b19 detect annotations before blank docblock lines
2019-03-04 12:21:48 +01:00
Christian Flothmann
dedd526b19 detect annotations before blank docblock lines 2019-03-04 11:54:25 +01:00
Fabien Potencier
b727f59e01 feature #30375 [Messenger] Added transport agnostic exception (nikossvnk, lolmx)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Added transport agnostic exception

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

As described in #30346, client code shouldn't care about which transport is currently used by the message bus. This pr adds a new generic exception that is thrown by the `AmqpSender` if the message couldn't be delivered.

Commits
-------

7d6a3fa487 Updated changelog to document changes in AmqpReceiver
62a08eeea0 Updated exception message in AmqpSender, updated AmqpReceiver to throw new TransportException
b2b0640d80 Chain new exception with previous one
06c84040c4 forgot one backslash, my bad
93c10013fa [Messenger] Added new TransportException which is thrown if transport could not send a message
2019-03-04 11:53:27 +01:00
Nicolas Grekas
aa6a60ead6 [Contracts] bump branch alias 2019-03-04 11:50:13 +01:00
soyuka
a02ad96336
Serializer: Use the context in supports calls 2019-03-04 11:48:31 +01:00
Fabien Potencier
ba953d984f Merge branch '4.2'
* 4.2:
  moved XSD to HTTPS
  moved XSD to HTTPS
2019-03-04 11:47:02 +01:00
Fabien Potencier
129c616092 moved XSD to HTTPS 2019-03-04 11:46:52 +01:00
Fabien Potencier
a72c0ac6bd Merge branch '3.4' into 4.2
* 3.4:
  moved XSD to HTTPS
2019-03-04 11:46:38 +01:00
Fabien Potencier
e3c0878661 moved XSD to HTTPS 2019-03-04 11:46:26 +01:00
Fabien Potencier
774a89c085 moved XSD to HTTPS 2019-03-04 11:38:54 +01:00
Fabien Potencier
ecb5378c41 Merge branch '4.2'
* 4.2:
  moved XSD to HTTPS
  moved XSD to HTTPS
2019-03-04 11:38:40 +01:00
Fabien Potencier
50dc0d2550 moved XSD to HTTPS 2019-03-04 11:38:31 +01:00
Fabien Potencier
b82d3b969f Merge branch '3.4' into 4.2
* 3.4:
  moved XSD to HTTPS
2019-03-04 11:37:56 +01:00
Eric Masoero
7d6a3fa487 Updated changelog to document changes in AmqpReceiver 2019-03-04 11:14:17 +01:00
Eric Masoero
62a08eeea0 Updated exception message in AmqpSender, updated AmqpReceiver to throw new TransportException 2019-03-04 11:14:17 +01:00
Eric Masoero
b2b0640d80 Chain new exception with previous one 2019-03-04 11:14:17 +01:00
nikos.sotiropoulos
06c84040c4 forgot one backslash, my bad 2019-03-04 11:14:17 +01:00
Eric Masoero
93c10013fa [Messenger] Added new TransportException which is thrown if transport could not send a message 2019-03-04 11:14:17 +01:00
Fabien Potencier
95e90b87b6 moved XSD to HTTPS 2019-03-04 11:06:18 +01:00
Fabien Potencier
0db9b30e14 fixed typo 2019-03-04 10:25:03 +01:00
Fabien Potencier
90b68826e9 feature #29254 [FrameworkBundle] Added the condition routing option to the debug router command (soufianZantar)
This PR was squashed before being merged into the 4.3-dev branch (closes #29254).

Discussion
----------

[FrameworkBundle] Added the condition routing option to the debug router command

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |  <!-- required for new features -->

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->
This PR will add the condition routing option to debug:router command, to show if a route have conditions or not and showing this conditions.

Commits
-------

92bdc9b5f4 [FrameworkBundle] Added the condition routing option to the debug router command
2019-03-04 10:24:25 +01:00
Soufian EZ ZANTAR
92bdc9b5f4 [FrameworkBundle] Added the condition routing option to the debug router command 2019-03-04 10:21:00 +01:00
Fabien Potencier
6c4ab8942e fixed CS 2019-03-04 10:20:13 +01:00
Fabien Potencier
8b636ef18e Merge branch '4.2'
* 4.2:
  fixed CS
  Autoconfig: don't automatically tag decorators
  removed suggestion
  [PropertyAccess] Fixed PropertyPathBuilder remove that fails to reset internal indexes
  bumped Symfony version to 4.2.5
  updated VERSION for 4.2.4
  updated CHANGELOG for 4.2.4
  bumped Symfony version to 3.4.24
  updated VERSION for 3.4.23
  update CONTRIBUTORS for 3.4.23
  updated CHANGELOG for 3.4.23
  [Routing][ServiceRouterLoader] Remove an outdated comment
2019-03-04 10:16:46 +01:00
Fabien Potencier
617bd80273 Merge branch '3.4' into 4.2
* 3.4:
  fixed CS
  removed suggestion
  [PropertyAccess] Fixed PropertyPathBuilder remove that fails to reset internal indexes
  bumped Symfony version to 3.4.24
  updated VERSION for 3.4.23
  update CONTRIBUTORS for 3.4.23
  updated CHANGELOG for 3.4.23
  [Routing][ServiceRouterLoader] Remove an outdated comment
2019-03-04 10:16:25 +01:00
Fabien Potencier
df1d50dcc2 fixed CS 2019-03-04 10:11:50 +01:00
Kévin Dunglas
05ecf829fe Autoconfig: don't automatically tag decorators 2019-03-04 09:49:34 +01:00
Nicolas Grekas
05d6475c5e Drop more usages of Serializable 2019-03-04 09:45:35 +01:00
Fabien Potencier
62e7f7dc78 removed suggestion 2019-03-04 09:36:25 +01:00
Fabien Potencier
6f273c8e34 minor #30403 [Routing][ServiceRouterLoader] Remove an outdated comment (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Routing][ServiceRouterLoader] Remove an outdated comment

| 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        | -

Since 0043653ea8, this comment is technically false.

Commits
-------

a2b73489dd [Routing][ServiceRouterLoader] Remove an outdated comment
2019-03-04 09:35:44 +01:00
Greg ORIOL
479dff4f8a [PropertyAccess] Fixed PropertyPathBuilder remove that fails to reset internal indexes 2019-03-04 07:36:31 +01:00
Fabien Potencier
ec8033f4a9 feature #30379 [FrameworkBundle][Routing] allow boolean container parameters for routes (dmaicher)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[FrameworkBundle][Routing] allow boolean container parameters for routes

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

This fixes https://github.com/symfony/symfony/issues/30366 and adds support for boolean container parameters in route conditions, defaults etc.

Commits
-------

21f4e38800 [FrameworkBundle][Routing] allow boolean container parameters for routes
2019-03-04 07:35:11 +01:00
Fabien Potencier
1e94c50699 feature #29661 [Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile() (thewilkybarkid)
This PR was squashed before being merged into the 4.3-dev branch (closes #29661).

Discussion
----------

[Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile()

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

Running PHPStan on my project picked up that passing a resource to `Filesystem::dumpFile()` didn't match the documented type.

I found this has been discussed in #20980 and #28019, without a clear result. But, my reading is that only strings should be supported. While I think that not supporting streams makes this a lot less useful (and I'm going to switch away from it), this does need to be resolved. So, I've deprecated using arrays and resources.

Commits
-------

0eaf9d2474 [Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile()
2019-03-03 22:36:26 +01:00
Chris Wilkinson
0eaf9d2474 [Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile() 2019-03-03 22:36:18 +01:00
Fabien Potencier
7535383163 bumped Symfony version to 4.2.5 2019-03-03 20:47:05 +01:00
Fabien Potencier
ea78c21cb6 updated VERSION for 4.2.4 2019-03-03 20:38:09 +01:00
Fabien Potencier
4203bef6f3 bumped Symfony version to 3.4.24 2019-03-03 20:25:29 +01:00
Fabien Potencier
16881cb72d updated VERSION for 3.4.23 2019-03-03 19:52:34 +01:00
Fabien Potencier
e1d8a5aeae Merge branch '4.2'
* 4.2:
  Removed non-existing parameters for LogoutUrlGenerator calls
  [WebProfilerBundle] toolbar: invisible route name in Firefox
  Drop spurious execution bit
  [HttpKernel] Correctly merging cache directives in HttpCache/ResponseCacheStrategy
  [Validator] Add the missing translations for the Latvian ("lv") locale
  Fixed the DebugClassLoader compatibility with eval()'d code on Darwin
  [Validator] Update Serbian translation file
2019-03-03 19:12:18 +01:00
Fabien Potencier
c52dcc40a8 Merge branch '3.4' into 4.2
* 3.4:
  Removed non-existing parameters for LogoutUrlGenerator calls
  [HttpKernel] Correctly merging cache directives in HttpCache/ResponseCacheStrategy
  [Validator] Add the missing translations for the Latvian ("lv") locale
  Fixed the DebugClassLoader compatibility with eval()'d code on Darwin
  [Validator] Update Serbian translation file
2019-03-03 19:11:24 +01:00
Fabien Potencier
e1d44375ca feature #30358 [Form] be able to specify the input format for times (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] be able to specify the input format for times

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

This expands the work started in #29887 to also allow to configure the input format for string inputs in the `TimeType`.

Commits
-------

2d9bc18c1b be able to specify the input format for times
2019-03-03 19:05:04 +01:00
tsantos
b3d536f04d [PropertyInfo] Removed useless namespace 2019-03-03 07:59:38 -03:00
Thomas Schulz
d3ee2b676e Removed non-existing parameters for LogoutUrlGenerator calls 2019-03-02 17:24:44 +01:00
Fabien Potencier
a07627ea9a fixed tests 2019-03-02 15:55:10 +01:00
Fabien Potencier
ee787d17b4 [Mime] added classes for generating MIME messages 2019-03-02 15:10:47 +01:00
Grégoire Pineau
08a20ee0ba [Monolog] Really reset logger when calling logger::reset() 2019-02-28 18:49:31 +01:00
Fabien Potencier
675c45850c bug #30383 [WebProfilerBundle] toolbar: invisible route name in Firefox (inmarelibero)
This PR was squashed before being merged into the 4.2 branch (closes #30383).

Discussion
----------

[WebProfilerBundle] toolbar: invisible route name in Firefox

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

This fixes #29858, fixing a bug that prevents Route name displaying in debug toolbar on Firefox

Commits
-------

6b6bd453e1 [WebProfilerBundle] toolbar: invisible route name in Firefox
2019-02-28 15:59:51 +01:00
Emanuele Gaspari
6b6bd453e1 [WebProfilerBundle] toolbar: invisible route name in Firefox 2019-02-28 15:59:23 +01:00
Thomas Calvet
a2b73489dd [Routing][ServiceRouterLoader] Remove an outdated comment 2019-02-27 23:16:31 +01:00
Marcos Gómez Vilches
c4be39ce21 [Form] Fixes debug:form appears many times as type extensions configured with new getExtendedTypes method 2019-02-27 15:40:07 +01:00
David Prévot
93dab5c381 Drop spurious execution bit 2019-02-26 17:31:50 -10:00
Fabien Potencier
91c5b14d8b bug #30380 [WebProfilerBundle] Fix row update on finish ajax request (yceruto)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[WebProfilerBundle] Fix row update on finish ajax request

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

```
Uncaught TypeError: Cannot read property 'setAttribute' of undefined
    at finishAjaxRequest
    at XMLHttpRequest.<anonymous>
```

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

Commits
-------

ff9e494776 Fix row update on finish ajax request
2019-02-26 12:14:15 +01:00
Nicolas Grekas
5754846683 Merge branch '4.2'
* 4.2:
  Fix git diff marker
  Removed eval() from KernelShutdownOnTearDownTrait
2019-02-26 09:35:29 +01:00
Soner Sayakci
d631bd96ac
Fix git diff marker 2019-02-26 09:03:39 +01:00
Yonel Ceruto
ff9e494776 Fix row update on finish ajax request 2019-02-25 16:12:18 -05:00
David Maicher
21f4e38800 [FrameworkBundle][Routing] allow boolean container parameters for routes 2019-02-25 19:39:36 +01:00
Fabien Potencier
d2e9a7051f feature #22048 [Security] deprecate the Role and SwitchUserRole classes (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Security] deprecate the Role and SwitchUserRole classes

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

In #20801, we deprecated the `RoleInterface`. The next logical step would be to also deprecate the `Role` class. However, we currently have the `SwitchUserRole` class (a sub-class of `Role`) that acts as an indicator to check whether or not the authenticated user switched to another user.

This PR proposes an alternative solution to the usage of the special `SwitchUserRole` class by storing the original token inside the `UsernamePasswordToken`. This PR is not complete, but rather acts as a proof of concept of how we could get rid of the `Role` and the `SwitchUserRole` classes.

Please share your opinions whether you think this is a valid approach and I will be happy to finalise the PR.

Commits
-------

d7aaa615b9 deprecate the Role and SwitchUserRole classes
2019-02-25 17:04:33 +01:00
Fabien Potencier
c8d6decb61 minor #30374 [Validator] Add the missing translations for the Latvian ("lv") locale #30174 (k0d3r1s)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Add the missing translations for the Latvian ("lv") locale #30174

Fixes #30174

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

Commits
-------

86b8c253c7 [Validator] Add the missing translations for the Latvian ("lv") locale
2019-02-25 16:58:38 +01:00
Fabien Potencier
bb903594ee bug #26532 [HttpKernel] Correctly merging cache directives in HttpCache/ResponseCacheStrategy (aschempp)
This PR was squashed before being merged into the 3.4 branch (closes #26532).

Discussion
----------

[HttpKernel] Correctly merging cache directives in HttpCache/ResponseCacheStrategy

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

This PR is a first draft to fix the incorrect merging of private and other cache-related headers that are not meant for the shared cache but the browser (see mentioned issues).

The existing implementation of `HttpFoundation\Response` is very much tailored to the `HttpCache`, for example `isCacheable` returns `false` if the response is `private`, which is not true for a browser cache. That is why my implementation does not longer use much of the response methods. They are however still used by the `HttpCache` and we should keep them as-is. FYI, the `ResponseCacheStrategy` does **not** affect the stored data of `HttpCache` but is only applied to the result of multiple merged subrequests/ESI responses.

I did read up a lot on RFC2616 as a reference. [Section 13.4](https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.4) gives an overall view of when a response MAY be cached. [Section 14.9.1](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1) has more insight into the `Cache-Control` directives.

Here's a summary of the relevant information I applied to the implementation:

 - > Unless specifically constrained by a cache-control (section 14.9) directive, a caching system MAY always store a successful response (see section 13.8) as a cache entry, MAY return it without validation if it is fresh, and MAY return it after successful validation.

    A response without cache control headers is totally fine, and it's up to the cache (shared or private) to decide what to do with it. That is why the implementation does not longer set `no-cache` if no `Cache-Control` headers are present.

 - > A response received with a status code of 200, 203, 206, 300, 301 or 410 MAY be stored […] unless a cache-control directive prohibits caching.

    > A response received with any other status code (e.g. status codes 302 and 307) MUST NOT be returned […] unless there are cache-control directives or another header(s) that explicitly allow it.

    This is what `ResponseCacheStrategy::isUncacheable` implements to decide whether a response is not cacheable at all. It differs from `Response::isCacheable` which only returns true if there are actual `Cache-Control` headers.

 - > [Section 13.2.3](https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.2.3): When a response is generated from a cache entry, the cache MUST include a single Age header field in the response with a value equal to the cache entry's current_age.

    That's why the implementation **always** adds the `Age` header. It takes the oldest age of any of the responses as common denominator for the content.

 - > [Section 14.9.3](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3): If a response includes an s-maxage directive, then for a shared cache (but not for a private cache), the maximum age specified by this directive overrides the maximum age specified by either the max-age directive or the Expires header.

    This effectively means that `max-age`, `s-maxage` and `Expires` must all be kept on the response. My implementation assumes that we can only do that if they exist in **all** of the responses, and then takes the lowest value of any of them. Be aware the implementation might look confusing at first. Due to the fact that the `Age` header might come from another subresponse than the lowest expiration value, the values are stored relative to the current response date and then re-calculated based on the age header.

The Symfony implementation did not and still does not implement the full RFC. As an example, some of the `Cache-Control` headers (like `private` and `no-cache`) MAY actually have a string value, but the implementation only supports boolean. Also, [Custom `Cache-Control` headers](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.6) are currently not merged into the final response.

**ToDo/Questions:**

 1. [Section 13.5.2](https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.5.2) specifies that we must add a [`Warning 214 Transformation applied`](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.46) if we modify the response headers.

 2. Should we add an `Expires` headers based on `max-age` if none is explicitly set in the responses? This would essentially provide the same information as `max-age` but with support for HTTP/1.0 proxies/clients.

 3. I'm not sure about the implemented handling of the `private` directive. The directive is currently only added to the final response if it is present in all of the subresponses. This can effectively result in no cache-control directive, which does not tell a shared cache that the response must not be cached. However, adding a `private` might also tell a browser to actually cache it, even though non of the other responses asked for that.

 4. > [Section 14.9.2](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.2): The purpose of the `no-store` directive is to prevent the inadvertent release or retention of sensitive information […]. The `no-store` directive applies to the entire message, and MAY be sent either in a response or in a request. If sent in a request, a cache MUST NOT store any part of either this request or any response to it. If sent in a response, a cache MUST NOT store any part of either this response or the request that elicited it.

    I have not (yet) validated whether the `HttpCache` implementation respects any of this.

 5. As far as I understand, the current implementation of [`ResponseHeaderBag::computeCacheControlValue`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php#L313) is incorrect. `no-cache` means a response [must not be cached by a shared or private cache](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1), which overrides `private` automatically.

 5. The unit tests are still very limited and I want to add plenty more to test and sort-of describe the implementation or assumptions on the RFC.

/cc @nicolas-grekas

#SymfonyConHackday2018

Commits
-------

893118f978 [HttpKernel] Correctly merging cache directives in HttpCache/ResponseCacheStrategy
2019-02-25 12:22:17 +01:00
Andreas Schempp
893118f978 [HttpKernel] Correctly merging cache directives in HttpCache/ResponseCacheStrategy 2019-02-25 12:22:09 +01:00
Dāvis Zālītis
86b8c253c7
[Validator] Add the missing translations for the Latvian ("lv") locale
Fixes #30174
2019-02-25 11:32:21 +02:00
Christian Flothmann
2d9bc18c1b be able to specify the input format for times 2019-02-25 09:54:42 +01:00
Pascal Luna
6c2aa2446d Fixed the DebugClassLoader compatibility with eval()'d code on Darwin 2019-02-24 16:45:11 +01:00
Grégoire Pineau
17533da49c [Monolog] Disable DebugLogger in CLI 2019-02-24 14:22:28 +01:00
Maxime Steinhausser
32c90ebc8e [Serializer] Normalize constraint violation parameters 2019-02-24 12:04:56 +01:00
Pascal Luna
324b70afa3 Removed eval() from KernelShutdownOnTearDownTrait 2019-02-24 02:12:10 +00:00
Oskar Stark
a0aa15a41e
Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
Co-Authored-By: mantis <mantis@users.noreply.github.com>
2019-02-23 19:26:32 +00:00
Oskar Stark
c2986d5e40
Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
Co-Authored-By: mantis <mantis@users.noreply.github.com>
2019-02-23 19:26:31 +00:00
Oskar Stark
42995c859c
Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
Co-Authored-By: mantis <mantis@users.noreply.github.com>
2019-02-23 19:26:31 +00:00
Oskar Stark
2d88298ace
Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
Co-Authored-By: mantis <mantis@users.noreply.github.com>
2019-02-23 19:26:30 +00:00
Mantis Development
e43a3bce11
Update ReflectionExtractorTest.php 2019-02-23 19:26:00 +00:00
Mantis Development
2c91c754bc
Update ReflectionExtractorTest.php 2019-02-23 19:25:30 +00:00
Mantis Development
5acc85c48b
Update ReflectionExtractorTest.php 2019-02-23 19:25:30 +00:00
Mantis Development
d0a2dc0a2d
Update ReflectionExtractorTest.php
Add test case
2019-02-23 19:25:30 +00:00
Mantis Development
be8d14a129
Fix undefined variable fromConstructor when passing context to getTypes
If passing context to getTypes, it checks value of $context['enable_constructor_extraction'] for true/false or the constructor value of enableConstructorExtraction and should then populate fromConstructor if necessary. The missing brackets around the first part of this check mean that fromConstructor is only applied if context is not set.

This fixes the issuse described at [symfony/symfony-docs#10969](https://github.com/symfony/symfony-docs/pull/10969)
2019-02-23 19:23:31 +00:00
Fabien Potencier
9202d9ed3e minor #30352 [Validator] Update Serbian translation file (burnmaniac)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Update Serbian translation file

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #30189  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | / <!-- required for new features -->

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->
I am not sure about some translations, if someone could check these, I would appreciate it.

Also, I've found that singular/plural translations have 3 translations. I am not sure if that's a mistake or not. I removed the third translation, but if I was wrong, I'll be happy to put it back.

Commits
-------

9e9a57a544 [Validator] Update Serbian translation file
2019-02-23 18:17:20 +01:00