Commit Graph

30691 Commits

Author SHA1 Message Date
Robin Chalas
ddea90e97d minor #27858 [Console] changed warning verbosity; fixes typo (adrian-enspired)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Console] changed warning verbosity; fixes typo

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

* Tests pass, but I do not have an installation of MacOS to run tests on.  Tests should be unaffected (the test is simply [skipped on MacOS](https://github.com/symfony/console/blob/master/Tests/Command/CommandTest.php#L345)).

When a Console Command fails to change the process title on MacOS, a warning is issued to output.  This warning is relevant to developers of Console applications, but to end users is largely meaningless and potentially confusing.

This PR changes the verbosity of the warning to "very verbose" so it does not interrupt normal usage.
I've also fixed a typo in the message ("get" vs. "set").

Commits
-------

86c771a changed warning verbosity; fixes typo
2018-07-06 11:12:12 +02:00
Valentin
b4552373c1 AppBundle->App. 2018-07-06 11:57:10 +03:00
Nicolas Grekas
8f359cc047 [FrameworkBundle] allow turning routes to utf8 mode by default 2018-07-06 10:08:17 +02:00
Adrian
86c771acc4
changed warning verbosity; fixes typo 2018-07-05 11:39:28 -04:00
Nicolas Grekas
d40fed9253 bug #27848 [Workflow] Fixed BC break (lyrixx)
This PR was merged into the 4.1 branch.

Discussion
----------

[Workflow] Fixed BC break

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

Commits
-------

b24acb0579 [Workflow] Fixed BC break
2018-07-05 14:56:41 +02:00
louhde
c6f87c6e3a [Security] Allow passing null as $filter in LdapUserProvider to get the default filter 2018-07-05 14:04:59 +02:00
Nicolas Grekas
7135aa4338 Merge branch '4.1'
* 4.1:
  [DomCrawler] Fix ChoiceFormField::select() PHPDoc
  [Security] LdapUserProvider uidKey could be null
  [HttpFoundation] add tests for FlashBagInterface::setAll()
  Check for Hyper terminal on all operating systems.
  [DI] Don't show internal service id on binding errors
  Fix a bug when having more than one named handler per message subscriber
  Prevent toolbar links color override by css
  add conflict for non-compatible TwigBridge version
2018-07-05 13:54:37 +02:00
Nicolas Grekas
e308c93c7e Merge branch '4.0' into 4.1
* 4.0:
  [DomCrawler] Fix ChoiceFormField::select() PHPDoc
  [Security] LdapUserProvider uidKey could be null
  [HttpFoundation] add tests for FlashBagInterface::setAll()
  Check for Hyper terminal on all operating systems.
  [DI] Don't show internal service id on binding errors
  Prevent toolbar links color override by css
2018-07-05 13:54:23 +02:00
Nicolas Grekas
29d2101891 Merge branch '3.4' into 4.0
* 3.4:
  [DomCrawler] Fix ChoiceFormField::select() PHPDoc
  [HttpFoundation] add tests for FlashBagInterface::setAll()
  Check for Hyper terminal on all operating systems.
  [DI] Don't show internal service id on binding errors
  Prevent toolbar links color override by css
2018-07-05 13:53:42 +02:00
Nicolas Grekas
601cc0827d Merge branch '2.8' into 3.4
* 2.8:
  [DomCrawler] Fix ChoiceFormField::select() PHPDoc
  [HttpFoundation] add tests for FlashBagInterface::setAll()
  Check for Hyper terminal on all operating systems.
  Prevent toolbar links color override by css
2018-07-05 13:53:23 +02:00
Grégoire Pineau
b24acb0579 [Workflow] Fixed BC break 2018-07-05 13:35:02 +02:00
Fabien Potencier
eb64e32f7d minor #27849 [DomCrawler] Fix ChoiceFormField::select() PHPDoc (dunglas)
This PR was merged into the 2.8 branch.

Discussion
----------

[DomCrawler] Fix ChoiceFormField::select() PHPDoc

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| 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

It's allowed by `setValue`, it works, and it makes sense for `<select multiple>` fields.

Commits
-------

154ce9c170 [DomCrawler] Fix ChoiceFormField::select() PHPDoc
2018-07-05 09:30:45 +02:00
Fabien Potencier
46a32f1e59 bug #27758 [WebProfilerBundle] Prevent toolbar links color override by css (alcalyn)
This PR was merged into the 2.8 branch.

Discussion
----------

[WebProfilerBundle] Prevent toolbar links color override by css

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

Fixes this issue: https://github.com/symfony/symfony/issues/27658#issuecomment-401008659

Links color in toolbar can be easily override by application css. As this could happens sometimes, this PR set links color with a stronger CSS precedence.

Commits
-------

e12e217f2b  Prevent toolbar links color override by css
2018-07-05 09:19:04 +02:00
Kévin Dunglas
154ce9c170
[DomCrawler] Fix ChoiceFormField::select() PHPDoc 2018-07-04 23:33:50 +02:00
Nicolas Grekas
44d43303a9 bug #27820 [Messenger] Fix a bug when having more than one named handler per message subscriber (sroze)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Fix a bug when having more than one named handler per message subscriber

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

It turns out that when using multiple named handler on the same subscriber class, it wasn't working properly at all. It fixes it and obviously add a test for it :)

Commits
-------

47d715e97b Fix a bug when having more than one named handler per message subscriber
2018-07-04 17:57:14 +02:00
louhde
c77625988d [Security] LdapUserProvider uidKey could be null 2018-07-04 17:47:37 +02:00
Nicolas Grekas
0fbcfbd9a3 minor #27719 [FrameworkBundle] add conflict for non-compatible TwigBridge version (xabbuh)
This PR was merged into the 4.1 branch.

Discussion
----------

[FrameworkBundle] add conflict for non-compatible TwigBridge version

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

The argument was dropped in #27454.

Commits
-------

251e684fe6 add conflict for non-compatible TwigBridge version
2018-07-04 17:45:01 +02:00
Nicolas Grekas
1de685a2b5 minor #27836 [HttpFoundation] add tests for FlashBagInterface::setAll() (sir-kain)
This PR was squashed before being merged into the 2.8 branch (closes #27836).

Discussion
----------

[HttpFoundation] add tests for FlashBagInterface::setAll()

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

Adding documentation for the `FlashBagInterface::setAll()` function

Commits
-------

af96475e2a [HttpFoundation] add tests for FlashBagInterface::setAll()
2018-07-04 17:36:33 +02:00
Sir Kane
af96475e2a [HttpFoundation] add tests for FlashBagInterface::setAll() 2018-07-04 17:36:27 +02:00
Saif Eddin Gmati
196e708b68 Check for Hyper terminal on all operating systems. 2018-07-04 17:34:47 +02:00
Nicolas Grekas
6c8e9576a3 [DI] Add ServiceLocatorArgument to generate array-based locators optimized for OPcache shared memory 2018-07-04 16:01:49 +02:00
Nicolas Grekas
61f005af36 [DI] Don't show internal service id on binding errors 2018-07-04 11:35:48 +02:00
Robin Chalas
04b2c2db4f feature #27798 [Security] Use AuthenticationTrustResolver in SimplePreAuthenticationListener (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Security] Use AuthenticationTrustResolver in SimplePreAuthenticationListener

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

Minor, but would be consistent with how `ContextListener` checks for anonymous tokens.

Commits
-------

27b89cb [Security] Use AuthenticationTrustResolver in SimplePreAuthenticationListener
2018-07-04 11:07:45 +02:00
Kévin Dunglas
99f829ec2b
[Serializer] Allow to access to the format and context in circular ref handler 2018-07-03 22:17:49 +02:00
Nicolas Grekas
26989d4e73 bug #27830 [Dependency-Injection] Fix issue where non-defined services were attempted to be removed (ciaranmcnulty)
This PR was squashed before being merged into the 4.2-dev branch (closes #27830).

Discussion
----------

[Dependency-Injection] Fix issue where non-defined services were attempted to be removed

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| 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 | #27802   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

The RemoveUnusedServicesPass generates a graph of services that are connected, then removes services that are not part of the graph. To build this graph it creates a list of services then examines their definitions for more services.

The current scenario was causing an error, thrown by getDefinition (triggered in Behat):
 * Service was referenced by another service definition
 * Service was _not_ defined
 * Service was subsequently set() on the container

Commits
-------

53155c9800 [Dependency-Injection] Fix issue where non-defined services were attempted to be removed
2018-07-03 20:20:23 +02:00
Ciaran McNulty
53155c9800 [Dependency-Injection] Fix issue where non-defined services were attempted to be removed 2018-07-03 20:20:16 +02:00
Nicolas Grekas
a32393ba37 Merge branch '4.1'
* 4.1:
  Add color support for Hyper terminal .
  [HttpFoundation] Fix tests: new message for status 425
  [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
  [Workflow] Update phpdoc to fit a used className
  [PropertyInfo] added handling of nullable types in PhpDoc
  [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler
  [Cache] provider does not respect option maxIdLength with versioning enabled
  [Form] Fix fixtures for forward compat
  [Lock] Fix SemaphoreStoreTest on OS X
  Ensure the class discriminator mechanism works with serialization groups as well
  fix handling of empty DI extension configs
2018-07-03 20:14:13 +02:00
Nicolas Grekas
6500560000 Merge branch '4.0' into 4.1
* 4.0:
  Add color support for Hyper terminal .
  [HttpFoundation] Fix tests: new message for status 425
  [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
  [PropertyInfo] added handling of nullable types in PhpDoc
  [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler
  [Cache] provider does not respect option maxIdLength with versioning enabled
2018-07-03 19:58:50 +02:00
Nicolas Grekas
4ce5a1bbc0 Merge branch '3.4' into 4.0
* 3.4:
  Add color support for Hyper terminal .
  [HttpFoundation] Fix tests: new message for status 425
  [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
  [PropertyInfo] added handling of nullable types in PhpDoc
  [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler
  [Cache] provider does not respect option maxIdLength with versioning enabled
2018-07-03 19:50:16 +02:00
Nicolas Grekas
771c22b7a5 Merge branch '2.8' into 3.4
* 2.8:
  Add color support for Hyper terminal .
  [HttpFoundation] Fix tests: new message for status 425
  [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
2018-07-03 19:49:18 +02:00
Samuel ROZE
c648b938b2 Fix serialization of abstract items with groups across multiple entities 2018-07-03 17:02:15 +02:00
Evert Harmeling
76465fc1f7 [Workflow] Set default to autofit label in place/transition to render long labels properly 2018-07-03 13:52:14 +02:00
Samuel ROZE
47d715e97b Fix a bug when having more than one named handler per message subscriber 2018-07-03 12:43:53 +01:00
Fabien Potencier
7f3aae010b minor #27813 [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid (stloyd)
This PR was merged into the 2.8 branch.

Discussion
----------

[Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid

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

This change prevents error when invalid subscriber is being used.

Expected result:
```
The Doctrine connection "root" referenced in service "stof_doctrine_extensions.listener.sluggable" does not exist. Available connections names: default
```

Actual error:
```
Notice: Array to string conversion
```

Commits
-------

cf1bc66464 [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
2018-07-03 12:50:43 +02:00
Fabien Potencier
f27c3a8584 feature #27801 [MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors

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

Using this, enabling e.g. TokenProcessor or WebProcessor just needs one line in `services.yaml`:
```yaml
services:
    Symfony\Bridge\Monolog\Processor\TokenProcessor: ~
    Symfony\Bridge\Monolog\Processor\WebProcessor: ~
```

Commits
-------

28a4912f21 [MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors
2018-07-03 10:16:22 +02:00
Nicolas Grekas
28a4912f21 [MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors 2018-07-03 09:26:27 +02:00
AzJezz
2ab7bcf797 Add color support for Hyper terminal . 2018-07-03 09:19:32 +02:00
Kévin Dunglas
8e37d77145 [HttpFoundation] Fix tests: new message for status 425 2018-07-03 09:16:27 +02:00
Joseph Bielawski
cf1bc66464
[Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid 2018-07-03 08:45:41 +02:00
Fabien Potencier
1aae2333d8 bug #27618 [PropertyInfo] added handling of nullable types in PhpDoc (oxan)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyInfo] added handling of nullable types in PhpDoc

While not specified in PSR-5, PhpDocumentor does support parsing nullable types in the PHP 7.1 syntax (i.e. `?string`), and returns those in a `Nullable` wrapper type. We currently don't handle this and neither throw an error, which results in all kind of weird breakage when this syntax is used (e.g. "class string|int not found").

Correctly parse this syntax into a nullable type.

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

Commits
-------

38b369be3f [PropertyInfo] added handling of nullable types in PhpDoc
2018-07-02 14:52:55 +02:00
Anto
89470f19cc
[Workflow] Update phpdoc to fit a used className 2018-07-02 13:57:50 +02:00
Nicolas Grekas
27b89cb6e4 [Security] Use AuthenticationTrustResolver in SimplePreAuthenticationListener 2018-07-02 13:55:44 +02:00
Julien Maulny
e12e217f2b Prevent toolbar links color override by css 2018-07-02 11:10:37 +02:00
Oxan van Leeuwen
38b369be3f [PropertyInfo] added handling of nullable types in PhpDoc
While not specified in PSR-5, PhpDocumentor does support parsing
nullable types in the PHP 7.1 syntax (i.e. ?string), and returns those
in a Nullable wrapper. We currently don't handle this and neither throw
an error, which results in all kind of weird breakage when this syntax
is used (e.g. "class string|int not found").

Correctly parse this syntax into a nullable type.
2018-07-01 23:26:09 +02:00
Nicolas Grekas
9adb0c7e42 [Security/Http] report file+line of unserialization errors in Firewall/ContextListener 2018-07-01 22:08:52 +02:00
Nicolas Grekas
9efa555191 fix typo 2018-07-01 09:13:41 +02:00
Nicolas Grekas
83d116b031 minor #27317 [VarDumper] make control characters non-selectable in HTML (kiler129)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarDumper] make control characters non-selectable in HTML

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

### Overview
This fixes long term annoyance with control characters in dumps. It makes dumps unusable to use with e.g. SQLs, since copying them will leave `\n` (and others).

### Changes
This PR does three things:
1. Adds special class of characters abbreviated as `ctrl` (cosmetic, already exists in fact but it's not exposed in HTML)
2. Makes control characters non-selectable
3. Changes color of control character from default orange to grey (used by Symfony.com dark theme) which improves UX by showing *"hey, this is something special"*

### Preview
**Inline dump**
<img width="243" alt="screenshot 2018-05-19 17 26 18" src="https://user-images.githubusercontent.com/1227834/40273711-7d963450-5b8b-11e8-843a-dda1e2719b59.png">

**Web Profiler**
<img width="418" alt="screenshot 2018-05-19 17 38 36" src="https://user-images.githubusercontent.com/1227834/40273714-86b9cfec-5b8b-11e8-898b-b7cb5f150a72.png">
<img width="533" alt="screenshot 2018-05-19 17 20 42" src="https://user-images.githubusercontent.com/1227834/40273720-a2370852-5b8b-11e8-88c7-aed9281cc056.png">

**Dump Server**
<img width="194" alt="screenshot 2018-05-19 17 30 12" src="https://user-images.githubusercontent.com/1227834/40273722-aa444686-5b8b-11e8-9ae9-ea2eebb3368d.png">

Commits
-------

b0d4c99bf4 [VarDumper] make control characters non-selectable in HTML
2018-07-01 09:04:23 +02:00
kiler129
b0d4c99bf4 [VarDumper] make control characters non-selectable in HTML 2018-07-01 09:03:14 +02:00
Nicolas Grekas
80aa8dfcfd feature #27503 [Serializer] Allow to pass a single value for the groups opt (dunglas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Serializer] Allow to pass a single value for the groups opt

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| 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        | todo

Shortcut syntax similar to #20509 but for the context: allows to pass a string instead of an array of string in the serialization context when only one group if used.

Before:

```php
$serializer->serialize($foo, 'json', ['groups' => ['myGroup']];

/** @ApiResource(normalizationContext={"groups"={"myGroup"}}) */
```

After:

```php
$serializer->serialize($foo, 'json', ['groups' => 'myGroup'];

/** @ApiResource(normalizationContext={"groups"="myGroup") */
```

Commits
-------

5b392030f9 [Serializer] Allow to pass a single value for the groups opt
2018-07-01 08:57:58 +02:00
Nicolas Grekas
52b91bb206 bug #27659 [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler (thewilkybarkid)
This PR was squashed before being merged into the 3.4 branch (closes #27659).

Discussion
----------

[HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler

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

#26157 started to send a new cookie in `AbstractTestSessionListener`, but is incompatible with `CookieClearingLogoutHandler` as it overrides its `Set-Cookie` by setting a new cookie (breaking my test that checked to see that the cookie was removed after a log out).

Commits
-------

f54d96926a [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler
2018-07-01 08:51:37 +02:00
Chris Wilkinson
f54d96926a [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler 2018-07-01 08:51:28 +02:00
Nicolas Grekas
0da18e0cb9 bug #27752 [Cache] provider does not respect option maxIdLength with versioning enabled (Constantine Shtompel)
This PR was squashed before being merged into the 3.4 branch (closes #27752).

Discussion
----------

[Cache] provider does not respect option maxIdLength with versioning enabled

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

Component symfony/cache generates cache item ID longer then maxIdLength when versioning is enabled

Commits
-------

ba8b63b195 [Cache] provider does not respect option maxIdLength with versioning enabled
2018-07-01 08:47:52 +02:00
Constantine Shtompel
ba8b63b195 [Cache] provider does not respect option maxIdLength with versioning enabled 2018-07-01 08:47:44 +02:00
Nicolas Grekas
8c1e299954 Merge branch '4.0' into 4.1
* 4.0:
  [Form] Fix fixtures for forward compat
  [Lock] Fix SemaphoreStoreTest on OS X
2018-06-30 19:31:31 +02:00
Nicolas Grekas
cfde207ebb Merge branch '3.4' into 4.0
* 3.4:
  [Form] Fix fixtures for forward compat
  [Lock] Fix SemaphoreStoreTest on OS X
2018-06-30 19:31:14 +02:00
Kévin Dunglas
5b392030f9
[Serializer] Allow to pass a single value for the groups opt 2018-06-30 12:35:05 +02:00
Fabien Potencier
dd6ef5bee5 feature #27715 [Serializer] Deprecate CsvEncoder as_collection false default value (ogizanagi)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Serializer] Deprecate CsvEncoder as_collection false default value

| 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? | yes <!-- 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   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

As already expressed in https://github.com/symfony/symfony/pull/25369 and related issues, this behavior is quite counter-intuitive. It may be fine for write-API with a single document in the body but I think such CSV APIs are way less common than file-based ones, expecting collections. So I think this behavior should be opt-in explicitly in required cases, always dealing with collections by default.
This is still an arbitrary decision, but trying to make it based on use-cases and user's experience with CSV.

Note: perhaps we could find a better name for this as the semantic of setting `as_collection` to `false` to get the single row directly would not be really obvious.
Also, it could throw an exception when getting multiple rows where only one was expected.

Commits
-------

bce59c8427 [Serializer] Deprecate CsvEncoder as_collection false default value
2018-06-30 11:26:58 +02:00
Maxime Steinhausser
582d797b16 [Form] Fix fixtures for forward compat 2018-06-30 11:20:27 +02:00
Fabien Potencier
18aec2dba8 bug #27773 [Serializer] Class discriminator and serialization groups (sroze)
This PR was merged into the 4.1 branch.

Discussion
----------

[Serializer] Class discriminator and serialization groups

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

It turns out the discriminator mapping does not work well with the serialization groups. This is fixing it (+ a little bit of cleaning in the tests).

Commits
-------

c91b7afe35 Ensure the class discriminator mechanism works with serialization groups as well
2018-06-30 11:09:26 +02:00
Nicolas Grekas
97e8d68a05 [DI] Fix dumping ignore-on-uninitialized references to synthetic services 2018-06-30 10:53:46 +02:00
Maxime Steinhausser
bce59c8427 [Serializer] Deprecate CsvEncoder as_collection false default value 2018-06-30 10:39:07 +02:00
Fabien Potencier
c52b2e9dd1 feature #27768 [VarDumper] display the signature of callables (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarDumper] display the signature of callables

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/bobthecow/psysh/issues/218
| License       | MIT
| Doc PR        | -

E.g.

![capture d ecran de 2018-06-29 12-08-13](https://user-images.githubusercontent.com/243674/42087047-4fdc70d6-7b95-11e8-972c-216651bf7d69.png)

or

![image](https://user-images.githubusercontent.com/243674/42086967-070bc960-7b95-11e8-9470-7e88f8acf12a.png)

Commits
-------

73b4ac78c0 [VarDumper] display the signature of callables
2018-06-30 10:29:06 +02:00
Fabien Potencier
9bb990f835 feature #27766 [VarDumper] show proxified class on hover (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarDumper] show proxified class on hover

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

![capture d ecran de 2018-06-29 08-18-59](https://user-images.githubusercontent.com/243674/42076362-2ab0dd1c-7b75-11e8-9243-5e2f78afe870.png)

Commits
-------

955494c37d [VarDumper] show proxified class on hover
2018-06-30 10:26:35 +02:00
Nicolas Grekas
9074a6d6c3 minor #27779 [Lock] Fix SemaphoreStoreTest on OS X (ogizanagi)
This PR was merged into the 3.4 branch.

Discussion
----------

[Lock] Fix SemaphoreStoreTest on OS X

| 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 | https://github.com/symfony/symfony/pull/27755#pullrequestreview-132772372   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

As spotted in https://github.com/symfony/symfony/pull/27755#pullrequestreview-132772372, for OS X.

If other OS X users could give it a try (`/phpunit src/Symfony/Component/Lock/ --filter=SemaphoreStoreTest`), that would be awesome.

Commits
-------

9055611dc3 [Lock] Fix SemaphoreStoreTest on OS X
2018-06-29 21:23:12 +02:00
Nicolas Grekas
d4561e4a65 bug #27710 [DependencyInjection] fix handling of empty DI extension configs (xabbuh)
This PR was merged into the 4.1 branch.

Discussion
----------

[DependencyInjection] fix handling of empty DI extension configs

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

Commits
-------

05d4bcb987 fix handling of empty DI extension configs
2018-06-29 19:32:51 +02:00
Maxime Steinhausser
9055611dc3 [Lock] Fix SemaphoreStoreTest on OS X 2018-06-29 18:39:18 +02:00
Nicolas Grekas
73b4ac78c0 [VarDumper] display the signature of callables 2018-06-29 18:30:33 +02:00
Nicolas Grekas
0e9ded3188 Merge branch '4.1'
* 4.1:
  [HttpFoundation] update phpdoc of FlashBagInterface::add()
  [ProxyManagerBridge] Fix support of private services (bis)
  bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas)
  [Form] relax fixtures for forward compat
  [Validator] Fix the namespace of RegexTest
  [Lock] fix locale dependent test case
2018-06-29 18:29:59 +02:00
Nicolas Grekas
5f0eae682f Merge branch '4.0' into 4.1
* 4.0:
  [HttpFoundation] update phpdoc of FlashBagInterface::add()
  [ProxyManagerBridge] Fix support of private services (bis)
  bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas)
  [Form] relax fixtures for forward compat
  [Validator] Fix the namespace of RegexTest
  [Lock] fix locale dependent test case
2018-06-29 18:29:42 +02:00
Nicolas Grekas
44b573fd2d Merge branch '3.4' into 4.0
* 3.4:
  [HttpFoundation] update phpdoc of FlashBagInterface::add()
  [ProxyManagerBridge] Fix support of private services (bis)
  bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas)
  [Form] relax fixtures for forward compat
  [Validator] Fix the namespace of RegexTest
  [Lock] fix locale dependent test case
2018-06-29 18:29:32 +02:00
Nicolas Grekas
493ce7a64b Merge branch '2.8' into 3.4
* 2.8:
  [HttpFoundation] update phpdoc of FlashBagInterface::add()
  bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas)
  [Validator] Fix the namespace of RegexTest
2018-06-29 18:28:23 +02:00
Nicolas Grekas
7f9a262e74 minor #27755 [Lock] fix locale dependent test case (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Lock] fix locale dependent test case

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

Right now, I get a failure with `Exception: Failed to extract list of opend semaphores. Expect a Semaphore status, got ------ États des sémaphores --------` :)

Commits
-------

e665da0c9a [Lock] fix locale dependent test case
2018-06-29 18:26:23 +02:00
Nicolas Grekas
1da4252262 minor #27765 [HttpFoundation] update phpdoc of FlashBagInterface::add() (sir-kain)
This PR was squashed before being merged into the 2.8 branch (closes #27765).

Discussion
----------

[HttpFoundation] update phpdoc of FlashBagInterface::add()

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

**Reason why I propose to change the docblock like this: **
The `FlashBagInterface::add()` function does not work only with the `string` type in second parameter

Commits
-------

9135e18ded [HttpFoundation] update phpdoc of FlashBagInterface::add()
2018-06-29 18:24:44 +02:00
Sir Kane
9135e18ded [HttpFoundation] update phpdoc of FlashBagInterface::add() 2018-06-29 18:24:38 +02:00
Nicolas Grekas
0990bbd7c9 bug #27776 [ProxyManagerBridge] Fix support of private services (bis) (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[ProxyManagerBridge] Fix support of private services (bis)

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

Commits
-------

3ca0c86afe [ProxyManagerBridge] Fix support of private services (bis)
2018-06-29 18:22:49 +02:00
Nicolas Grekas
3ca0c86afe [ProxyManagerBridge] Fix support of private services (bis) 2018-06-29 16:05:32 +02:00
Nicolas Grekas
6e5c15d8aa bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] Dont throw if "security.http_utils" is not found

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

The comment + test were misleading, the actual important thing is wiring `AddSessionDomainConstraintPass` before removing passes, which is already the case already.

Commits
-------

db88330448 [SecurityBundle] Dont throw if "security.http_utils" is not found
2018-06-29 15:22:49 +02:00
Samuel ROZE
c91b7afe35 Ensure the class discriminator mechanism works with serialization groups as well 2018-06-29 12:52:46 +01:00
Nicolas Grekas
2258ce4357 [Form] relax fixtures for forward compat 2018-06-29 13:28:58 +02:00
Nicolas Grekas
955494c37d [VarDumper] show proxified class on hover 2018-06-29 08:20:42 +02:00
Kévin Dunglas
fe7fc44085
[Validator] Fix the namespace of RegexTest 2018-06-28 13:49:38 +02:00
Nicolas Grekas
e665da0c9a [Lock] fix locale dependent test case 2018-06-28 11:33:10 +02:00
Fabien Potencier
83232f85ff feature #27675 [DoctrineBridge] always load event listeners lazy via ServiceLocator (dmaicher)
This PR was squashed before being merged into the 4.2-dev branch (closes #27675).

Discussion
----------

[DoctrineBridge] always load event listeners lazy via ServiceLocator

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

As described in https://github.com/symfony/symfony/issues/27661 this PR suggests to always load doctrine event listeners lazily from a service locator instead of the full service container.

If we agree to move forward I could tackle the remaining todos:

- [x] update UPGRADE.md
- [x] documentation PR
- [x] tested on real app

Commits
-------

130ec0525d [DoctrineBridge] always load event listeners lazy via ServiceLocator
2018-06-28 10:12:17 +02:00
David Maicher
130ec0525d [DoctrineBridge] always load event listeners lazy via ServiceLocator 2018-06-28 10:12:09 +02:00
Nicolas Grekas
d3a43b177a Merge branch '4.1'
* 4.1:
  [HttpFoundation] fix merge
2018-06-28 10:10:58 +02:00
Nicolas Grekas
fd8fd3df47 [HttpFoundation] fix merge 2018-06-28 10:10:40 +02:00
Nicolas Grekas
17977c8d0c bug #27734 [Cache] ArrayAdapter and NullAdapter don't need stampede protection (Pierre Rineau)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] ArrayAdapter and NullAdapter don't need stampede protection

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

Cf. issues.

Commits
-------

3178aed84e [Cache] ArrayAdapter and NullAdapter don't need stampede protection
2018-06-28 08:42:31 +02:00
Pierre Rineau
3178aed84e [Cache] ArrayAdapter and NullAdapter don't need stampede protection 2018-06-28 08:41:11 +02:00
Nicolas Grekas
adb137d5c1 Merge branch '4.1'
* 4.1:
  [Routing] Disallow object usage inside Route
  [HttpFoundation] missing namespace for RedisProxy
  [Routing] fix too much greediness in host-matching regex
  [HttpFoundation] fix registration of session proxies
  failing test to reproduce session problem
  [HttpFoundation] fix session tracking counter
2018-06-28 08:35:46 +02:00
Nicolas Grekas
223cf06121 Merge branch '4.0' into 4.1
* 4.0:
  [HttpFoundation] fix registration of session proxies
  failing test to reproduce session problem
  [HttpFoundation] fix session tracking counter
2018-06-28 08:35:31 +02:00
Nicolas Grekas
9aecd2b436 Merge branch '3.4' into 4.0
* 3.4:
  [HttpFoundation] fix registration of session proxies
  failing test to reproduce session problem
  [HttpFoundation] fix session tracking counter
2018-06-28 08:35:12 +02:00
Nicolas Grekas
b9a3c870d9 bug #27714 [HttpFoundation] fix session tracking counter (nicolas-grekas, dmaicher)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] fix session tracking counter

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

As just discussed with @nicolas-grekas I found this issue today while upgrading my app to 3.4.12. Somehow its not possible anymore to set caching headers correctly since this commit: 146e01cb44 (diff-5350dc763df30ada9d00563c115f6652)

Commits
-------

89ed756462 failing test to reproduce session problem
26fc4e683f [HttpFoundation] fix session tracking counter
2018-06-28 08:32:50 +02:00
Cyril PASCAL
426fb45cfb [Routing] Disallow object usage inside Route 2018-06-28 08:30:33 +02:00
Nicolas Grekas
3f4644b2f1 bug #27736 [Routing] fix too much greediness in host-matching regex (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[Routing] fix too much greediness in host-matching regex

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

Commits
-------

e16b3023c0 [Routing] fix too much greediness in host-matching regex
2018-06-28 08:27:37 +02:00
Bonfante
8e0acfc2db [HttpFoundation] missing namespace for RedisProxy 2018-06-28 08:23:50 +02:00
Nicolas Grekas
e16b3023c0 [Routing] fix too much greediness in host-matching regex 2018-06-28 07:55:37 +02:00
Nicolas Grekas
80b0739fc2 [HttpKernel][FrameworkBundle] Turn HTTP exceptions to HTTP status codes by default 2018-06-28 07:28:35 +02:00
Nicolas Grekas
5ed40c095b [HttpFoundation] fix registration of session proxies 2018-06-28 07:25:33 +02:00
Nicolas Grekas
0c57f00ccd Merge branch '4.1'
* 4.1:
  Bump ext-mongodb to 1.5 on Travis
  Redesign the Debug error page in prod
  [DI] fix dumping deprecated service in yaml
  [Serializer] CsvEncoder::AS_COLLECTION_KEY constant
  bumped Symfony version to 4.1.2
  updated VERSION for 4.1.1
  updated CHANGELOG for 4.1.1
  bumped Symfony version to 4.0.13
  updated VERSION for 4.0.12
  updated CHANGELOG for 4.0.12
  bumped Symfony version to 3.4.13
  updated VERSION for 3.4.12
  updated CHANGELOG for 3.4.12
  bumped Symfony version to 2.8.43
  updated VERSION for 2.8.42
  update CONTRIBUTORS for 2.8.42
  updated CHANGELOG for 2.8.42
2018-06-27 23:06:44 +02:00
Nicolas Grekas
cd94ef22bf Merge branch '4.0' into 4.1
* 4.0:
  Bump ext-mongodb to 1.5 on Travis
  Redesign the Debug error page in prod
  [DI] fix dumping deprecated service in yaml
  bumped Symfony version to 4.0.13
  updated VERSION for 4.0.12
  updated CHANGELOG for 4.0.12
  bumped Symfony version to 3.4.13
  updated VERSION for 3.4.12
  updated CHANGELOG for 3.4.12
  bumped Symfony version to 2.8.43
  updated VERSION for 2.8.42
  update CONTRIBUTORS for 2.8.42
  updated CHANGELOG for 2.8.42
2018-06-27 23:05:46 +02:00
Nicolas Grekas
cbfb7a7495 Merge branch '3.4' into 4.0
* 3.4:
  Bump ext-mongodb to 1.5 on Travis
  Redesign the Debug error page in prod
  [DI] fix dumping deprecated service in yaml
  bumped Symfony version to 3.4.13
  updated VERSION for 3.4.12
  updated CHANGELOG for 3.4.12
  bumped Symfony version to 2.8.43
  updated VERSION for 2.8.42
  update CONTRIBUTORS for 2.8.42
  updated CHANGELOG for 2.8.42
2018-06-27 23:04:32 +02:00
David Maicher
89ed756462 failing test to reproduce session problem 2018-06-27 13:46:59 +02:00
Nicolas Grekas
26fc4e683f [HttpFoundation] fix session tracking counter 2018-06-27 13:36:49 +02:00
Fabien Potencier
0252a00311 feature #27499 Improved an error message related to controllers (javiereguiluz)
This PR was squashed before being merged into the 4.2-dev branch (closes #27499).

Discussion
----------

Improved an error message related to controllers

| 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 proposal is irrelevant for experienced users but it may be useful for newcomers. After having delivered several introductory Symfony training, I can say that when someone adds `return "some string...";` in their controller, the error message is confusing:

![before](https://user-images.githubusercontent.com/73419/40959468-0faf790a-689d-11e8-9ce1-f6e0caf4b113.png)

Maybe we can reword it a bit? (I'm open for suggestions to improve the error message)

![after](https://user-images.githubusercontent.com/73419/40959505-29747070-689d-11e8-834e-92bf18760469.png)

Commits
-------

7510c3a335 Improved an error message related to controllers
2018-06-27 11:26:40 +02:00
Javier Eguiluz
7510c3a335 Improved an error message related to controllers 2018-06-27 11:25:38 +02:00
Fabien Potencier
1a3d445ec5 feature #26300 [PropertyInfo] Implement "Collection" types in PhpDocExtractor (popy-dev)
This PR was squashed before being merged into the 4.2-dev branch (closes #26300).

Discussion
----------

[PropertyInfo] Implement "Collection" types in PhpDocExtractor

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

Here's a proposition of implementation of my feature request #26299 :
I added few tests covering the requested feature, and I had to change a few things in the ```Symfony\Component\PropertyInfo\Util\PhpDocTypeHelper``` class (createType no longer gets a string, but a ```phpDocumentor\Reflection\Type``` instance) to be able to detect properly Collections and their subtypes.

Of course a simpler implementation is possible, without changing the PhpDocTypeHelper internal behaviour, by matching the input string against ```/^([^>]+)</``` and extracting the classname alone.

Commits
-------

12bafe46d0 [PropertyInfo] Implement \"Collection\" types in PhpDocExtractor
2018-06-26 18:34:19 +02:00
Pierre Dudoret
12bafe46d0 [PropertyInfo] Implement \"Collection\" types in PhpDocExtractor 2018-06-26 18:34:11 +02:00
Javier Eguiluz
7b9b1b9022 Redesign the Debug error page in prod 2018-06-26 10:45:54 +02:00
Nicolas Grekas
3d8490e59c Merge branch '2.8' into 3.4
* 2.8:
  [DI] fix dumping deprecated service in yaml
  bumped Symfony version to 2.8.43
  updated VERSION for 2.8.42
  update CONTRIBUTORS for 2.8.42
  updated CHANGELOG for 2.8.42
2018-06-26 10:26:17 +02:00
Nicolas Grekas
411be25aba [DI] fix dumping deprecated service in yaml 2018-06-26 10:00:00 +02:00
Christian Flothmann
05d4bcb987 fix handling of empty DI extension configs 2018-06-26 09:48:43 +02:00
Christian Flothmann
251e684fe6 add conflict for non-compatible TwigBridge version 2018-06-26 09:38:32 +02:00
Fabien Potencier
2b9c142f07 feature #26946 [WebProfilerBundle] Display uploaded files in the profiler (javiereguiluz)
This PR was squashed before being merged into the 4.2-dev branch (closes #26946).

Discussion
----------

[WebProfilerBundle] Display uploaded files in the profiler

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

![profiler_files](https://user-images.githubusercontent.com/73419/38807087-ac1e9bac-417b-11e8-99e0-317b437c986e.png)

Note: I wanted to use the VarDumper to display the table information (as we do in the rest of tables) but I had lots of problems and I just wanted to create a proof of concept for the feature to see if we like it.

Commits
-------

3f6f75bc12 [WebProfilerBundle] Display uploaded files in the profiler
2018-06-25 19:10:15 +02:00
Javier Eguiluz
3f6f75bc12 [WebProfilerBundle] Display uploaded files in the profiler 2018-06-25 19:10:04 +02:00
Fabien Potencier
21a3439a29 feature #27476 [Config] deprecate tree builders without root nodes (xabbuh)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Config] deprecate tree builders without root nodes

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

While reviewing #27472 I wondered if we really need support config trees without a root node. If we did not support it, users wouldn't create pseudo configuration classes when they were actually not needed.

Commits
-------

c2ce15301c deprecate tree builders without root nodes
2018-06-25 19:06:32 +02:00
Fabien Potencier
d871473ef2 feature #27586 [PropertyAccess] Add Property Path to Exception Message (rodnaph)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[PropertyAccess] Add Property Path to Exception Message

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

When an exception is thrown writing a property it is not currently obvious which path is at fault (eg. `Expected argument of type "%s", "%s" given` - but where?). This patch appends the current property path to the exception so it is clear which path caused the error (eg. `Expected argument of type "%s", "%s" given at property path "foo.bar"`)

Commits
-------

473a025643 add property path to exception message when error writing property
2018-06-25 18:57:23 +02:00
Maxime Steinhausser
660a456d6f [Serializer] CsvEncoder::AS_COLLECTION_KEY constant 2018-06-25 18:22:54 +02:00
Fabien Potencier
e32b9650cb bumped Symfony version to 4.1.2 2018-06-25 15:32:41 +02:00
Fabien Potencier
c02e5001ba updated VERSION for 4.1.1 2018-06-25 15:06:45 +02:00
Fabien Potencier
54bca19bae bumped Symfony version to 4.0.13 2018-06-25 15:04:35 +02:00
Fabien Potencier
8984efc1ac updated VERSION for 4.0.12 2018-06-25 15:02:08 +02:00
Fabien Potencier
2a2a9d89c8 bumped Symfony version to 3.4.13 2018-06-25 15:00:40 +02:00
Fabien Potencier
88bb4c2e98 updated VERSION for 3.4.12 2018-06-25 14:29:19 +02:00
Fabien Potencier
d59f210d43 bumped Symfony version to 2.8.43 2018-06-25 14:28:20 +02:00
Fabien Potencier
c821f1ae50 updated VERSION for 2.8.42 2018-06-25 14:01:56 +02:00
Nicolas Grekas
5fe78a33d8 Revert "minor #27609 Remove direct dependencies on doctrine/common (Majkl578)"
This reverts commit 92c37b9711, reversing
changes made to bc8d4f627e.
2018-06-25 13:45:21 +02:00
Nicolas Grekas
0cfbed1bbb Merge branch '4.0' into 4.1
* 4.0:
  [DoctrineBridge] blacklist doctrine/common@dev
2018-06-25 13:31:22 +02:00
Nicolas Grekas
765b402851 Merge branch '3.4' into 4.0
* 3.4:
  [DoctrineBridge] blacklist doctrine/common@dev
2018-06-25 13:30:59 +02:00
Nicolas Grekas
a22de07c30 [DoctrineBridge] blacklist doctrine/common@dev 2018-06-25 13:26:49 +02:00
Fabien Potencier
7b6ad74fa2 Merge branch '4.1'
* 4.1:
  [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
  Add note about changed form processing when using PUT requests
  [TwigBundle] bump lowest deps to fix issue with "double-colon" controller service refs
  [SecurityBundle] Dont throw if "security.http_utils" is not found
  [Di] Fix undefined variable found by Php Inspections (EA Ultimate)
  [DI] Cleanup unused service_subscriber.locator tag
  [DI] Resolve env placeholder in logs
  The debug class loader is always loaded by Debug::enable().
  [Intl] Update ICU data to 62.1
2018-06-25 13:13:38 +02:00
Fabien Potencier
8c687c6401 Merge branch '4.0' into 4.1
* 4.0:
  [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
  Add note about changed form processing when using PUT requests
  [SecurityBundle] Dont throw if "security.http_utils" is not found
  [Di] Fix undefined variable found by Php Inspections (EA Ultimate)
  [DI] Cleanup unused service_subscriber.locator tag
  [DI] Resolve env placeholder in logs
  The debug class loader is always loaded by Debug::enable().
  [Intl] Update ICU data to 62.1
2018-06-25 13:12:43 +02:00
Fabien Potencier
b626ee9af5 Merge branch '3.4' into 4.0
* 3.4:
  [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
  Add note about changed form processing when using PUT requests
  [SecurityBundle] Dont throw if "security.http_utils" is not found
  [Di] Fix undefined variable found by Php Inspections (EA Ultimate)
  [DI] Cleanup unused service_subscriber.locator tag
  [DI] Resolve env placeholder in logs
  The debug class loader is always loaded by Debug::enable().
  [Intl] Update ICU data to 62.1
2018-06-25 13:12:25 +02:00
Fabien Potencier
1bea76aed9 Merge branch '2.8' into 3.4
* 2.8:
  Add note about changed form processing when using PUT requests
  The debug class loader is always loaded by Debug::enable().
  [Intl] Update ICU data to 62.1
2018-06-25 13:10:40 +02:00
Fabien Potencier
76d81b98f2 feature #27699 Redesigned the default error page in production (javiereguiluz)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Redesigned the default error page in production

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

This continues the work done in #27071.

Before/After comparison:

![before-after-prod-error-pages](https://user-images.githubusercontent.com/73419/41844084-6e132208-786f-11e8-97c9-53602395e231.png)

Commits
-------

1df8b3e741 Redesigned the default error page in production
2018-06-25 13:09:22 +02:00
Fabien Potencier
2d29e2d427 bug #27626 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled (thewilkybarkid)
This PR was squashed before being merged into the 3.4 branch (closes #27626).

Discussion
----------

[TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled

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

While adding https://github.com/elifesciences/journal/pull/990 I was a bit confused why the `preload()` Twig function didn't work initially. Turns out the WebLink component is disabled by default if using the full stack, but the Twig extension is always enabled.

This only adds the Twig extension if the component is enabled, and shows a friendly error message if it's not.

Commits
-------

cccb66f4c6 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
2018-06-25 13:07:27 +02:00
Chris Wilkinson
cccb66f4c6 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled 2018-06-25 13:07:14 +02:00
Fabien Potencier
0dcf11102b feature #27655 [Translation] Added support for translation files with other filename patterns (javiereguiluz)
This PR was squashed before being merged into the 4.2-dev branch (closes #27655).

Discussion
----------

[Translation] Added support for translation files with other filename patterns

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

This implements the #27644 feature request in case we accept it.

My vote is 👍 because the changes required are tiny and the resulting code is even more robust thanks to the new `preg_match()` call.

Commits
-------

0ee912dbd8 [Translation] Added support for translation files with other filename patterns
2018-06-25 12:22:58 +02:00
Javier Eguiluz
0ee912dbd8 [Translation] Added support for translation files with other filename patterns 2018-06-25 12:22:51 +02:00
Fabien Potencier
a1eb6491aa added missing CHANGELOG 2018-06-25 11:52:54 +02:00
Nicolas Grekas
f75723f38a [TwigBundle] bump lowest deps to fix issue with "double-colon" controller service refs 2018-06-25 11:52:53 +02:00
Fabien Potencier
53a39b791e feature #27580 [Form] Add ability to clear form errors (colinodell)
This PR was squashed before being merged into the 4.2-dev branch (closes #27580).

Discussion
----------

[Form] Add ability to clear form errors

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

This PR adds the ability to manually clear form errors, thus improving the DX issue reported in #14060.

Unlike my original approach in #14233 and #27571 which break BC, this adds a new `ClearableErrorInterface` which `Form` implements.  (`Button` does not implement it because buttons can't have errors.)

Commits
-------

9eb755c07f [Form] Add ability to clear form errors
2018-06-25 11:51:57 +02:00
Colin O'Dell
9eb755c07f [Form] Add ability to clear form errors 2018-06-25 11:51:51 +02:00
Nicolas Grekas
db88330448 [SecurityBundle] Dont throw if "security.http_utils" is not found 2018-06-25 11:35:14 +02:00
Vladimir Reznichenko
a3a9e2ec19 [Di] Fix undefined variable found by Php Inspections (EA Ultimate) 2018-06-25 10:36:56 +02:00
Javier Eguiluz
1df8b3e741 Redesigned the default error page in production 2018-06-25 09:13:42 +02:00
Fabien Potencier
abe49ef9f4 minor #27679 [Intl] Update ICU data to 62.1 (jakzal)
This PR was merged into the 2.8 branch.

Discussion
----------

[Intl] Update ICU data to 62.1

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| 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 | -
| License       | MIT
| Doc PR        | -

It's this time of the year again to update ICU data. http://site.icu-project.org/download/62

Not many actual changes this time. Few new scripts added and some metadata for the VEF currency.

Commits
-------

5f2e6c2f12 [Intl] Update ICU data to 62.1
2018-06-25 09:09:10 +02:00
Fabien Potencier
86361e58a6 feature #27247 [Form] Deprecate searchAndRenderBlock returning empty string (ostrolucky)
This PR was squashed before being merged into the 4.2-dev branch (closes #27247).

Discussion
----------

[Form] Deprecate `searchAndRenderBlock` returning empty string

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

I would like to remove this silent behavior, because it's confusing

Commits
-------

02f2f0ed39 [Form] Deprecate `searchAndRenderBlock` returning empty string
2018-06-25 08:48:10 +02:00
Gabriel Ostrolucký
02f2f0ed39 [Form] Deprecate searchAndRenderBlock returning empty string 2018-06-25 08:47:55 +02:00
Nicolas Grekas
c871857a47 Merge branch '4.1'
* 4.1:
  [VarDumper] Fix dumping by splitting Server/Connection out of Dumper/ServerDumper
  [HttpKernel] fix argument's error messages in ServiceValueResolver
  [DI] Avoid leaking unused env placeholders
2018-06-24 10:10:38 +02:00
Nicolas Grekas
fd3571d172 minor #27691 [DI] Cleanup unused service_subscriber.locator tag (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Cleanup unused service_subscriber.locator tag

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes-ish
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Cleanup internal DI tag `container.service_subscriber.locator` so it's _not_ reported as unused tag, i.e.:

```
Tag "container.service_subscriber.locator" was defined on service(s) "App\Controller\MainController", "translation.warmer", "router.cache_warmer", "twig.cache_warmer", "twig.template_cache_warmer",
but was never used. Did you mean "container.service_subscriber", "container.service_locator"?
```

Commits
-------

8e060fa45d [DI] Cleanup unused service_subscriber.locator tag
2018-06-24 09:58:37 +02:00
Nicolas Grekas
ac74c9abdd bug #27687 [HttpKernel] fix argument's error messages in ServiceValueResolver (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[HttpKernel] fix argument's error messages in ServiceValueResolver

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

Forgotten while renamed to hidden services.

Commits
-------

aa50ffcd0e [HttpKernel] fix argument's error messages in ServiceValueResolver
2018-06-24 09:57:17 +02:00
Nicolas Grekas
4660857ffa bug #27614 [VarDumper] Fix dumping by splitting Server/Connection out of Dumper/ServerDumper (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[VarDumper] Fix dumping by splitting Server/Connection out of Dumper/ServerDumper

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

Right now, the `dump()` function is broken on 4.1 as soon as one sets up a `dump_destination` for the dump server (as done by default by our Flex recipe). #27397 describes the issue and proposes a tentative fix. Yet, I think the issue is deeper and exists at the design level. Writting to the server should not happen in a `DumperInterface`, that's not its semantics. Instead, I propose a `Connection` object that will allow `DumpDataCollector` to have all the info it requires to do everything on its own.

My bad for not spotting this at the review stage.

Commits
-------

1435d677be [VarDumper] Fix dumping by splitting Server/Connection out of Dumper/ServerDumper
2018-06-24 09:55:51 +02:00
Roland Franssen
8e060fa45d [DI] Cleanup unused service_subscriber.locator tag 2018-06-23 15:02:32 +02:00
Roland Franssen
b58eb0117f [DI] Resolve env placeholder in logs 2018-06-23 14:49:00 +02:00
Nicolas Grekas
1435d677be [VarDumper] Fix dumping by splitting Server/Connection out of Dumper/ServerDumper 2018-06-23 14:23:56 +02:00
Nicolas Grekas
aa50ffcd0e [HttpKernel] fix argument's error messages in ServiceValueResolver 2018-06-23 09:14:34 +02:00
Nicolas Grekas
6285e68fa6 [DI] fix dumping errored definitions 2018-06-23 09:13:02 +02:00
Alexander M. Turek
d1f41601f4 The debug class loader is always loaded by Debug::enable(). 2018-06-22 17:01:26 +02:00
Roland Franssen
41f8494722 [DI] Avoid leaking unused env placeholders 2018-06-22 13:40:15 +02:00
Nicolas Grekas
72bf72aa6a Merge branch '4.1'
* 4.1:
  [minor] SCA
  [Serializer] Minor tweaks for a67b650f12
  allow_extra_attributes does not throw an exception as documented
  [Cache] fix visibility of RedisTrait::init()
  [Serializer] Updates DocBlock to a mixed param type
2018-06-22 10:59:57 +02:00
Nicolas Grekas
671e412417 Merge branch '4.0' into 4.1
* 4.0:
  [minor] SCA
  [Serializer] Minor tweaks for a67b650f12
  allow_extra_attributes does not throw an exception as documented
  [Cache] fix visibility of RedisTrait::init()
  [Serializer] Updates DocBlock to a mixed param type
2018-06-22 10:59:39 +02:00
Nicolas Grekas
b4a58e29d3 Merge branch '3.4' into 4.0
* 3.4:
  [Serializer] Minor tweaks for a67b650f12
  allow_extra_attributes does not throw an exception as documented
  [Cache] fix visibility of RedisTrait::init()
  [Serializer] Updates DocBlock to a mixed param type
2018-06-22 10:59:07 +02:00
Nicolas Grekas
0e0cf1467a Merge branch '2.8' into 3.4
* 2.8:
  [Serializer] Updates DocBlock to a mixed param type
2018-06-22 10:58:39 +02:00
Jakub Zalas
5f2e6c2f12
[Intl] Update ICU data to 62.1 2018-06-22 07:57:03 +01:00
Fabien Potencier
27909450c1 minor #27676 [minor] SCA (kalessil)
This PR was squashed before being merged into the 4.0 branch (closes #27676).

Discussion
----------

[minor] SCA

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

Found some leftovers after introducing parameter types in 4.0.

Commits
-------

afeb89fa06 [minor] SCA
2018-06-22 08:03:22 +02:00
Vladimir Reznichenko
afeb89fa06 [minor] SCA 2018-06-22 08:03:15 +02:00
Maxime Steinhausser
bdcd0ba569 [Serializer] Minor tweaks for a67b650f12 2018-06-21 22:04:03 +02:00
Andrew Berry
a67b650f12 allow_extra_attributes does not throw an exception as documented 2018-06-21 21:59:49 +02:00
Fabien Potencier
9f6af974fa minor #27663 [Serializer] Updates DocBlock to a mixed param type (andrewnclark)
This PR was merged into the 2.8 branch.

Discussion
----------

[Serializer] Updates DocBlock to a mixed param type

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      |  Yes
| New feature?  |  No
| BC breaks?    | No
| Deprecations? | Non added.
| Tests pass?   | Yes , no new tests added.
| Fixed tickets | #27457
| License       | MIT

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

The JSON serializers make use of the JsonSerializable interface and return arrays to the NormalizerInterface. This PR updates the DocBlock to reflect that.

Moving towards PHP 7.2 and the use of object type-hints would require changes to the [JsonSerializableNormalizer@L41](92c37b9711/src/Symfony/Component/Serializer/Normalizer/JsonSerializableNormalizer.php (L41)) at a minimum.

Truly not much of a PR I'm afraid!

Commits
-------

dca9ff529a [Serializer] Updates DocBlock to a mixed param type
2018-06-21 18:45:44 +02:00
Nicolas Grekas
3bd9a6b97e [Cache] fix visibility of RedisTrait::init() 2018-06-21 14:16:06 +02:00
Nicolas Grekas
6064cfe016 bug #27670 [Cache] Fix locking on Solaris (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Fix locking on Solaris

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

As reported on #27668, the descriptor must be writeable on Solaris to get an exclusive lock.

Commits
-------

43da583267 [Cache] Fix locking on Solaris
2018-06-21 13:19:41 +02:00
Nicolas Grekas
31fc855e22 Merge branch '4.1'
* 4.1:
  [Lock] use 'r+' for fopen (fixes issue on Solaris)
  [HttpKernel] fix test compat with PHP 5.3
  fix handling of nested Error instances
  fix file lock on SunOS
  Ignore keepQueryParams attribute when generating route redirect.
  [Cache] more granular handling of exceptions in AbstractTrait::clear()
  change `evaluate()` docblock return type from string to mixed
  Set serialize_precision explicitly to avoid fancy float rounding
2018-06-21 13:18:49 +02:00
Nicolas Grekas
f83316707f bug #27664 [FrameworkBundle] Ignore keepQueryParams attribute when generating route redirect (vudaltsov)
This PR was merged into the 4.1 branch.

Discussion
----------

[FrameworkBundle] Ignore keepQueryParams attribute when generating route redirect

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

Prevents keepQueryParams from appearing in query.

Commits
-------

1e10475d88 Ignore keepQueryParams attribute when generating route redirect.
2018-06-21 13:16:32 +02:00
Nicolas Grekas
e1f2c3c058 Merge branch '4.0' into 4.1
* 4.0:
  [Lock] use 'r+' for fopen (fixes issue on Solaris)
  [HttpKernel] fix test compat with PHP 5.3
  fix handling of nested Error instances
  fix file lock on SunOS
  [Cache] more granular handling of exceptions in AbstractTrait::clear()
  change `evaluate()` docblock return type from string to mixed
  Set serialize_precision explicitly to avoid fancy float rounding
2018-06-21 13:15:46 +02:00
Nicolas Grekas
26535bbe87 Merge branch '3.4' into 4.0
* 3.4:
  [Lock] use 'r+' for fopen (fixes issue on Solaris)
  [HttpKernel] fix test compat with PHP 5.3
  fix handling of nested Error instances
  fix file lock on SunOS
  [Cache] more granular handling of exceptions in AbstractTrait::clear()
  change `evaluate()` docblock return type from string to mixed
  Set serialize_precision explicitly to avoid fancy float rounding
2018-06-21 13:14:29 +02:00
Nicolas Grekas
df0dba6cdf bug #27668 [Lock] use 'r+' for fopen (fixes issue on Solaris) (fritzmg)
This PR was squashed before being merged into the 3.4 branch (closes #27668).

Discussion
----------

[Lock] use 'r+' for fopen (fixes issue on Solaris)

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (also applicable to _LockHandler_ in 2.8 and 3.3)
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes [1]
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

We discovered a curious case on a specific hosting environment: the `FlockStorage` (or `LockHandler` in previous Symfony versions) could never get a file lock on **existing files**. So if you run a script for the first time and the lock file did not exist yet, the `FlockStorage` could get a lock on that file just fine. However on the second and subsequent runs, `FlockStorage` could _never_ get a file lock anymore. You can follow the discussion [here](https://github.com/contao/core-bundle/issues/1551) (if you speak German).

We have been using this little script to confirm the issue on the hosting environment:
```php
$fileName = __DIR__ . '/file.lock';

if (!$handle = @fopen($fileName, 'r')) {
    $handle = fopen($fileName, 'x');
}

if (!$handle) {
    echo "Could not open $fileName\n";
    exit;
}

if (flock($handle, LOCK_EX | LOCK_NB)) {
    echo "Got a lock on $fileName\n";
    flock($handle, LOCK_UN | LOCK_NB);
} else {
    echo "Could not get a lock on $fileName\n";
}
```
Whenever `file.lock` already existed prior to running the script, a lock could not be made.

After contacting the hosting provider's support on this they confirmed the issue and told us they are using **Solaris** instead of a Linux environment. And this is supposedly why it does not work. Instead you have to use `'r+'` instead of `'r'` for `fopen`.

I was able to confirm that changing from `'r'` to `'r+'` fixes the issue. However I am wondering who's actually at fault here. Is it Solaris? PHP? The compiled PHP version under Solaris? The hosting provider's operating system configuration?

### System information
```
uname -a
SunOS vlek 5.11 11.3 i86pc i386 i86pc Solaris
```
```
phpinfo:
SunOS localhost 5.10 Generic_150401-49 i86pc
```
```
php -v
PHP 7.2.5 (cli) (built: May  4 2018 12:57:43) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
```

### Footnotes

[1] Previously one failed test on the first run and two failing tests on the second run with the proposed changes:
```
1) Symfony\Component\Lock\Tests\Store\FlockStoreTest::testSaveSanitizeName
Symfony\Component\Lock\Exception\LockStorageException: fopen(C:\Users\[…]\AppData\Local\Temp/sf.-php-echo-hello-word-.Sz2dDSf.lock)
: failed to open stream: Permission denied
```
```
2) Symfony\Component\Lock\Tests\Store\FlockStoreTest::testSaveWithDifferentKeysOnSameResources
Symfony\Component\Lock\Exception\LockStorageException: fopen(C:\Users\[…]\AppData\Local\Temp/sf.Symfony-Component-Lock-Tests-Store-
AbstractStoreTest-testSaveWithDifferentKeysOnSameResources5b2b5f00872538.64807920.2u9bH+a.lock): failed to open stream: Permission denied
```
The latter failed both on the first run and on the second run.

After the [proposed changes](https://github.com/symfony/symfony/pull/27668#discussion_r197054198) from @nicolas-grekas everything works fine 👍

Commits
-------

9c9ae7d9c9 [Lock] use 'r+' for fopen (fixes issue on Solaris)
2018-06-21 13:12:36 +02:00
Fritz Michael Gschwantner
9c9ae7d9c9 [Lock] use 'r+' for fopen (fixes issue on Solaris) 2018-06-21 13:12:28 +02:00
Nicolas Grekas
7090495250 Merge branch '2.8' into 3.4
* 2.8:
  [HttpKernel] fix test compat with PHP 5.3
  fix file lock on SunOS
  change `evaluate()` docblock return type from string to mixed
  Set serialize_precision explicitly to avoid fancy float rounding
2018-06-21 13:10:19 +02:00
Nicolas Grekas
f63579d360 bug #27669 [Filesystem] fix file lock on SunOS (fritzmg)
This PR was merged into the 2.8 branch.

Discussion
----------

[Filesystem] fix file lock on SunOS

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

See https://github.com/symfony/symfony/pull/27668

Commits
-------

7adb641d7c fix file lock on SunOS
2018-06-21 13:08:28 +02:00
Nicolas Grekas
749410a224 [HttpKernel] fix test compat with PHP 5.3 2018-06-21 13:07:36 +02:00
Andrew Clark
dca9ff529a [Serializer] Updates DocBlock to a mixed param type 2018-06-21 12:57:13 +02:00
Christian Flothmann
a6696d03b1 fix handling of nested Error instances 2018-06-21 12:30:28 +02:00
fritzmg
7adb641d7c fix file lock on SunOS 2018-06-21 11:24:14 +02:00
Nicolas Grekas
43da583267 [Cache] Fix locking on Solaris 2018-06-21 11:23:42 +02:00
Valentin
1e10475d88 Ignore keepQueryParams attribute when generating route redirect. 2018-06-21 00:41:56 +03:00
Nicolas Grekas
ff0de67519 [Cache] more granular handling of exceptions in AbstractTrait::clear() 2018-06-20 22:30:04 +02:00
Fabien Potencier
92c37b9711 minor #27609 Remove direct dependencies on doctrine/common (Majkl578)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Remove direct dependencies on doctrine/common

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

Doctrine has recently separated multiple components from doctrine/common:
* [doctrine/event-manager](https://github.com/doctrine/event-manager) [[release notes](https://github.com/doctrine/event-manager/releases/tag/v1.0.0) | [split PR](https://github.com/doctrine/common/pull/842)]
* [doctrine/persistence](https://github.com/doctrine/persistence) [[release notes](https://github.com/doctrine/persistence/releases/tag/v1.0.0) | [split PR](https://github.com/doctrine/common/pull/845)]
* [doctrine/reflection](https://github.com/doctrine/reflection) [[release notes](https://github.com/doctrine/reflection/releases/tag/v1.0.0) | [split PR](https://github.com/doctrine/common/pull/845)]

All of the packages are 100% backward compatible with their counterparts in Common 2.8.

This is a major step to slowly start with [phasing out doctrine/common package](https://github.com/doctrine/common/issues/826) before ORM 3.0 / DBAL 3.0 / ODM 3.0.
Common 2.9.0 will also be composed from these new packages.

Most of the remaining parts in doctrine/common are likely to be deprecated (or already are), please see & discuss in [the PR over in doctrine/common repository](https://github.com/doctrine/common/pull/845).

This PR therefore aims to remove the direct doctrine/common dependency from Symfony, replacing it by specific Doctrine components.

Commits
-------

b0fa398187 Remove direct dependencies on doctrine/common
2018-06-20 19:56:31 +02:00
Fabien Potencier
bc8d4f627e feature #27646 [Cache] added support for phpredis 4 compression and tcp_keepalive options (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] added support for phpredis 4 `compression` and `tcp_keepalive` options

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

See https://pecl.php.net/package-changelog.php?package=redis

Commits
-------

2ff02cd333 [Cache] added support for phpredis 4 `compression` and `tcp_keepalive` options
2018-06-20 19:52:00 +02:00
Fabien Potencier
1dac82a41a feature #27605 [DX] Log potential redirect loops caused by forced HTTPS (colinodell)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[DX] Log potential redirect loops caused by forced HTTPS

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

If the developer forgets/fails to set "trusted_proxies" properly, forcing the
https channel can cause infinite redirect loops. This change will hopefully
help them identify the problem faster.

See https://github.com/symfony/symfony/issues/27603

Commits
-------

53048cec6d Log potential redirect loops caused by forced HTTPS
2018-06-20 19:48:57 +02:00
jspee
2d26a556fd change evaluate() docblock return type from string to mixed 2018-06-20 19:39:05 +02:00
Fabien Potencier
1ff80e3b97 feature #27653 [Translation] Improved the performance of the lint:xliff command (javiereguiluz)
This PR was squashed before being merged into the 4.2-dev branch (closes #27653).

Discussion
----------

[Translation] Improved the performance of the lint:xliff command

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

As suggested by @stof I extracted the schema validation logic from XliffFileLoader to reuse it in the `lint:xliff` command. The validation is now instantaneous, so the command is blazing fast!

Commits
-------

e53bf5839b [Translation] Improved the performance of the lint:xliff command
2018-06-20 19:36:31 +02:00
Javier Eguiluz
e53bf5839b [Translation] Improved the performance of the lint:xliff command 2018-06-20 19:36:22 +02:00
Nicolas Grekas
e5059a0d7e minor #27637 Set serialize_precision explicitly to avoid fancy float rounding (Majkl578)
This PR was merged into the 2.8 branch.

Discussion
----------

Set serialize_precision explicitly to avoid fancy float rounding

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

This is fixing some of the test failures I was seeing locally due to increased `serialize_precision` INI setting:
```
2) Symfony\Component\HttpFoundation\Tests\JsonResponseTest::testConstructorWithSimpleTypes
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'0.1'
+'0.10000000000000001'

/www/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php:46

3) Symfony\Component\HttpFoundation\Tests\JsonResponseTest::testStaticCreateWithSimpleTypes
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'0.1'
+'0.10000000000000001'
```

The test assertions should not depend on externally configured PHP configuration.

Also default value for this option was changed multiple times: http://php.net/manual/en/ini.core.php#ini.serialize-precision
For compatibility reasons (with PHP <7.x) `-1` can't be used.

https://3v4l.org/HBNsT

HHVM doesn't seem to support this though, how to handle this?

Commits
-------

b5ee7c3ccd Set serialize_precision explicitly to avoid fancy float rounding
2018-06-20 14:43:58 +02:00
Nicolas Grekas
1abfb2ced6 Merge branch '4.1'
* 4.1:
  [Cache] Improve resiliency when calling doFetch() in AbstractTrait
  [Messenger] Fixed MessengerPass::guessHandledClasses return type
  Fixing GlobResource when inside phar archive
2018-06-20 13:16:05 +02:00
Nicolas Grekas
389fa4dc23 bug #27651 [Messenger] Fixed MessengerPass::guessHandledClasses return type (massimilianobraglia)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Fixed MessengerPass::guessHandledClasses return type

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

#27633 should have been merged to 4.1.

Commits
-------

d6b6e9658c [Messenger] Fixed MessengerPass::guessHandledClasses return type
2018-06-20 13:15:41 +02:00
Nicolas Grekas
20147fce57 Merge branch '4.0' into 4.1
* 4.0:
  [Cache] Improve resiliency when calling doFetch() in AbstractTrait
  Fixing GlobResource when inside phar archive
2018-06-20 13:15:17 +02:00
Nicolas Grekas
641ecbb74b Merge branch '3.4' into 4.0
* 3.4:
  [Cache] Improve resiliency when calling doFetch() in AbstractTrait
  Fixing GlobResource when inside phar archive
2018-06-20 13:15:04 +02:00
Nicolas Grekas
b61c8fcb77 bug #26845 [Config] Fixing GlobResource when inside phar archive (vworldat)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] Fixing GlobResource when inside phar archive

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes if old broken behavior counts as stable
| Deprecations? | no
| Tests pass?   | no tests yet
| Fixed tickets |
| License       | MIT
| Doc PR        | N/A

When packaging an Sf4 application as a PHAR archive using globs at various locations (`Kernel`, `services.yaml`) most glob files are not found because the `glob()` PHP method [does not support PHAR streams](https://stackoverflow.com/questions/8203188/unexpected-problems-with-php-phar).

Using the regex fallback instead when operating inside PHAR archives fixes the behavior for me.

## Examples:

`src/Kernel.php::configureContainer()`:

```php
$loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');
```

Expected behavior: `config/services.yaml` inside PHAR archive is found and parsed
Actual behavior: the file will not be loaded

`config/services.yaml` (hard-coded in Kernel without using glob pattern)

```yaml
    App\:
        resource: '../src/*'
        exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'
```

Expected behavior: service classes in `src/` will be found and auto-wired
Actual behavior: services are not auto-wired because the class files are not found

Commits
-------

e336ebeecf Fixing GlobResource when inside phar archive
2018-06-20 13:09:19 +02:00
Nicolas Grekas
b7ccf10de7 [Cache] Improve resiliency when calling doFetch() in AbstractTrait 2018-06-20 13:05:06 +02:00
Nicolas Grekas
683bbf9eaf Merge branch '4.1'
* 4.1:
  [Cache] Fix exception handling in AbstractTrait::clear()
  Revert "minor #27649 [Cache] fix Memcached tests (nicolas-grekas)"
2018-06-20 11:26:44 +02:00
Nicolas Grekas
a278c79c6e Merge branch '4.0' into 4.1
* 4.0:
  [Cache] Fix exception handling in AbstractTrait::clear()
  Revert "minor #27649 [Cache] fix Memcached tests (nicolas-grekas)"
2018-06-20 11:26:39 +02:00
Nicolas Grekas
6d26d9a5ae Merge branch '3.4' into 4.0
* 3.4:
  [Cache] Fix exception handling in AbstractTrait::clear()
  Revert "minor #27649 [Cache] fix Memcached tests (nicolas-grekas)"
2018-06-20 11:26:33 +02:00
Massimiliano Braglia
d6b6e9658c [Messenger] Fixed MessengerPass::guessHandledClasses return type 2018-06-20 12:25:27 +03:00
Nicolas Grekas
bef15cebca [Cache] Fix exception handling in AbstractTrait::clear() 2018-06-20 11:24:39 +02:00
Nicolas Grekas
bb644c1df8 Revert "minor #27649 [Cache] fix Memcached tests (nicolas-grekas)"
This reverts commit dc323f084c, reversing
changes made to 917b07a5c6.
2018-06-20 10:56:56 +02:00
Nicolas Grekas
2ff02cd333 [Cache] added support for phpredis 4 compression and tcp_keepalive options 2018-06-20 10:12:31 +02:00
Nicolas Grekas
d41385024f Merge branch '4.1'
* 4.1:
  [Cache] fix Memcached tests
2018-06-20 09:27:19 +02:00
Nicolas Grekas
f68e19468d Merge branch '4.0' into 4.1
* 4.0:
  [Cache] fix Memcached tests
2018-06-20 09:27:12 +02:00
Nicolas Grekas
9b64e8bedf Merge branch '3.4' into 4.0
* 3.4:
  [Cache] fix Memcached tests
2018-06-20 09:27:05 +02:00
Nicolas Grekas
dc323f084c minor #27649 [Cache] fix Memcached tests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix Memcached tests

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

Clearing a memcached pool works only when versioning is enabled. Dunno why this has not be caught before, but it's making tests fail now.

Commits
-------

09ec9e7cce [Cache] fix Memcached tests
2018-06-20 09:26:50 +02:00
Nicolas Grekas
09ec9e7cce [Cache] fix Memcached tests 2018-06-20 09:02:04 +02:00
Nicolas Grekas
a5a91d318c Merge branch '4.1'
* 4.1:
  [HttpKernel] fix PHP 5.4 compat
  Fix surrogate not using original request
  [Finder] Update RealIteratorTestCase
  [Routing] remove unneeded dev dep on doctrine/common
  [minor] SCA
  [Validator] Remove BOM in some xlf files
  Ensure updateTimestamp returns a boolean
  Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
  [HttpKernel] fix session tracking in surrogate master requests
2018-06-19 23:38:29 +02:00
Nicolas Grekas
34acfe4bfb Merge branch '4.0' into 4.1
* 4.0:
  [HttpKernel] fix PHP 5.4 compat
  Fix surrogate not using original request
  [Finder] Update RealIteratorTestCase
  [Routing] remove unneeded dev dep on doctrine/common
  [minor] SCA
  [Validator] Remove BOM in some xlf files
  Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
  [HttpKernel] fix session tracking in surrogate master requests
2018-06-19 23:38:16 +02:00
Nicolas Grekas
b85f70e3bc Merge branch '3.4' into 4.0
* 3.4:
  [HttpKernel] fix PHP 5.4 compat
  Fix surrogate not using original request
  [Finder] Update RealIteratorTestCase
  [Routing] remove unneeded dev dep on doctrine/common
  [minor] SCA
  [Validator] Remove BOM in some xlf files
  Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
  [HttpKernel] fix session tracking in surrogate master requests
2018-06-19 22:54:48 +02:00
Nicolas Grekas
917b07a5c6 Merge branch '2.8' into 3.4
* 2.8:
  [HttpKernel] fix PHP 5.4 compat
  Fix surrogate not using original request
  [Finder] Update RealIteratorTestCase
  [Routing] remove unneeded dev dep on doctrine/common
  [Validator] Remove BOM in some xlf files
2018-06-19 22:52:10 +02:00
Nicolas Grekas
0f2b752138 [HttpKernel] fix PHP 5.4 compat 2018-06-19 22:37:28 +02:00
Nicolas Grekas
a4f5c6e2b6 minor #27643 [FrameworkBundle] Fixed tests added in #27611 (HeahDude)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Fixed tests added in #27611

| 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 | ~
| License       | MIT
| Doc PR        | ~

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

be97006c57 [FrameworkBundle] Fixed tests added in #27611
2018-06-19 22:33:37 +02:00
Jules Pietri
be97006c57 [FrameworkBundle] Fixed tests added in #27611 2018-06-19 19:13:47 +02:00
Colin O'Dell
53048cec6d Log potential redirect loops caused by forced HTTPS
If the developer forgets/fails to set "trusted_proxies" properly, forcing the
https channel can cause infinite redirect loops. This change will hopefully
help them identify the problem faster.

See https://github.com/symfony/symfony/issues/27603
2018-06-19 10:59:18 -04:00
Michael Moravec
b5ee7c3ccd
Set serialize_precision explicitly to avoid fancy float rounding 2018-06-19 16:38:49 +02:00
David Herrmann
e336ebeecf Fixing GlobResource when inside phar archive
When packaging an Sf4 application as a PHAR archive using globs at various locations (`Kernel`, `services.yaml`) most glob files are not found because the `glob()` PHP method [does not support PHAR streams](https://stackoverflow.com/questions/8203188/unexpected-problems-with-php-phar).

Using the regex fallback instead when operating inside PHAR archives fixes the behavior for me.
2018-06-19 16:02:58 +02:00
Nicolas Grekas
c4d972ac20 bug #27382 [Form] Fix error when rendering a DateIntervalType form with exactly 0 weeks (krixon)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Fix error when rendering a DateIntervalType form with exactly 0 weeks

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

Fixes the issue described in #27378

Commits
-------

dae704ad2f Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
2018-06-19 15:17:38 +02:00
Nicolas Grekas
4fde3bb4f3 feature #27421 CacheWarmerAggregate handle deprecations logs (ScullWM)
This PR was merged into the 4.2-dev branch.

Discussion
----------

CacheWarmerAggregate handle deprecations logs

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

Actually the Web Debug Toolbar warning you about the deprecation messages thrown during the container built (#21502).
Cache warmup can throw deprecated message without any persistance, it may cause issue like #27387
This PR reproduce the same job for the cache warmer, and so on, handle deprecated messages during the warmup of Twig, Translator, Validator, Security and all `kernel.cache_warmer` services.

Here are the point that may be improvable in this PR:

1.  Actually I've "duplicate" the callable used in the `set_error_handler` of the Kernel.
IMHO I think that Kernel and CacheWarmerAggregate have differents jobs and a trait may be a good solution to share this error handler setter without duplicating the code, but I'm a little bit lost about the repercussion of adding a Trait in the Kernel.

2. I've think about extending the `CacheWarmerAggregate` into a `DeprecatedLogHandlingCacheWarmerAggregate` to add the debug and containerClass argument, and declare it as the `cache_warmer` service only in debug mode (by declaring it in the DebugBundle/Resources/config/services.xml).

Commits
-------

f03b8bba9d CacheWarmerAggregate handle deprecations logs
2018-06-19 15:15:00 +02:00
Yanick Witschi
ab86f43d78 Fix surrogate not using original request 2018-06-19 15:13:16 +02:00
Nicolas Grekas
e9e6ec54af feature #27611 [FrameworkBundle][SecurityBundle] Moved security expression providers pass logic to SecurityBundle (HeahDude)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle][SecurityBundle] Moved security expression providers pass logic to SecurityBundle

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

Commits
-------

a8017be6ae [FrameworkBundle][SecurityBundle] Moved security expression providers pass logic to SecurityBundle
2018-06-19 15:04:04 +02:00
Jules Pietri
a8017be6ae [FrameworkBundle][SecurityBundle] Moved security expression providers pass logic to SecurityBundle 2018-06-19 15:02:06 +02:00
Nicolas Grekas
76d3589a44 feature #27277 [OptionsResolver] Introduce ability to deprecate options, allowed types and values (yceruto)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[OptionsResolver] Introduce ability to deprecate options, allowed types and values

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

**Deprecating an option**
```php
$resolver = (new OptionsResolver())
    ->setDefined(['foo', 'bar'])
    ->setDeprecated('foo')
;
$resolver->resolve(['foo' => 'baz']); // PHP Deprecated: The option "foo" is deprecated.
```
With custom message:
```php
$resolver = (new OptionsResolver())
    ->setDefined('foo')
    ->setDefault('bar', function (Options $options) {
        return $options['foo'];
    })
    ->setDeprecated('foo', 'The option "foo" is deprecated, use "bar" option instead.')
;
$resolver->resolve(['foo' => 'baz']); // PHP Deprecated: The option "foo" is deprecated, use "bar" option instead.
$resolver->resolve(['bar' => 'baz']); // OK.
```
**Deprecating allowed types**
```php
$resolver = (new OptionsResolver())
    ->setDefault('type', null)
    ->setAllowedTypes('type', ['null', 'string', FormTypeInterface::class])
    ->setDeprecated('type', function ($value) {
        if ($value instanceof FormTypeInterface) {
            return sprintf('Passing an instance of "%s" to option "type" is deprecated, pass its FQCN instead.', FormTypeInterface::class);
        }
    })
;
$resolver->resolve(['type' => new ChoiceType()]); // PHP Deprecated: Passing an instance of "Symfony\Component\Form\FormTypeInterface" to option "type" is deprecated, pass its FQCN instead.
$resolver->resolve(['type' => ChoiceType::class]); // OK.
```
The closure is invoked when `resolve()` is called. The closure must return a string (the deprecation message) or an empty string to ignore the option deprecation.

Multiple types and normalizer:
```php
$resolver = (new OptionsResolver())
    ->setDefault('percent', 0.0)
    ->setAllowedTypes('percent', ['null', 'int', 'float'])
    ->setDeprecated('percent', function ($value) {
        if (null === $value) {
            return 'Passing "null" to option "percent" is deprecated, pass a float number instead.';
        }

        if (is_int($value)) {
            return sprintf('Passing an integer "%d" to option "percent" is deprecated, pass a float number instead.', $value);
        }
    })
    ->setNormalizer('percent', function (Options $options, $value) {
        return (float) $value;
    })
;
$resolver->resolve(['percent' => null]); // PHP Deprecated: Passing "null" to option "percent" is deprecated, pass a float number instead.
$resolver->resolve(['percent' => 20]); // PHP Deprecated: Passing an integer "20" to option "percent" is deprecated, pass a float number instead.
$resolver->resolve(['percent' => 20.0]); // OK.
```
The parameter passed to the closure is the value of the option after validating it and before normalizing it.

**Deprecating allowed values**
```php
$resolver = (new OptionsResolver())
    ->setDefault('percent', 0.0)
    ->setAllowedTypes('percent', 'float')
    ->setDeprecated('percent', function ($value) {
        if ($value < 0) {
            return 'Passing a number less than 0 to option "percent" is deprecated.';
        }
    })
;
$resolver->resolve(['percent' => -50.0]); // PHP Deprecated: Passing a number less than 0 to option "percent" is deprecated.
```

Commits
-------

f8746ce8bd Add ability to deprecate options
2018-06-19 14:56:30 +02:00
Nicolas Grekas
d148fa708a feature #26919 [TwigBridge] Added bundle name suggestion on wrongly overrided templates paths (pmontoya, Pascal Montoya)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[TwigBridge] Added bundle name suggestion on wrongly overrided templates paths

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

Report unknown folders in templates/bundles in debug:twig and make suggestions if any

Developped with @bricejulia

Commits
-------

acfb325a35 refs #26898 Remove unnecessary loop Trim messages on build rather than on display
da42b3e23c refs #26898 Check if projectDir is not null before loop
da0c589385 refs #26898 Move changelog entry to 4.1.0 to 4.2.0
7d9467a319 Add an entry on json export format
bab9d99032 Use %twig.default_path% parameter and search in old folder structure too
1758de24a5 [TwigBridge] Added bundle name suggestion on wrongly overrided templates paths
2018-06-19 14:50:24 +02:00
Christian Flothmann
c2ce15301c deprecate tree builders without root nodes 2018-06-19 14:34:32 +02:00
Nicolas Grekas
18026dcc83 bug #27467 [HttpKernel] fix session tracking in surrogate master requests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] fix session tracking in surrogate master requests

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

Spotted while looking at ESI fragments resolved by`HttpCache`: right now when the master request starts the session, fragments are not cacheable anymore, even when they do not use the session.

Commits
-------

146e01cb44 [HttpKernel] fix session tracking in surrogate master requests
2018-06-19 13:58:43 +02:00
Michael Moravec
b0fa398187
Remove direct dependencies on doctrine/common 2018-06-19 13:41:48 +02:00
Nicolas Grekas
f065873881 feature #26486 [HttpFoundation] Adds getAcceptableFormats() method for Request (AndreiIgna)
This PR was squashed before being merged into the 4.2-dev branch (closes #26486).

Discussion
----------

[HttpFoundation] Adds getAcceptableFormats() method for Request

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

Adds a new method `getAcceptableFormats()` for `Request`. This reads the content types in Accept header and maps them to formats already defined in `Request` class

In a request made by a browser, based on the default Accept header, the `getAcceptableFormats()` will return an array `['html', 'xml']`

In progress
- [x] gather feedback for my changes
- [x] submit changes to the documentation

Commits
-------

8a127ea34a [HttpFoundation] Adds getAcceptableFormats() method for Request
2018-06-19 13:26:37 +02:00
Andrei Igna
8a127ea34a [HttpFoundation] Adds getAcceptableFormats() method for Request 2018-06-19 13:26:24 +02:00
Nicolas Grekas
9f1d1d82fb minor #27508 [Finder] Update RealIteratorTestCase (flip111)
This PR was submitted for the master branch but it was squashed and merged into the 2.8 branch instead (closes #27508).

Discussion
----------

[Finder] Update RealIteratorTestCase

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

Makes the entire test directory empty instead of trying to delete particular files and directories. The old method failed when trying to remove a directory which was not empty.

Commits
-------

7d0ebd41ab [Finder] Update RealIteratorTestCase
2018-06-19 13:07:17 +02:00
flip111
7d0ebd41ab [Finder] Update RealIteratorTestCase 2018-06-19 13:04:56 +02:00
Nicolas Grekas
6c03064cb6 feature #27535 [TwigBundle] Enhance the twig not found exception (behnoushnorouzi)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[TwigBundle] Enhance the twig not found exception

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

Improve error message to make it clear to developers what mistake they have made.

Commits
-------

32988b4294 Enhance the twig not found exception
2018-06-19 12:58:50 +02:00
Nicolas Grekas
c6948044c7 feature #27551 [FrameworkBundle] show public/private for aliases in debug:container command (OskarStark)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] show public/private for aliases in debug:container command

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

It could be helpful to see the public/private status for aliases in `debug:container` command.

Otherwise you need to dive into the code to get the information, because the result only shows the options of the aliased service.

## Look & Feel for public alias
![screenshot 2018-06-08 09 25 50](https://user-images.githubusercontent.com/995707/41144664-f3b50766-6afd-11e8-92d0-ca30513a1afc.png)

_text has slightly changed_

## Look & Feel for private alias
![screenshot 2018-06-08 09 23 31](https://user-images.githubusercontent.com/995707/41144593-b354aad2-6afd-11e8-8ab1-f9196e567f67.png)

_text has slightly changed_

//cc @nicolas-grekas

Commits
-------

1df7742345 [FrameworkBundle] show public/private for aliases in debug:container command
2018-06-19 12:57:50 +02:00
Nicolas Grekas
ec6b941738 [Routing] remove unneeded dev dep on doctrine/common 2018-06-19 11:52:17 +02:00
Nicolas Grekas
c6b3135c9b bug #27633 [Messenger] Fixed MessengerPass::guessHandledClasses return type (massimilianobraglia)
This PR was squashed before being merged into the 4.2-dev branch (closes #27633).

Discussion
----------

[Messenger] Fixed MessengerPass::guessHandledClasses return type

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

Good evening! Thanks for this amazing project.
I've searched over issues and PRs and I didn't find anything about this bug I found. Excuse me if this is a duplicate.

If you create an implementation of `MessageSubscriberInterface` and yield results from `getHandledMessages` method, a TypeError (like the following) will be raised:

```TypeError: Return value of Symfony\Component\Messenger\DependencyInjection\MessengerPass::guessHandledClasses() must be of the type array, object returned```

`MessengerPass::guessHandledClasses` return type declared is `array`, when `MessageSubscriberInterface::guessHandledClasses()`'s return type is `iterable`.

In this PR I have fixed the return type and wrote a simple test for it.

I am looking forward your review. Thank you.
Massimiliano

Commits
-------

0b1c8257d6 [Messenger] Fixed MessengerPass::guessHandledClasses return type
2018-06-19 11:34:47 +02:00
Massimiliano Braglia
0b1c8257d6 [Messenger] Fixed MessengerPass::guessHandledClasses return type 2018-06-19 11:34:40 +02:00
Nicolas Grekas
1f439e5845 minor #27623 [minor] SCA (kalessil)
This PR was squashed before being merged into the 3.4 branch (closes #27623).

Discussion
----------

[minor] SCA

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

New findings: language level, greedy regex, array_column usages

Commits
-------

5922507dc5 [minor] SCA
2018-06-19 11:31:47 +02:00
Vladimir Reznichenko
5922507dc5 [minor] SCA 2018-06-19 11:31:41 +02:00
Gautier Deuette
0bc53d66c0 [Validator] Remove BOM in some xlf files 2018-06-19 10:02:14 +02:00
Fabien Potencier
c0ca2afbb3 feature #27543 [Cache] serialize objects using native arrays when possible (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] serialize objects using native arrays when possible

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

This PR allows leveraging OPCache shared memory when storing objects in `Php*` pool storages (as done by default for all system caches). This improves performance a bit further when loading e.g. annotations, etc. (bench coming);

Instead of using native php serialization, this uses a marshaller that represents objects in plain static arrays. Unmarshalling these arrays is faster than unserializing the corresponding PHP strings (because it works with copy-on-write, while unserialize cannot.)

php-serialization is still a possible format because we have to use it when serializing structures with internal references or with objects implementing `Serializable`. The best serialization format is selected automatically so this is completely seamless.

ping @palex-fpt since you gave me the push to work on this, and are pursuing a similar goal in #27484. I'd be thrilled to get some benchmarks on your scenarios.

Commits
-------

866420e2eb [Cache] serialize objects using native arrays when possible
2018-06-18 17:28:27 +02:00
Fabien Potencier
d075d0ce11 feature #27563 [Cache] Improve perf of array-based pools (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Improve perf of array-based pools

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

- skip key validation when key is already known
- remove overhead in `ArrayCache::get()` via inlining
- don't store simple values in serialized format when not needed, preserving COW

~~Needs #27565 to be green.~~

Commits
-------

92a2d4754f [Cache] Improve perf of array-based pools
2018-06-18 17:12:19 +02:00
Fabien Potencier
137dd7658e feature #27604 [Cache] Prevent stampede at warmup using flock() (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Prevent stampede at warmup using flock()

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

Replaces #27028

This PR protects against cache stampede by wrapping the computation of items in a pool of locks.

For each apps, there can be at most 20 concurrent processes that compute items at the same time and only one per cache-key.

Commits
-------

0ac2777ad1 [Cache] Prevent stampede at warmup using flock()
2018-06-18 17:07:46 +02:00
Nicolas Grekas
0ac2777ad1 [Cache] Prevent stampede at warmup using flock() 2018-06-18 17:06:11 +02:00
MatTheCat
079b944077 Ensure updateTimestamp returns a boolean 2018-06-18 15:48:40 +02:00
karl.rixon
dae704ad2f Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks 2018-06-18 12:57:58 +01:00
Pascal Montoya
acfb325a35
refs #26898
Remove unnecessary loop
Trim messages on build rather than on display
2018-06-18 12:27:44 +02:00