[Form] Changed the default value of $flatten in Form::getErrors() to true
[HttpKernel] fixed wrong reference in TraceableEventDispatcher
Fixed recursion level incrementing in FlattenException::flattenArgs().
bug #10195 [Debug] Fixed recursion level incrementing in FlattenException::flattenArgs(). (sun)

This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10195).

Discussion
----------

[Debug] Fixed recursion level incrementing in FlattenException::flattenArgs().

The internal `$level` variable for tracking the recursion level is pre-incremented on the parent level of the recursion already.

This causes later array elements in an array that has more than 10 elements to get obscured by `'*DEEP NESTED ARRAY*'`, even though the elements are on the first/top level of the array.

The incremented `$level` value needs to be passed to the recursive call to `FlattenException::flattenArgs()` only.

Discovered in debugging exceptions in Drupal (which happens to use very large multi-dimensional arrays for legacy reasons).

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

Commits
-------

1b1501b Fixed recursion level incrementing in FlattenException::flattenArgs().
added missing @deprecated tag
minor #10188 [TwigBundle] added missing @deprecated tag (fabpot)

This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10188).

Discussion
----------

[TwigBundle] added missing @deprecated tag

Commits
-------

ee08582 [TwigBundle] added missing @deprecated tag
bug #10191 [HttpKernel] fixed wrong reference in TraceableEventDispatcher (fabpot)

This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] fixed wrong reference in TraceableEventDispatcher

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

This PR fixes #9748 and #9727 by removing the `id` state. Only private method signatures have been changed, so that qualifies for a fix in 2.3.

The `getNotCalledListeners()` is a bit special as it tries to get non-called listeners. It passes `null` as the event id as if a listener has been called more than once, getting the first call is enough.

Commits
-------

acd3317 [HttpKernel] fixed wrong reference in TraceableEventDispatcher
Include running periods in duration

StopwatchEvent:
  - method getDuration() now includes periods that are not stopped yet

StopwatchEventTest:
  - added testDurationBeforeStop()
Merge branch '2.3' into 2.4

* 2.3:
  added missing @deprecated tag
  Fixed recursion level incrementing in FlattenException::flattenArgs().
  [HttpKernel] fixed wrong reference in TraceableEventDispatcher

Conflicts:
	src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
Allow retrieving unstopped stopwatch events

Section:
  - added method getEvent()

Stopwatch:
  - added method getEvent()

StopwatchTest:
  - modified testStart() to test for getEvent() method
  - added testUnknownEvent()
Merge branch '2.4'

* 2.4:
  added missing @deprecated tag
  Fixed recursion level incrementing in FlattenException::flattenArgs().
  [HttpKernel] fixed wrong reference in TraceableEventDispatcher

Conflicts:
	src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
fix ProcessPipes
bug #10199 fix ProcessPipes (nicolas-grekas)

This PR was merged into the 2.5-dev branch.

Discussion
----------

fix ProcessPipes

Commits
-------

076d417 fix ProcessPipes
[EventDispatcher] simplified code for TraceableEventDispatcher
[DomCrawler] Fixed incorrect handling of image inputs
bug #10205 [DomCrawler] Fixed incorrect handling of image inputs (robbertkl)

This PR was merged into the 2.3 branch.

Discussion
----------

[DomCrawler] Fixed incorrect handling of image inputs

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

A possible approach to fix #10204, but I'm open to suggestions to fix this another way, as this might not be the most 'elegant' way.

Initially, my thoughts were to create a new DomCrawler\Field\FormField subclass, especially for image inputs. However, this does not solve the problem, because such a FormField would still exist under 1 name in the FormFieldRegistry.

Instead, I've changed it to have 2 separate FormFields instead (which both reference the same input node), with different names (.x and .y) so that both values can be set separately and will both be submitted.

Commits
-------

816cf17 [DomCrawler] Fixed incorrect handling of image inputs
[DomCrawler] Fixed filterXPath() chaining
bug #10207 [DomCrawler] Fixed filterXPath() chaining (robbertkl)

This PR was merged into the 2.3 branch.

Discussion
----------

[DomCrawler] Fixed filterXPath() chaining

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | debatable (see below)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10206
| License       | MIT
| Doc PR        |

As @stof mentions in #10206, each node in the Crawler can belong to a different \DOMDocument. Therefore, I've made each node do its own XPath, relative to itself, and add all the results to a new Crawler. This way, all resulting nodes are still part of their original \DOMDocument and thus can reach all of their parent nodes.

No current tests break on this change. I've added a new test for this case, by checking if the number of parents is correct after obtaining a node through chaining of `filterXPath()`.

Now for BC: I can think of a number of cases where this change would give a different result. However, it's debatable/unclear if:
- the old behavior was a bug in the first place (which would validate this change), or
- the old behavior was intended (which would make this a BC breaking change)

As an example, consider the following HTML:
```html
<div name="a"><div name="b"><div name="c"></div></div></div>
```
What would happen if we run this:
```php
echo $crawler->filterXPath('//div')->filterXPath('div')->filterXPath('div')->attr('name');
```
Aside from breaking reachability of the parent nodes by chaining, with the original code it would echo 'a'.
With this patch it would echo 'c', which, to me, makes more sense.

Commits
-------

43a7716 [DomCrawler] Fixed filterXPath() chaining
feature #10198 [Stopwatch] Allow getting duration of events without calling stop() (jochenvdv)

This PR was merged into the 2.5-dev branch.

Discussion
----------

[Stopwatch] Allow getting duration of events without calling stop()

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | [#10175](https://github.com/symfony/symfony/issues/10175)
| License       | MIT
| Doc PR        | [#3539](https://github.com/symfony/symfony-docs/pull/3539)

Commits
-------

2efe461 Allow retrieving unstopped stopwatch events
d3d097d Include running periods in duration
feature #10200 [EventDispatcher] simplified code for TraceableEventDispatcher (fabpot)

This PR was merged into the 2.5-dev branch.

Discussion
----------

[EventDispatcher] simplified code for TraceableEventDispatcher

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

Commits
-------

42e4c7b [EventDispatcher] simplified code for TraceableEventDispatcher