Skip to content

Commit

Permalink
fix use RequestStack instead of Request
Browse files Browse the repository at this point in the history
  • Loading branch information
upskaling committed Aug 29, 2023
1 parent 85c2061 commit a95cd7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Cookie/CookieChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use ConnectHolland\CookieConsentBundle\Enum\CookieNameEnum;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;

class CookieChecker
{
Expand All @@ -20,9 +21,9 @@ class CookieChecker
*/
private $request;

public function __construct(Request $request)
public function __construct(RequestStack $request)
{
$this->request = $request;
$this->request = $request->getCurrentRequest();
}

/**
Expand Down
3 changes: 2 additions & 1 deletion Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ services:
public: true

ConnectHolland\CookieConsentBundle\Cookie\CookieChecker:
arguments: ["@=service('request_stack').getCurrentRequest()"]
arguments:
$request: '@request_stack'

ConnectHolland\CookieConsentBundle\Cookie\CookieLogger:
arguments:
Expand Down

0 comments on commit a95cd7d

Please sign in to comment.