[READ-ONLY] Subtree split of the Symfony Framework Bundle
Latest commit 19b0d44 Feb 27, 2017 @fabpot fabpot feature #21164 [HttpKernel] Added the SessionValueResolver (iltar)
This PR was merged into the 3.3-dev branch.


[HttpKernel] Added the SessionValueResolver

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

This feature adds the `SessionValueResolver`. That means that you no longer have to rely on injecting a `SessionInterface` implementation via the constructor or getting this implementation from the `Request`. Regardless of method, it does not know about the `getFlashBag()`.

By adding the `Session` to the action arguments, you can now type-hint against the implementation rather than interface, which contains the `getFlashBag()`, making it accessible rather than using duck-typing.

_It should also feel less like injecting a service into the constructor which has a state or getting a service from the request._

**Old Situation**
class Controller
    public function __construct(SessionInterface $session) { /* ... */ }

    public function fooAction(Request $request)

        // duck-typing


**New Situation** _- The controller shortcut for flashbag could in theory be removed now_
class Controller
    public function fooAction(Session $session)


b4464dcea1 Added the SessionValueResolver