X-Git-Url: https://git.rapsys.eu/packbundle/blobdiff_plain/59ae967e218457b2ab3d77cb621c0640345f5e9b..884434e58dda34f2c3f780999c74f8d6a11569d5:/Context/RequestStackContext.php diff --git a/Context/RequestStackContext.php b/Context/RequestStackContext.php index 0421de7..366e167 100644 --- a/Context/RequestStackContext.php +++ b/Context/RequestStackContext.php @@ -18,24 +18,12 @@ use Symfony\Component\HttpFoundation\RequestStack; * {@inheritdoc} */ class RequestStackContext extends BaseRequestStackContext { - //RequestStack instance - private $requestStack; - - //Base path - private $basePath; - /** * {@inheritdoc} */ - public function __construct(RequestStack $requestStack, string $basePath = '', bool $secure = false) { + public function __construct(protected RequestStack $requestStack, protected string $basePath = '', protected bool $secure = false) { //Call parent constructor parent::__construct($requestStack, $basePath, $secure); - - //Set request stack - $this->requestStack = $requestStack; - - //Set base path - $this->basePath = $basePath; } /** @@ -45,7 +33,7 @@ class RequestStackContext extends BaseRequestStackContext { */ public function getBaseUrl(): string { //Without request - if (!$request = $this->requestStack->getMasterRequest()) { + if (!$request = $this->requestStack->getMainRequest()) { //Return base path return $this->basePath; }