Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Exception/ExpiredSignatureException.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

declare(strict_types=1);

/*
* This file is part of the SymfonyCasts VerifyEmailBundle package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace SymfonyCasts\Bundle\VerifyEmail\Exception;

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Exception/InvalidSignatureException.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

declare(strict_types=1);

/*
* This file is part of the SymfonyCasts VerifyEmailBundle package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace SymfonyCasts\Bundle\VerifyEmail\Exception;

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Exception/VerifyEmailExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

declare(strict_types=1);

/*
* This file is part of the SymfonyCasts VerifyEmailBundle package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace SymfonyCasts\Bundle\VerifyEmail\Exception;

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Exception/VerifyEmailRuntimeException.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

declare(strict_types=1);

/*
* This file is part of the SymfonyCasts VerifyEmailBundle package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace SymfonyCasts\Bundle\VerifyEmail\Exception;

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Exception/WrongEmailVerifyException.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

declare(strict_types=1);

/*
* This file is part of the SymfonyCasts VerifyEmailBundle package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace SymfonyCasts\Bundle\VerifyEmail\Exception;

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Factory/UriSignerFactory.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

declare(strict_types=1);

/*
* This file is part of the SymfonyCasts VerifyEmailBundle package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace SymfonyCasts\Bundle\VerifyEmail\Factory;

use Symfony\Component\HttpFoundation\UriSigner;
Expand All @@ -19,10 +20,11 @@
*
* @internal
*/
final class UriSignerFactory
final readonly class UriSignerFactory
{
public function __construct(
#[\SensitiveParameter]

private string $secret,
private string $parameter = '_hash',
) {
Expand Down
9 changes: 5 additions & 4 deletions src/Generator/VerifyEmailTokenGenerator.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

declare(strict_types=1);

/*
* This file is part of the SymfonyCasts VerifyEmailBundle package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace SymfonyCasts\Bundle\VerifyEmail\Generator;

use SymfonyCasts\Bundle\VerifyEmail\Exception\VerifyEmailRuntimeException;
Expand All @@ -26,7 +27,7 @@ class VerifyEmailTokenGenerator
*/
public function __construct(
#[\SensitiveParameter]
private string $signingKey,
private readonly string $signingKey,
) {
}

Expand All @@ -39,8 +40,8 @@ public function createToken(string $userId, string $email): string
{
try {
$encodedData = json_encode([$userId, $email], \JSON_THROW_ON_ERROR);
} catch (\JsonException $exception) {
throw new VerifyEmailRuntimeException(message: 'Unable to create token. Invalid JSON.', previous: $exception);
} catch (\JsonException $jsonException) {
throw new VerifyEmailRuntimeException(message: 'Unable to create token. Invalid JSON.', previous: $jsonException);
}

return base64_encode(hash_hmac('sha256', $encodedData, $this->signingKey, true));
Expand Down
9 changes: 5 additions & 4 deletions src/Model/VerifyEmailSignatureComponents.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

declare(strict_types=1);

/*
* This file is part of the SymfonyCasts VerifyEmailBundle package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace SymfonyCasts\Bundle\VerifyEmail\Model;

use SymfonyCasts\Bundle\VerifyEmail\Exception\VerifyEmailRuntimeException;
Expand All @@ -26,9 +27,9 @@ final class VerifyEmailSignatureComponents
* @param int $generatedAt timestamp when the signature was created
*/
public function __construct(
private \DateTimeInterface $expiresAt,
private string $uri,
private int $generatedAt,
private readonly \DateTimeInterface $expiresAt,
private readonly string $uri,
private readonly int $generatedAt,
) {
}

Expand Down
3 changes: 2 additions & 1 deletion src/SymfonyCastsVerifyEmailBundle.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

declare(strict_types=1);

/*
* This file is part of the SymfonyCasts VerifyEmailBundle package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace SymfonyCasts\Bundle\VerifyEmail;

use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator;
Expand Down
3 changes: 2 additions & 1 deletion src/Util/VerifyEmailQueryUtility.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

declare(strict_types=1);

/*
* This file is part of the SymfonyCasts VerifyEmailBundle package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace SymfonyCasts\Bundle\VerifyEmail\Util;

/**
Expand Down
5 changes: 3 additions & 2 deletions src/VerifyEmailHelper.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

declare(strict_types=1);

/*
* This file is part of the SymfonyCasts VerifyEmailBundle package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace SymfonyCasts\Bundle\VerifyEmail;

use Symfony\Component\HttpFoundation\Request;
Expand All @@ -23,7 +24,7 @@
* @author Jesse Rushlow <[email protected]>
* @author Ryan Weaver <[email protected]>
*/
final class VerifyEmailHelper implements VerifyEmailHelperInterface
final readonly class VerifyEmailHelper implements VerifyEmailHelperInterface
{
/**
* @param int $lifetime The length of time in seconds that a signed URI is valid for after it is created
Expand Down
3 changes: 2 additions & 1 deletion src/VerifyEmailHelperInterface.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

declare(strict_types=1);

/*
* This file is part of the SymfonyCasts VerifyEmailBundle package.
* Copyright (c) SymfonyCasts <https://symfonycasts.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace SymfonyCasts\Bundle\VerifyEmail;

use Symfony\Component\HttpFoundation\Request;
Expand Down
Loading