[Framework][DX] Set the proper validator class according to the configured api version
bug #12151 [Framework][DX] Set the proper validator class according to the configured api version (peterrehm)

This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes #12151).

Discussion
----------

[Framework][DX] Set the proper validator class according to the configured api version

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

With this change the proper validator class will be dumped and therefore used for code completion in IDE's like PhpStorm which rely on the dumped container.

If you have 2.4 or 2.5-bc API the class will be

    Symfony\Component\Validator\ValidatorInterface

If you use the 2.5 API the class will be

    Symfony\Component\Validator\Validator\ValidatorInterface

I consider this also as important for the developer experience since a wrong type hint can easily cause issues since the method signatures of the validate() method have changed.

From

````php
    public function validate($value, $groups = null, $traverse = false, $deep = false);
````

To

````php
    public function validate($value, $constraints = null, $groups = null);
````

So if you want to validate specific groups you now have to pass them as the third argument instead of the second.

Commits
-------

eb3dd0f [Framework][DX] Set the proper validator class according to the configured api version
don't raise warnings when exception is thrown

`array_map()` raises a warning when an exception is thrown inside the
callback (see https://bugs.php.net/bug.php?id=55416). To avoid these
warnings, `selectorToXPath()` is applied inside the loop.
bug #12187 [CssSelector] don't raise warnings when exception is thrown (xabbuh)

This PR was merged into the 2.3 branch.

Discussion
----------

[CssSelector] don't raise warnings when exception is thrown

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

`array_map()` raises a warning when an exception is thrown inside the
callback (see https://bugs.php.net/bug.php?id=55416). To avoid these
warnings, `selectorToXPath()` is applied inside the loop.

Commits
-------

38e9623 don't raise warnings when exception is thrown
[Routing] fix inconsistencies in RequestContext
[Routing] add tests for RequestContext
minor #12190 [Routing] fix type inconsistencies in RequestContext (Tobion)

This PR was merged into the 2.3 branch.

Discussion
----------

[Routing] fix type inconsistencies in RequestContext

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

Fixed inconsistencies in RequestContext:

- [x] port setters and getters inconsistent with constructor (string vs int)
- [x] host should be lowercased for easier case-insensitivity, see #9072
- [x] fix setQueryString with null
- [x] fix return phpdoc typehint

Commits
-------

676c4a0 [Routing] add tests for RequestContext
f61607f [Routing] fix inconsistencies in RequestContext
Merge branch '2.3' into 2.5

* 2.3:
  [Routing] add tests for RequestContext
  [Routing] fix inconsistencies in RequestContext
  don't raise warnings when exception is thrown
Merge branch '2.5'

* 2.5:
  [Routing] add tests for RequestContext
  [Routing] fix inconsistencies in RequestContext
  don't raise warnings when exception is thrown
  [Framework][DX] Set the proper validator class according to the configured api version
[Routing] unify fluent interface in RequestContext
feature #9073 [Routing] unify RequestContext as fluent class (Tobion)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[Routing] unify RequestContext as fluent class

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

- [x] <del>some methods were tagged with `@api` which makes no sense since the class is already tagged as stable. this automatically includes all methods. also our bc promise is only about `@api` on classes</del>
- [x] setParameters the only fluent method! I made them all fluent which makes sense for this class

Commits
-------

41412f9 [Routing] unify fluent interface in RequestContext
[Security] More accurate docblocks for AbstractVoter
minor #12191 [Security] More accurate docblocks for AbstractVoter (johnkary)

This PR was squashed before being merged into the 2.6-dev branch (closes #12191).

Discussion
----------

[Security] More accurate docblocks for AbstractVoter

| Q             | A
| ------------- | ---
| Fixed tickets | none
| License       | MIT

Two fixes for docblocks in AbstractVoter:

1. Previously the example return value for a few methods used PHP's short array syntax (>= PHP 5.4). Symfony minimum PHP is 5.3 so the docblock examples should be compatible with that.

2. Previously getSupportedClasses() docblock had an example return value showing a FQCN using a leading slash. AbstractVoter looks for `get_class($object)` in the array of getSupportedClasses() returned values, and `get_class()` returns the FQCN without a leading slash.

Commits
-------

ed226ec [Security] More accurate docblocks for AbstractVoter
wip