‪TYPO3CMS  9.5
RequestWrapper.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
18 use Psr\Http\Message\ServerRequestInterface;
24 
36 {
40  protected ‪$request;
41 
42  public function ‪__construct(?ServerRequestInterface ‪$request)
43  {
44  $this->request = ‪$request ?? new ‪ServerRequest();
45  }
46 
47  public function ‪getQueryParams(): array
48  {
49  return $this->request->getQueryParams();
50  }
51 
52  public function ‪getParsedBody(): array
53  {
54  return (array)($this->request->getParsedBody() ?? []);
55  }
56 
57  public function ‪getHeaders(): array
58  {
59  return $this->request->getHeaders();
60  }
61 
62  public function ‪getCookieParams(): array
63  {
64  return $this->request->getCookieParams();
65  }
66 
67  public function ‪getSite(): ?‪SiteInterface
68  {
69  return $this->request->getAttribute('site');
70  }
71 
72  public function ‪getSiteLanguage(): ?‪SiteLanguage
73  {
74  return $this->request->getAttribute('language');
75  }
76 
78  {
79  return $this->request->getAttribute('normalizedParams');
80  }
81 
83  {
84  return $this->request->getAttribute('routing');
85  }
86 }
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\$request
‪ServerRequestInterface $request
Definition: RequestWrapper.php:39
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getNormalizedParams
‪getNormalizedParams()
Definition: RequestWrapper.php:76
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper
Definition: RequestWrapper.php:36
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getHeaders
‪getHeaders()
Definition: RequestWrapper.php:56
‪TYPO3\CMS\Core\Site\Entity\SiteInterface
Definition: SiteInterface.php:25
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\__construct
‪__construct(?ServerRequestInterface $request)
Definition: RequestWrapper.php:41
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getSiteLanguage
‪getSiteLanguage()
Definition: RequestWrapper.php:71
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getSite
‪getSite()
Definition: RequestWrapper.php:66
‪TYPO3\CMS\Core\Routing\RouteResultInterface
Definition: RouteResultInterface.php:23
‪TYPO3\CMS\Core\Site\Entity\SiteLanguage
Definition: SiteLanguage.php:25
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getParsedBody
‪getParsedBody()
Definition: RequestWrapper.php:51
‪TYPO3\CMS\Core\Http\ServerRequest
Definition: ServerRequest.php:35
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getPageArguments
‪getPageArguments()
Definition: RequestWrapper.php:81
‪TYPO3\CMS\Core\ExpressionLanguage
Definition: AbstractProvider.php:3
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getCookieParams
‪getCookieParams()
Definition: RequestWrapper.php:61
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getQueryParams
‪getQueryParams()
Definition: RequestWrapper.php:46
‪TYPO3\CMS\Core\Http\NormalizedParams
Definition: NormalizedParams.php:32