Commit Graph

30691 Commits

Author SHA1 Message Date
Jannik Zschiesche
3cd2eef6e6 Add placeholder support in bootstrap 4 file fields 2018-07-16 11:56:53 +02:00
Fabien Potencier
25df3e32cb bug #27919 [Form] Improve rendering of file field in bootstrap 4 (apfelbox)
This PR was squashed before being merged into the 4.1 branch (closes #27919).

Discussion
----------

[Form] Improve rendering of `file` field in bootstrap 4

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

Hi 👋

currently adding a file type to a form looks weird in the bootstrap 4 form themes:

```php
$builder
    ->add("pdfFile", FileType::class, [
        "label" => "PDF",
    ]);
```

## Before

### Vertical Form

![2018-07-10 at 21 36](https://user-images.githubusercontent.com/1032411/42533175-6b88e33a-8489-11e8-927a-8e987f362913.png)

### Horizontal Form

![2018-07-10 at 21 37](https://user-images.githubusercontent.com/1032411/42533197-7d45944c-8489-11e8-970f-79b18a273366.png)

## After

### Vertical Form

![2018-07-10 at 21 38](https://user-images.githubusercontent.com/1032411/42533229-8ebe44a8-8489-11e8-94e0-891403063476.png)

### Horizontal Form

![2018-07-10 at 21 38](https://user-images.githubusercontent.com/1032411/42533247-99782db4-8489-11e8-9f66-30a5dccdaa9d.png)

## Things to consider

There are three labels here:

![2018-07-10 at 21 40](https://user-images.githubusercontent.com/1032411/42533370-ecbaf63c-8489-11e8-9be8-1c8c3342c459.png)

1) the actual field label. Here the `$options["label"]` is used.
2) the placeholder. Here `$options["attr"]["placeholder"] ?? ""` is used **new**
3) the label on the button. This is set in CSS actually, on an `::after` attribute.

There isn't much we can do about 3) because there is no inline HTML-way to overwrite the style of a pseudo element. So if the app developer wants to have localization in this field as well, (s)he has to set it in their CSS file [as described in the bootstrap docs](https://getbootstrap.com/docs/4.0/components/forms/#file-browser)

## Todo

- [x] ~~WIP because I haven't managed to get the test suite to run locally yet, so we will debug with Travis 🙌~~  okay, getting them to work is really, really easy, but you just have to get over yourself and do it 🙄

Commits
-------

32ad5d9f9c [Form] Improve rendering of `file` field in bootstrap 4
2018-07-15 09:26:40 +02:00
Jannik Zschiesche
32ad5d9f9c [Form] Improve rendering of file field in bootstrap 4 2018-07-15 09:26:33 +02:00
Edi Modrić
9854a26981 [Form] Fix PHPDoc for FormConfigBuilder $dataClass argument 2018-07-14 16:42:20 +02:00
Christian Flothmann
ec795cca78 fix compatibility with older Cache versions
FrameworkBundle 4.2 will be compatible with older versions of the Cache
component. In those versions adapters don't implement `ResetInterface`.
For backwards compatibility they still need to be tagged.
2018-07-14 10:12:57 +02:00
Fabien Potencier
eb112a5288 feature #27829 [DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor (dunglas)
This PR was squashed before being merged into the 4.2-dev branch (closes #27829).

Discussion
----------

[DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor

| 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? | 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 explained by @stof in https://github.com/symfony/symfony/pull/27735#discussion_r199797412, injecting the `ClassMetadataFactory` directly can lead to issues when resetting the EntityManager.

This PR deprecates this usage and encourages to inject the entity manager directly.

Commits
-------

3aab4a1270 [DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor
2018-07-13 22:22:21 +02:00
Kévin Dunglas
3aab4a1270 [DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor 2018-07-13 22:22:15 +02:00
Fabien Potencier
091f9ff386 minor #27940 [Security] Update user phpdoc on tokens (ro0NL)
This PR was squashed before being merged into the 2.8 branch (closes #27940).

Discussion
----------

[Security] Update user phpdoc on tokens

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

As implemented here:

1e16a8b979/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php (L78-L88)

Note IMHO `string|object` is intended, and used consistently elsewhere, e.g.: f80376217d/src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php (L27)

Commits
-------

7306018a30 [Security] Update user phpdoc on tokens
2018-07-13 22:20:16 +02:00
Roland Franssen
7306018a30 [Security] Update user phpdoc on tokens 2018-07-13 22:20:03 +02:00
Fabien Potencier
682836da9c renamed Contract to Contracts 2018-07-13 19:06:58 +02:00
jmsche
ecef6f1b9b [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2 2018-07-13 16:00:59 +02:00
Fabien Potencier
1e16a8b979 feature #27093 Add symfony/contracts: a set of abstractions extracted out of the Symfony components (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Add symfony/contracts: a set of abstractions extracted out of the Symfony components

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

A set of abstractions extracted out of the Symfony components.

This is a topic I've been thinking about for a long time. I feel like the time has come for Symfony to publish some abstractions so that people could build on them in a decoupled way.
I've identified interfaces in some components that would greatly benefit from being moved out from the components where they are for now. E.g. #26929 is something that has a broader scope than the Cache component itself.

By putting them in a new `symfony/abstractions` package, we would allow more innovation in the Symfony community, at the abstraction level.

In order to start small, I propose only one interface that gathers a concept that is shared amongst many components already: `ResetInterface`. It would provide a standard `reset()` method, whose purpose is to set an object back to its initial state, allowing it to be reused many times with no side effects/leaks related to its history. By this definition, it could also be autoconfigured (as done here, see update in FrameworkExtension). See wording in the docblock in the attached source code.

Ideally, I'd like this package to provide not only interfaces, by also generic traits, and reference test suites when possible. We could work on adding more abstractions during the 4.2 cycle. WDYT?

## Here is the attached README:

A set of abstractions extracted out of the Symfony components.

Can be used to build on semantics that the Symfony components proved useful - and
that already have battle tested implementations.

Design Principles
-----------------

 * contracts are split by domain, each into their own sub-namespaces;
 * contracts are small and consistent sets of PHP interfaces, traits, normative
   docblocks and reference test suites when applicable, etc.;
 * all contracts must have a proven implementation to enter this repository;
 * they must be backward compatible with existing Symfony components.

FAQ
---

### How to use this package?

The abstractions in this package are useful to achieve loose coupling and
interoperability. By using the provided interfaces as type hints, you are able
to reuse any implementations that match their contracts. It could be a Symfony
component, or another one provided by the PHP community at large.

Depending on their semantics, some interfaces can be combined with autowiring to
seamlessly inject a service in your classes.

Others might be useful as labeling interfaces, to hint about a specific behavior
that could be enabled when using autoconfiguration or manual service tagging (or
any other means provided by your framework.)

### How is this different from PHP-FIG's PSRs?

When applicable, the provided contracts are built on top of PHP-FIG's PSR. We
encourage relying on them and won't duplicate the effort. Still, the FIG has
different goals and different processes. Here, we don't need to seek universal
standards. Instead, we're providing abstractions that are compatible with the
implementations provided by Symfony. This should actually also contribute
positively to the PHP-FIG (from which Symfony is a member), by hinting the group
at some abstractions the PHP world might like to take inspiration from.

### Why isn't this package split into several packages?

Putting all interfaces in one package eases discoverability and dependency
management. Instead of dealing with a myriad of small packages and the
corresponding matrix of versions, you just need to deal with one package and one
version. Also when using IDE autocompletion or just reading the source code, it
makes it easier to figure out which contracts are provided.

There are two downsides to this approach: you may have unused files in your
`vendor/` directory, and in the future, it will be impossible to use two
different sub-namespaces in different major versions of the package. For the
"unused files" downside, it has no practical consequences: their file sizes are
very small, and there is no performance overhead at all since they are never
loaded. For major versions, this package follows the Symfony BC + deprecation
policies, with an additional restriction to never remove deprecated interfaces.

Resources
---------

  * [Documentation](https://symfony.com/doc/current/components/contracts.html)
  * [Contributing](https://symfony.com/doc/current/contributing/index.html)
  * [Report issues](https://github.com/symfony/symfony/issues) and
    [send Pull Requests](https://github.com/symfony/symfony/pulls)
    in the [main Symfony repository](https://github.com/symfony/symfony)

Commits
-------

898203649f Added symfony/contracts: a set of abstractions extracted out of the components
2018-07-13 13:25:15 +02:00
Fabien Potencier
f80376217d bug #27937 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called (rubencm)
This PR was merged into the 2.8 branch.

Discussion
----------

[HttpFoundation] reset callback on StreamedResponse when setNotModified() is called

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

Commits
-------

51a49c7f78 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called
2018-07-13 13:22:37 +02:00
Webnet team
5f59ad4600 suppress side effects in 'get' or 'has' methods of NamespacedAttributeBag 2018-07-13 13:19:15 +02:00
Rubén Calvo
51a49c7f78 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called 2018-07-13 08:54:27 +02:00
Samuel ROZE
ec4b04b2d5 Supports nested "abstract" object while serializing and de-serializing 2018-07-12 09:11:46 +01:00
Christian Flothmann
e69fac4c89 [SecurityBundle] fix tests 2018-07-12 10:05:19 +02:00
Fabien Potencier
20070b72ac feature #27807 Added new methods submitForm and clickLink to Client class (nowiko)
This PR was squashed before being merged into the 4.2-dev branch (closes #27807).

Discussion
----------

Added new methods submitForm and clickLink to Client class

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

Added new methods to BrowserKit/Client to simplify work with links and forms.
Related to https://github.com/symfony/symfony/issues/27627

Commits
-------

e098eddc96 Added new methods submitForm and clickLink to Client class
2018-07-12 09:05:27 +02:00
Viktor Novikov
e098eddc96 Added new methods submitForm and clickLink to Client class 2018-07-12 09:05:20 +02:00
Fabien Potencier
3f663fdfbb minor #27878 improve deprecation messages (xabbuh)
This PR was merged into the 4.2-dev branch.

Discussion
----------

improve deprecation messages

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

1657b82c19 improve deprecation messages
2018-07-12 08:18:35 +02:00
Jan Hort
a72f4ecb3a [HttpFoundation] Fixed phpdoc for get method of HeaderBag 2018-07-12 08:13:47 +02:00
Fabien Potencier
10f7dcc5dc bug #27913 [EventDispatcher] Clear orphaned events on reset (acasademont)
This PR was merged into the 4.1 branch.

Discussion
----------

[EventDispatcher] Clear orphaned events on reset

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

When the Orphaned Events feature was added in #24392 it was forgotten to also clear them when the `reset` method on the `TraceableEventDispatcher` is called. This makes the Orphaned Events tab on the Event profiler an evergrowing list when using PHP-PM (or other event loop implementations).

Commits
-------

d3260dfdcd [EventDispatcher] Clear orphaned events on TraceableEventDispatcher::reset
2018-07-12 08:09:16 +02:00
Fabien Potencier
44ce4dd625 bug #27923 [Form/Profiler] Massively reducing memory footprint of form profiling pages... (VincentChalnot)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form/Profiler] Massively reducing memory footprint of form profiling pages...

… by removing redundant 'form' variable from view variables.

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

## Problem
When trying to profile large forms in web profiler, the page can get so big that the memory footprint of the web browser excedes 1Gb making everything unusable and sometimes crashing the browser.

This is especially true for "deep" forms as every node of the form also contains its children in the debugging infos.

## Solution
When removing the "form" view variable that actually contains duplicated contents of everything already displayed in the page, the memory footprint massively decrease making the page usable again even form very complex and deep forms.

By using CutStub, we keep a necessary level of information by providing the information that the variable is indeed here but not directly accessible in the dump.

Commits
-------

5f5077f4fc [Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables.
2018-07-12 08:05:38 +02:00
Fabien Potencier
c85134c9c1 feature #27879 [Routing] deprecate non string requirement names (xabbuh)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Routing] deprecate non string requirement names

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

Basically, this will help catching wrong `@Route` annotation configurations like the following which can lead to hard to debug issues:

```php
@Route("/{foo}", requirements={"foo", "bar"})
```

Commits
-------

8bb5266553 deprecate non string requirement names
2018-07-11 17:44:02 +02:00
Christian Flothmann
559cdb01bd fix typo in ContainerBuilder docblock 2018-07-11 12:26:22 +02:00
Fabien Potencier
df26feaa22 feature #26933 [Console] Add title table (maidmaid)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Console] Add title table

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

Why not just add a title to console tables? Inspired by the famous file manager [Midnight Commander](https://en.wikipedia.org/wiki/Midnight_Commander).

![screenshot from 2018-04-15 20-16-26](https://user-images.githubusercontent.com/4578773/38777361-eb6aaa72-40e9-11e8-8ae4-055fe80272c3.png)

Commits
-------

6bf9eeb14e Add title table
2018-07-11 11:58:49 +02:00
Dany Maillard
6bf9eeb14e Add title table 2018-07-11 11:50:52 +02:00
Vincent Chalnot
5f5077f4fc [Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables. 2018-07-11 11:08:35 +02:00
Nicolas Grekas
898203649f Added symfony/contracts: a set of abstractions extracted out of the components 2018-07-11 10:17:42 +02:00
Christian Flothmann
039c4d4f6b fix typo 2018-07-11 09:48:45 +02:00
Sebastian Schwarz
d78dcc0615 [Console] correctly return parameter's default value on "--"
Fixes #27916
2018-07-10 16:02:11 +02:00
Christian Flothmann
a265caf041 [DependencyInjection] add missing test for #27710 2018-07-10 15:15:49 +02:00
Albert Casdemont
d3260dfdcd [EventDispatcher] Clear orphaned events on TraceableEventDispatcher::reset 2018-07-10 13:02:47 +02:00
Nicolas Grekas
3cfdc9e9d7 minor fixes 2018-07-09 17:54:21 +02:00
Nicolas Grekas
1d9f1d1b70 [ProxyManagerBridge][DI] allow proxifying interfaces with "lazy: Some\ProxifiedInterface" 2018-07-09 16:45:45 +02:00
Fabien Potencier
f20eaf26c2 feature #27645 [Cache] Add MarshallerInterface allowing to change the serializer, providing a default one that automatically uses igbinary when available (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Add `MarshallerInterface` allowing to change the serializer, providing a default one that automatically uses igbinary when available

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

With this PR, when igbinary is available, it is automatically used to serialize values.
This provides faster and smaller cache payloads.
The unserializing logic is autoadaptative:
- when an igbinary-serialized value is unserialized but the extension is missing, a cache miss is triggered
- when a natively-serialized value is unserialized and the extension is available, the native `unserialize()` is used

Ping @palex-fpt since you provided very useful comments on the topic and might be interested in reviewing here also.

Commits
-------

9c328c4894 [Cache] Add `MarshallerInterface` allowing to change the serializer, providing a default one that automatically uses igbinary when available
2018-07-09 16:39:33 +02:00
Nicolas Grekas
2345d0c2cf [Cache] update docblock of PdoAdapter/PdoCache 2018-07-09 16:30:01 +02:00
Fabien Potencier
cbda6a3c72 feature #27694 [FrameworkBundle][Cache] Allow configuring PDO-based cache pools, with table auto-creation on first use (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle][Cache] Allow configuring PDO-based cache pools, with table auto-creation on first use

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

* Allowed configuring PDO-based cache pools via a new `cache.adapter.pdo` abstract service
* added automatic table creation when using Doctrine DBAL with PDO-based backends

Commits
-------

1484117430 [FrameworkBundle][Cache] Allow configuring PDO-based cache pools, with table auto-creation on first use
2018-07-09 16:21:08 +02:00
Fabien Potencier
254f4c8f7f feature #27774 [FrameworkBundle] allow turning routes to utf8 mode by default (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] allow turning routes to utf8 mode by default

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

This allows building optimized routers that match in a single regexp instead of an alternate of utf8/non-utf8 set of routes.

Commits
-------

8f359cc047 [FrameworkBundle] allow turning routes to utf8 mode by default
2018-07-09 16:14:24 +02:00
Fabien Potencier
10e15dca66 feature #27821 [Process][Console] deprecated defining commands as strings (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Process][Console] deprecated defining commands as strings

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

 * Added the `Process::fromShellCommandline()` static constructor to define shell command-lines
 * Allowed passing commands as `array($process, 'ENV_VAR' => 'value')` to `ProcessHelper::run()`
 * Deprecated passing commands as strings when creating a `Process` instance.
 * Deprecated the `Process::setCommandline()` and the `PhpProcess::setPhpBinary()` methods.
 * Deprecated passing a command as a string to `ProcessHelper::run()`, pass it the command as an array of arguments instead.
 * Made the `ProcessHelper` class final

Commits
-------

8895bc1b5b [Process][Console] deprecated defining commands as strings
2018-07-09 16:07:29 +02:00
Fabien Potencier
8d35af4a51 minor #27845 [DI] Improve exception messages by hiding the hidden ids they contain (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[DI] Improve exception messages by hiding the hidden ids they contain

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

This PR improves error messages containing hidden ids, especially the ones mentioning service locators.

Right now, when a service subscriber is incomplete, we get:
> The service ".service_locator.G69Xsbl.App\Controller\MyRouter" has a dependency on a non-existent service "Symfony\Component\Config\Loader\LoaderInterface".

With this PR we get this instead:
> The service "routing.loader" in the container provided to "App\Controller\MyRouter" has a dependency on a non-existent service "Symfony\Component\Config\Loader\LoaderInterface".

When no locators are involved, the hidden service is swallowed:
> The service "App\Controller\MyRouter" has a dependency on a non-existent service "Symfony\Component\Config\Loader\LoaderInterface".

This PR also improves runtime exceptions thrown in service locators.

Before:
> Cannot autowire service ".service_locator.Z1jvVrN": it references interface "Symfony\Component\Config\Loader\LoaderInterface" but no such service exists. You should maybe alias this interface to one of these existing services: [...].

After:
> Cannot autowire service "routing.loader" required by "App\Controller\MyRouter": it references interface "Symfony\Component\Config\Loader\LoaderInterface" but no such service exists. You should maybe alias this interface to one of these existing services: [...].

TODO:
- [x] add tests.

Commits
-------

d2b4901a43 [DI] Improve exception messages by hiding the hidden ids they contain
2018-07-09 16:06:18 +02:00
Christian Flothmann
8bb5266553 deprecate non string requirement names 2018-07-09 15:38:45 +02:00
Nicolas Grekas
a552e849d5 bug #27826 [Serializer] Fix serialization of items with groups across entities and discrimination map (sroze)
This PR was merged into the 4.1 branch.

Discussion
----------

[Serializer] Fix serialization of items with groups across entities and discrimination map

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

I believe this approach is better than the one taken in #27816. At least, it's an alternative :)

Commits
-------

c648b938b2 Fix serialization of abstract items with groups across multiple entities
2018-07-09 15:37:26 +02:00
Nicolas Grekas
88f063ddb4 Merge branch '4.1'
* 4.1:
  [Filesystem] fix lock file mode
  [Console] fix typo in phpdoc
  improve deprecation messages
2018-07-09 15:30:59 +02:00
Nicolas Grekas
bbe3ce88d7 minor #27877 improve deprecation messages (xabbuh)
This PR was merged into the 4.1 branch.

Discussion
----------

improve deprecation messages

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

Commits
-------

e4ae5a4ca9 improve deprecation messages
2018-07-09 15:27:57 +02:00
Nicolas Grekas
2b860d515f Merge branch '4.0' into 4.1
* 4.0:
  [Filesystem] fix lock file mode
  [Console] fix typo in phpdoc
2018-07-09 15:27:18 +02:00
Nicolas Grekas
dd16e10a7b Merge branch '3.4' into 4.0
* 3.4:
  [Filesystem] fix lock file mode
  [Console] fix typo in phpdoc
2018-07-09 15:26:23 +02:00
Nicolas Grekas
08b7874a08 Merge branch '2.8' into 3.4
* 2.8:
  [Filesystem] fix lock file mode
  [Console] fix typo in phpdoc
2018-07-09 15:25:43 +02:00
Nicolas Grekas
881c46aadd [Filesystem] fix lock file mode 2018-07-09 15:24:25 +02:00
Nicolas Grekas
b67c26c2ef Merge branch '4.1'
* 4.1:
  [Filesystem] fix lock file permissions
  [Lock] fix lock file permissions
  [Form] Removed .form-control-label class.
  Removed .mb-0 in errors.
  Fix the detection of the Process new argument
  add @xabbuh as a code owner of the Yaml component
  improve deprecation messages
  Replace .initialism with .text-uppercase.
2018-07-09 15:05:12 +02:00
Tobias Schultze
7aa45579d5 [Console] fix typo in phpdoc 2018-07-09 14:58:09 +02:00
Nicolas Grekas
cfe319c4e8 Merge branch '4.0' into 4.1
* 4.0:
  [Filesystem] fix lock file permissions
  [Lock] fix lock file permissions
  [Form] Removed .form-control-label class.
  Removed .mb-0 in errors.
  Fix the detection of the Process new argument
  add @xabbuh as a code owner of the Yaml component
  improve deprecation messages
  Replace .initialism with .text-uppercase.
2018-07-09 14:52:53 +02:00
Nicolas Grekas
72141443ad Merge branch '3.4' into 4.0
* 3.4:
  [Filesystem] fix lock file permissions
  [Lock] fix lock file permissions
  [Form] Removed .form-control-label class.
  Removed .mb-0 in errors.
  Fix the detection of the Process new argument
  add @xabbuh as a code owner of the Yaml component
  Replace .initialism with .text-uppercase.
2018-07-09 14:50:05 +02:00
Nicolas Grekas
69509728c4 Merge branch '2.8' into 3.4
* 2.8:
  [Filesystem] fix lock file permissions
  add @xabbuh as a code owner of the Yaml component
2018-07-09 14:47:47 +02:00
fritzmg
7a68fea2af [Filesystem] fix lock file permissions 2018-07-09 14:47:20 +02:00
Nicolas Grekas
608cf7f1b7 bug #27903 [Lock] fix lock file permissions (fritzmg)
This PR was squashed before being merged into the 3.4 branch (closes #27903).

Discussion
----------

[Lock] fix lock file permissions

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

See [this comment](https://github.com/symfony/symfony/pull/27668#issuecomment-403392924). Since we are using `r+` now to fix an issue on Solaris, we also need to change the file permissions when the lock file is created for the first time. Otherwise
```php
fopen($fileName, 'r+')
```
will fail due to the file permissions and while
```php
fopen($fileName, 'r')
```
will work, the subsequent locking will again fail on Solaris.

Changing the file permissions to `0666` fixes this issue. __However__ any lock file that was generated _prior_ to this change will still cause issues and would need to be manually deleted. Usually the default `sys_get_temp_dir()` location is used for the lock files and _usually_ these files are purged periodically, so it probably won't matter that much. But it still might cause some confusion since it will not be transparent, why the file lock failed on Solaris systems.

Commits
-------

23481a112e [Lock] fix lock file permissions
2018-07-09 14:45:49 +02:00
fritzmg
23481a112e [Lock] fix lock file permissions 2018-07-09 14:45:36 +02:00
Nicolas Grekas
55ddaee7b1 minor #27886 [Form] Removed .form-control-label class. (vudaltsov)
This PR was squashed before being merged into the 3.4 branch (closes #27886).

Discussion
----------

[Form] Removed .form-control-label class.

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

There is no such a class neither in [bootstrap 4.0](https://getbootstrap.com/docs/4.0/components/forms/#form-controls) nor in [bootstrap 4.1](https://getbootstrap.com/docs/4.1/components/forms/#form-controls).

Commits
-------

cb3e712698 [Form] Removed .form-control-label class.
2018-07-09 14:42:10 +02:00
Valentin
cb3e712698 [Form] Removed .form-control-label class. 2018-07-09 14:42:04 +02:00
Valentin
925dda130e Removed .mb-0 in errors. 2018-07-09 14:38:55 +02:00
Nicolas Grekas
d5c765ad69 bug #27889 [Form] Replace .initialism with .text-uppercase. (vudaltsov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Replace .initialism with .text-uppercase.

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

I think that the `.initialism` [class](https://getbootstrap.com/docs/4.0/content/typography/#abbreviations) is for different purposes. While the `.text-uppercase` [class](https://getbootstrap.com/docs/4.0/utilities/text/#text-transform) is more neutral and does exactly what we want here.

Commits
-------

3c39dfdaa6 Replace .initialism with .text-uppercase.
2018-07-09 14:34:25 +02:00
Nicolas Grekas
0fcc874e6f bug #27902 Fix the detection of the Process new argument (stof)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix the detection of the Process new argument

| 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

This fixes the detection of the new method signature when triggering the deprecation warning. The new `$env` parameter is the second argument, not the first one.

Commits
-------

57e95f3f9a Fix the detection of the Process new argument
2018-07-09 14:30:57 +02:00
Christophe Coevoet
57e95f3f9a Fix the detection of the Process new argument 2018-07-09 11:01:07 +02:00
Christian Flothmann
4c7f29fefe minor #27868 improve deprecation messages (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

improve deprecation messages

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

Commits
-------

a3845c7 improve deprecation messages
2018-07-09 10:21:26 +02:00
Christian Flothmann
1657b82c19 improve deprecation messages 2018-07-09 09:26:21 +02:00
Alexander M. Turek
78498d3b81 Prefer PSR-3 to interact with Monolog in tests. 2018-07-09 08:02:21 +02:00
Christian Flothmann
a3845c7d6e improve deprecation messages 2018-07-08 21:14:58 +02:00
Samuel ROZE
b226859e8a feature #27320 [Messenger] Activation middleware decorator (ogizanagi)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] Activation middleware decorator

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| 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 | part of #26901   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | TODO

A small middleware decorator that can be wired using DI decoration to enable/disable a middleware on an arbitrary condition. This can be used to keep the same middleware stack across env but enable/disable some of them through this.

Commits
-------

6e43838c5d [Messenger] Activation middleware decorator
2018-07-08 10:25:00 +01:00
Nicolas Grekas
9c328c4894 [Cache] Add MarshallerInterface allowing to change the serializer, providing a default one that automatically uses igbinary when available 2018-07-08 10:55:08 +02:00
Nicolas Grekas
24babca889 fix the fix 2018-07-08 10:53:18 +02:00
Nicolas Grekas
d8a66d691f [FrameworkBundle] fix lowest deps 2018-07-08 10:25:11 +02:00
Nicolas Grekas
5d6f1006dd fix merge 2018-07-07 18:08:45 +02:00
Nicolas Grekas
ffab7d6d68 Merge branch '4.1'
* 4.1:
  [Console] fix CS
  [OptionResolver] resolve arrays
  [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output
  [PropertyInfo] Fix dock block lookup fallback loop
  [FrameworkBundle] Fixed phpdoc in MicroKernelTrait::configureRoutes()
  [HttpFoundation] don't encode cookie name for BC
  improve deprecation messages
  minor #27858 [Console] changed warning verbosity; fixes typo (adrian-enspired)
  AppBundle->App.
  [Workflow] Fixed BC break
  [DI] Fix dumping ignore-on-uninitialized references to synthetic services
2018-07-07 18:01:39 +02:00
Nicolas Grekas
88f704684d Merge branch '4.0' into 4.1
* 4.0:
  [Console] fix CS
  [OptionResolver] resolve arrays
  [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output
  [PropertyInfo] Fix dock block lookup fallback loop
  [HttpFoundation] don't encode cookie name for BC
  improve deprecation messages
  minor #27858 [Console] changed warning verbosity; fixes typo (adrian-enspired)
  AppBundle->App.
  [DI] Fix dumping ignore-on-uninitialized references to synthetic services
2018-07-07 18:00:36 +02:00
Nicolas Grekas
6b00d4b86a Merge branch '3.4' into 4.0
* 3.4:
  [Console] fix CS
  [OptionResolver] resolve arrays
  [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output
  [PropertyInfo] Fix dock block lookup fallback loop
  [HttpFoundation] don't encode cookie name for BC
  improve deprecation messages
  minor #27858 [Console] changed warning verbosity; fixes typo (adrian-enspired)
  AppBundle->App.
  [DI] Fix dumping ignore-on-uninitialized references to synthetic services
2018-07-07 18:00:24 +02:00
Nicolas Grekas
08dced56c4 Merge branch '2.8' into 3.4
* 2.8:
  [Console] fix CS
  improve deprecation messages
  minor #27858 [Console] changed warning verbosity; fixes typo (adrian-enspired)
2018-07-07 17:54:55 +02:00
Nicolas Grekas
bacb9ed333 [Console] fix CS 2018-07-07 17:53:36 +02:00
Nicolas Grekas
2a2e6f1390 bug #27885 [HttpFoundation] don't encode cookie name for BC (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] don't encode cookie name for BC

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

As reported by @Seldaek in https://github.com/symfony/symfony/pull/25348#issuecomment-401696990

Commits
-------

d28949b846 [HttpFoundation] don't encode cookie name for BC
2018-07-07 17:50:45 +02:00
Nicolas Grekas
1cb3b5b170 bug #27782 [DI] Fix dumping ignore-on-uninitialized references to synthetic services (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix dumping ignore-on-uninitialized references to synthetic services

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

Commits
-------

97e8d68a05 [DI] Fix dumping ignore-on-uninitialized references to synthetic services
2018-07-07 17:48:58 +02:00
Nicolas Grekas
1484117430 [FrameworkBundle][Cache] Allow configuring PDO-based cache pools, with table auto-creation on first use 2018-07-07 17:46:19 +02:00
Nicolas Grekas
18c2dde08e feature #27519 [HttpKernel][FrameworkBundle] Turn HTTP exceptions to HTTP status codes by default (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[HttpKernel][FrameworkBundle] Turn HTTP exceptions to HTTP status codes by default

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

When an exception is thrown, *if it is not handled* then it will be reinjected as a 2nd exception event via `HttpKernel::terminateWithException()`. When this happens, this will generate a proper HTTP status code.

Commits
-------

80b0739fc2 [HttpKernel][FrameworkBundle] Turn HTTP exceptions to HTTP status codes by default
2018-07-07 17:40:43 +02:00
Nicolas Grekas
ac1189a61e feature #27020 [Serializer] Allow to access to the format and context in circular ref handler (dunglas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Serializer] Allow to access to the format and context in circular ref handler

| 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   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | todo

Similar to #27017 but for circular reference handlers.

ping @meyerbaptiste

Commits
-------

99f829ec2b [Serializer] Allow to access to the format and context in circular ref handler
2018-07-07 17:27:55 +02:00
Nicolas Grekas
6fea6349ec bug #27435 [OptionResolver] resolve arrays (Doctrs)
This PR was squashed before being merged into the 3.4 branch (closes #27435).

Discussion
----------

[OptionResolver] resolve arrays

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

Option resolver didn't work with nested arrays

Before:

        $resolver->setDefaults([
            'integer' => [
                [
                    12,
                    23,
                ],
            ],
        ]);

        $resolver->setAllowedTypes('integer', 'integer[][]');

Error

    The option "host" with value array is expected to be of type "integer[][]", but is of type "integer[][]".

Option expetcted type `integer[][]` but get... `integer[][]`. So strange

Now that case work correct, and we get

    array (size=1)
      'integer' =>
        array (size=1)
          0 =>
            array (size=2)
              0 => int 12
              1 => int 23

Commits
-------

6d4812e995 [OptionResolver] resolve arrays
2018-07-07 17:09:44 +02:00
Oleg Golovakhin
6d4812e995 [OptionResolver] resolve arrays 2018-07-07 17:09:37 +02:00
Nicolas Grekas
332b7fd0ca bug #27728 [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output (yceruto)
This PR was squashed before being merged into the 3.4 branch (closes #27728).

Discussion
----------

[TwigBridge] Fix missing path and separators in loader paths list on debug:twig output

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

**Reproducer**
```bash
$ composer create-project symfony/skeleton repr
$ cd repr
$ composer req twig
# remove duplicated path on `twig.paths: ['%kernel.project_dir%/templates']` config.
$ bin/console debug:twig
```
See "Loader Paths" section at the end of the output and compare it with `--format=json`. Note that the root `templates` path is present in Twig `loader_paths` because `twig.default_path` config, but it isn't visible on `debug:twig` output.

**Missing path:**

| Before | After |
| --- | --- |
| ![debug_twig_before1](https://user-images.githubusercontent.com/2028198/41908937-9af78274-7913-11e8-91d1-bb48f81031dd.png) | ![debug_twig_after1](https://user-images.githubusercontent.com/2028198/41908969-b5fd3140-7913-11e8-8129-8215f3c09b24.png) |

**Extra Lines separator:**

| Before | After |
| --- | --- |
| ![debug_twig_before2](https://user-images.githubusercontent.com/2028198/41909029-e867fcdc-7913-11e8-91f1-bba0d873495c.png) | ![debug_twig_after2](https://user-images.githubusercontent.com/2028198/41915586-12a6426e-7924-11e8-899f-9ecc7d95b74f.png) |

Commits
-------

ba7a4ca863 [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output
2018-07-07 17:04:34 +02:00
Yonel Ceruto
ba7a4ca863 [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output 2018-07-07 17:04:14 +02:00
Nicolas Grekas
6d3f63d6f3 feature #27783 [DI] Add ServiceLocatorArgument to generate array-based locators optimized for OPcache shared memory (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[DI] Add ServiceLocatorArgument to generate array-based locators optimized for OPcache shared memory

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

Right now, to generate service locators, we use collections of closures described using `ServiceClosureArgument`. This works well, but it doesn't scale well when the number of services grows, because we have to load as many closures as there are services, even if we never call them.

This PR introduces `ServiceLocatorArgument`, which describes the same thing, but allows dumping optimized locators: instead of a collection of closures, this generates a static array that OPcache can put in shared memory (see fixtures for example.)

Once this PR is merged, we'll be able to update `ServiceLocatorPass::register()` to leverage it and generate these optimized locators everywhere. One particular I have in mind in the locator used by `ServiceArgumentResolver`, which can grow fast (it has as many entries as there are actions.)

Commits
-------

6c8e9576a3 [DI] Add ServiceLocatorArgument to generate array-based locators optimized for OPcache shared memory
2018-07-07 17:01:23 +02:00
Nicolas Grekas
1cf8146c11 minor #27805 [Workflow] Fix autofit label in rendering (evertharmeling)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Workflow] Fix autofit label in rendering

Set default to autofit label in place/transition to render long labels properly.

| Q             | A
| ------------- | ---
| Branch?       | master (3.2 to 4.1)
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes, not sure how to add a proper test however
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

When using long names for `places` or `transitions`, currently this will not be properly rendered it via the `GraphvizDumper`, see below.

![Default truncated](https://cdn.pbrd.co/images/HsAMVK9.png)
![Default autofit](https://cdn.pbrd.co/images/HsANdKx.png)

By setting the default to `fixedsize=false` it will autofit the label in the rendering.

This will also solve the warning when running the `dump` command:
`Warning: node 'place_08b79deda74a924c3babb9b1d0f3e4eed9320989', graph 'workflow' size too small for label`

Commits
-------

76465fc1f7 [Workflow] Set default to autofit label in place/transition to render long labels properly
2018-07-07 17:00:02 +02:00
DerManoMann
b1a612087f [PropertyInfo] Fix dock block lookup fallback loop 2018-07-07 16:54:05 +02:00
Nicolas Grekas
fbb1f828a6 feature #27850 [Security] Allow passing null as $filter in LdapUserProvider to get the default filter (louhde)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Security] Allow passing null as $filter in LdapUserProvider to get the default filter

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

Commits
-------

c6f87c6e3a [Security] Allow passing null as $filter in LdapUserProvider to get the default filter
2018-07-07 16:48:49 +02:00
Nicolas Grekas
c35772c243 minor #27866 improve deprecation messages (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

improve deprecation messages

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

Commits
-------

39cb2a99ba improve deprecation messages
2018-07-07 16:41:03 +02:00
Valentin
948c841acf [FrameworkBundle] Fixed phpdoc in MicroKernelTrait::configureRoutes() 2018-07-07 16:31:37 +02:00
Valentin
3c39dfdaa6 Replace .initialism with .text-uppercase. 2018-07-07 16:05:57 +03:00
Nicolas Grekas
d28949b846 [HttpFoundation] don't encode cookie name for BC 2018-07-07 11:30:05 +02:00
Nicolas Grekas
d2b4901a43 [DI] Improve exception messages by hiding the hidden ids they contain 2018-07-07 10:42:09 +02:00
Nicolas Grekas
8895bc1b5b [Process][Console] deprecated defining commands as strings 2018-07-06 20:45:13 +02:00
Christian Flothmann
e4ae5a4ca9 improve deprecation messages 2018-07-06 16:52:28 +02:00
Christian Flothmann
39cb2a99ba improve deprecation messages 2018-07-06 16:26:38 +02:00
Robin Chalas
6cefd8838f feature #27650 [SecurityBundle] Add json login ldap (Rudy Onfroy)
This PR was squashed before being merged into the 4.2-dev branch (closes #27650).

Discussion
----------

[SecurityBundle] Add json login ldap

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

Add a simple from_login_ldap on firewall types to let authenticate with ldap with json API

Commits
-------

2b2dfd2 [SecurityBundle] Add json login ldap
2018-07-06 14:59:10 +02:00
Rudy Onfroy
2b2dfd2797 [SecurityBundle] Add json login ldap 2018-07-06 14:59:00 +02:00
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