@@ -51,10 +51,8 @@ public function __construct(UrlGeneratorInterface $urlGenerator = null, UrlMatch
51
51
*
52
52
* @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
53
53
* @param int $status The status code
54
- *
55
- * @return RedirectResponse
56
54
*/
57
- public function createRedirectResponse (Request $ request , string $ path , int $ status = 302 )
55
+ public function createRedirectResponse (Request $ request , string $ path , int $ status = 302 ): RedirectResponse
58
56
{
59
57
if (null !== $ this ->secureDomainRegexp && 'https ' === $ this ->urlMatcher ->getContext ()->getScheme () && preg_match ('#^https?:[/ \\\\]{2,}+[^/]++#i ' , $ path , $ host ) && !preg_match (sprintf ($ this ->secureDomainRegexp , preg_quote ($ request ->getHttpHost ())), $ host [0 ])) {
60
58
$ path = '/ ' ;
@@ -70,10 +68,8 @@ public function createRedirectResponse(Request $request, string $path, int $stat
70
68
* Creates a Request.
71
69
*
72
70
* @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
73
- *
74
- * @return Request
75
71
*/
76
- public function createRequest (Request $ request , string $ path )
72
+ public function createRequest (Request $ request , string $ path ): Request
77
73
{
78
74
$ newRequest = Request::create ($ this ->generateUri ($ request , $ path ), 'get ' , [], $ request ->cookies ->all (), [], $ request ->server ->all ());
79
75
@@ -111,7 +107,7 @@ public function createRequest(Request $request, string $path)
111
107
*
112
108
* @return bool true if the path is the same as the one from the Request, false otherwise
113
109
*/
114
- public function checkRequestPath (Request $ request , string $ path )
110
+ public function checkRequestPath (Request $ request , string $ path ): bool
115
111
{
116
112
if ('/ ' !== $ path [0 ]) {
117
113
try {
@@ -138,11 +134,9 @@ public function checkRequestPath(Request $request, string $path)
138
134
*
139
135
* @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
140
136
*
141
- * @return string
142
- *
143
137
* @throws \LogicException
144
138
*/
145
- public function generateUri (Request $ request , string $ path )
139
+ public function generateUri (Request $ request , string $ path ): string
146
140
{
147
141
if (str_starts_with ($ path , 'http ' ) || !$ path ) {
148
142
return $ path ;
0 commit comments