Skip to content

Commit a0227dc

Browse files
committed
refac: use requestStack instate of session service
1 parent d9d71b1 commit a0227dc

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

EditInPlace/Activator.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
namespace Translation\Bundle\EditInPlace;
1313

1414
use Symfony\Component\HttpFoundation\Request;
15-
use Symfony\Component\HttpFoundation\Session\Session;
15+
use Symfony\Component\HttpFoundation\RequestStack;
16+
use Symfony\Component\HttpFoundation\Session\SessionInterface;
1617

1718
/**
1819
* Default Activator implementation.
@@ -24,13 +25,13 @@ final class Activator implements ActivatorInterface
2425
const KEY = 'translation_bundle.edit_in_place.enabled';
2526

2627
/**
27-
* @var Session
28+
* @var SessionInterface
2829
*/
2930
private $session;
3031

31-
public function __construct(Session $session)
32+
public function __construct(RequestStack $requestStack)
3233
{
33-
$this->session = $session;
34+
$this->session = $requestStack->getSession();
3435
}
3536

3637
/**

Resources/config/edit_in_place.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ services:
1919
- ~
2020

2121
Translation\Bundle\EditInPlace\Activator:
22-
arguments: ['@session']
22+
arguments: ['@request_stack']
2323
public: true
2424

2525
Translation\Bundle\Translator\EditInPlaceTranslator:

0 commit comments

Comments
 (0)