You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -273,6 +273,13 @@ _Optional_ - Defaults to `3600` seconds
273
273
This is the length of time a signed URL is valid for in seconds after it has
274
274
been created.
275
275
276
+
#### `use_relative_path`
277
+
278
+
_Optional_ – Defaults to `false`
279
+
280
+
If set to `true`, the generated verification URL will use a relative path instead of an absolute URL.
281
+
This is useful if your app is accessible under multiple domains or customer-specific subdomains, as the host will be determined dynamically by the user's current request.
282
+
276
283
## Reserved Query Parameters
277
284
278
285
If you add any extra query parameters in the 5th argument of `verifyEmailHelper::generateSignature()`,
Copy file name to clipboardExpand all lines: phpstan-baseline.neon
+22-47Lines changed: 22 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -5,16 +5,6 @@ parameters:
5
5
count:1
6
6
path:src/DependencyInjection/Configuration.php
7
7
8
-
-
9
-
message:"#^Instantiated class Symfony\\\\Component\\\\HttpKernel\\\\UriSigner not found\\.$#"
10
-
count:1
11
-
path:src/Factory/UriSignerFactory.php
12
-
13
-
-
14
-
message:"#^Method SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\Factory\\\\UriSignerFactory\\:\\:createUriSigner\\(\\) has invalid return type Symfony\\\\Component\\\\HttpKernel\\\\UriSigner\\.$#"
15
-
count:1
16
-
path:src/Factory/UriSignerFactory.php
17
-
18
8
-
19
9
message:"#^Parameter \\#2 \\$data of function hash_hmac expects string, string\\|false given\\.$#"
20
10
count:1
@@ -45,16 +35,6 @@ parameters:
45
35
count:1
46
36
path:src/Util/VerifyEmailQueryUtility.php
47
37
48
-
-
49
-
message:"#^Call to method check\\(\\) on an unknown class Symfony\\\\Component\\\\HttpKernel\\\\UriSigner\\.$#"
50
-
count:1
51
-
path:src/VerifyEmailHelper.php
52
-
53
-
-
54
-
message:"#^Call to method sign\\(\\) on an unknown class Symfony\\\\Component\\\\HttpKernel\\\\UriSigner\\.$#"
55
-
count:1
56
-
path:src/VerifyEmailHelper.php
57
-
58
38
-
59
39
message:"#^Method SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\VerifyEmailHelper\\:\\:__construct\\(\\) has parameter \\$uriSigner with no type specified\\.$#"
60
40
count:1
@@ -86,7 +66,12 @@ parameters:
86
66
path:src/VerifyEmailHelper.php
87
67
88
68
-
89
-
message:"#^Property SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\VerifyEmailHelper\\:\\:\\$uriSigner has unknown class Symfony\\\\Component\\\\HttpKernel\\\\UriSigner as its type\\.$#"
69
+
message:"#^Property SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\VerifyEmailHelper\\:\\:\\$useRelativePath has no type specified\\.$#"
70
+
count:1
71
+
path:src/VerifyEmailHelper.php
72
+
73
+
-
74
+
message:"#^Instanceof between Symfony\\\\Component\\\\HttpFoundation\\\\UriSigner and Symfony\\\\Component\\\\HttpFoundation\\\\UriSigner will always evaluate to true\\.$#"
90
75
count:1
91
76
path:src/VerifyEmailHelper.php
92
77
@@ -97,44 +82,29 @@ parameters:
97
82
98
83
-
99
84
message:"#^Access to an undefined property object\\:\\:\\$helper\\.$#"
message:"#^Parameter \\$uriSigner of method SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\Tests\\\\AcceptanceTests\\\\VerifyEmailAcceptanceFixture\\:\\:__construct\\(\\) has invalid type Symfony\\\\Component\\\\HttpKernel\\\\UriSigner\\.$#"
115
-
count:1
94
+
message:"#^Call to method PHPUnit\\\\Framework\\\\Assert::assertTrue\\(\\) with true and 'Test correctly does.*' will always evaluate to true\\.$#"
message:"#^Property SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\Tests\\\\AcceptanceTests\\\\VerifyEmailAcceptanceFixture\\:\\:\\$uriSigner has unknown class Symfony\\\\Component\\\\HttpKernel\\\\UriSigner as its type\\.$#"
99
+
message:"#^Method SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\Tests\\\\AcceptanceTests\\\\VerifyEmailAcceptanceTest\\:\\:getBootedKernel\\(\\) has parameter \\$customConfig with no value type specified in iterable type array\\.$#"
message:"#^Method SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\Tests\\\\FunctionalTests\\\\VerifyEmailHelperFunctionalTest\\:\\:getTestSignature\\(\\) is unused\\.$#"
message:"#^Property SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\Tests\\\\FunctionalTests\\\\VerifyEmailHelperFunctionalTest\\:\\:\\$uriSigner has unknown class Symfony\\\\Component\\\\HttpKernel\\\\UriSigner as its type\\.$#"
129
+
message:"#^Call to method PHPUnit\\\\Framework\\\\Assert::assertTrue\\(\\) with true and 'Test correctly does.*' will always evaluate to true\\.$#"
message:"#^Class Symfony\\\\Component\\\\HttpKernel\\\\UriSigner not found\\.$#"
200
-
count:1
201
-
path:tests/UnitTests/VerifyEmailHelperTest.php
202
-
203
168
-
204
169
message:"#^Property SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\Tests\\\\UnitTests\\\\VerifyEmailHelperTest\\:\\:\\$mockQueryUtility has no type specified\\.$#"
205
170
count:1
@@ -225,6 +190,11 @@ parameters:
225
190
count:1
226
191
path:tests/VerifyEmailTestKernel.php
227
192
193
+
-
194
+
message:"#^Method SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\Tests\\\\VerifyEmailTestKernel\\:\\:__construct\\(\\) has parameter \\$customConfig with no value type specified in iterable type array\\.$#"
195
+
count:1
196
+
path:tests/VerifyEmailTestKernel.php
197
+
228
198
-
229
199
message:"#^Property SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\Tests\\\\VerifyEmailTestKernel\\:\\:\\$builder has no type specified\\.$#"
230
200
count:1
@@ -239,3 +209,8 @@ parameters:
239
209
message:"#^Property SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\Tests\\\\VerifyEmailTestKernel\\:\\:\\$routes has no type specified\\.$#"
240
210
count:1
241
211
path:tests/VerifyEmailTestKernel.php
212
+
213
+
-
214
+
message:"#^Property SymfonyCasts\\\\Bundle\\\\VerifyEmail\\\\Tests\\\\VerifyEmailTestKernel\\:\\:\\$customConfig type has no value type specified in iterable type array\\.$#"
Copy file name to clipboardExpand all lines: src/VerifyEmailHelper.php
+57-4Lines changed: 57 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -38,14 +38,16 @@ final class VerifyEmailHelper implements VerifyEmailHelperInterface
38
38
* @var int The length of time in seconds that a signed URI is valid for after it is created
39
39
*/
40
40
private$lifetime;
41
+
private$useRelativePath;
41
42
42
-
publicfunction__construct(UrlGeneratorInterface$router, /* no typehint for BC with legacy PHP */$uriSigner, VerifyEmailQueryUtility$queryUtility, VerifyEmailTokenGenerator$generator, int$lifetime)
43
+
publicfunction__construct(UrlGeneratorInterface$router, /* no typehint for BC with legacy PHP */$uriSigner, VerifyEmailQueryUtility$queryUtility, VerifyEmailTokenGenerator$generator, int$lifetime, bool$useRelativePath)
43
44
{
44
45
$this->router = $router;
45
46
$this->uriSigner = $uriSigner;
46
47
$this->queryUtility = $queryUtility;
47
48
$this->tokenGenerator = $generator;
48
49
$this->lifetime = $lifetime;
50
+
$this->useRelativePath = $useRelativePath;
49
51
50
52
if (!$uriSignerinstanceof UriSigner) {
51
53
/** @psalm-suppress UndefinedFunction */
@@ -63,10 +65,8 @@ public function generateSignature(string $routeName, string $userId, string $use
0 commit comments