‪TYPO3CMS  10.4
RequestWrapper.php
Go to the documentation of this file.
1 <?php
2 
3 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 
19 
20 use Psr\Http\Message\ServerRequestInterface;
26 
38 {
42  protected ‪$request;
43 
44  public function ‪__construct(?ServerRequestInterface ‪$request)
45  {
46  $this->request = ‪$request ?? new ‪ServerRequest();
47  }
48 
49  public function ‪getQueryParams(): array
50  {
51  return $this->request->getQueryParams();
52  }
53 
54  public function ‪getParsedBody(): array
55  {
56  return (array)($this->request->getParsedBody() ?? []);
57  }
58 
59  public function ‪getHeaders(): array
60  {
61  return $this->request->getHeaders();
62  }
63 
64  public function ‪getCookieParams(): array
65  {
66  return $this->request->getCookieParams();
67  }
68 
69  public function ‪getSite(): ?‪SiteInterface
70  {
71  return $this->request->getAttribute('site');
72  }
73 
74  public function ‪getSiteLanguage(): ?‪SiteLanguage
75  {
76  return $this->request->getAttribute('language');
77  }
78 
80  {
81  return $this->request->getAttribute('normalizedParams');
82  }
83 
85  {
86  return $this->request->getAttribute('routing');
87  }
88 }
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\$request
‪ServerRequestInterface $request
Definition: RequestWrapper.php:41
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getNormalizedParams
‪getNormalizedParams()
Definition: RequestWrapper.php:78
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper
Definition: RequestWrapper.php:38
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getHeaders
‪getHeaders()
Definition: RequestWrapper.php:58
‪TYPO3\CMS\Core\Site\Entity\SiteInterface
Definition: SiteInterface.php:26
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\__construct
‪__construct(?ServerRequestInterface $request)
Definition: RequestWrapper.php:43
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getSiteLanguage
‪getSiteLanguage()
Definition: RequestWrapper.php:73
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getSite
‪getSite()
Definition: RequestWrapper.php:68
‪TYPO3\CMS\Core\Routing\RouteResultInterface
Definition: RouteResultInterface.php:24
‪TYPO3\CMS\Core\Site\Entity\SiteLanguage
Definition: SiteLanguage.php:26
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getParsedBody
‪getParsedBody()
Definition: RequestWrapper.php:53
‪TYPO3\CMS\Core\Http\ServerRequest
Definition: ServerRequest.php:37
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getPageArguments
‪getPageArguments()
Definition: RequestWrapper.php:83
‪TYPO3\CMS\Core\ExpressionLanguage
Definition: AbstractProvider.php:18
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getCookieParams
‪getCookieParams()
Definition: RequestWrapper.php:63
‪TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper\getQueryParams
‪getQueryParams()
Definition: RequestWrapper.php:48
‪TYPO3\CMS\Core\Http\NormalizedParams
Definition: NormalizedParams.php:35