Skip to content

Commit b489589

Browse files
committed
OXDEV-9078 Cleanup unused code
1 parent bc14f2a commit b489589

59 files changed

Lines changed: 101 additions & 2396 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Authentication/TwoFactorAuth/DTO/NewUser.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/Authentication/TwoFactorAuth/DTO/NewUserInterface.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Authentication/TwoFactorAuth/DTO/User.php

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,19 @@
99

1010
namespace OxidEsales\SecurityModule\Authentication\TwoFactorAuth\DTO;
1111

12-
use DateTimeInterface;
13-
1412
class User implements UserInterface
1513
{
1614
public function __construct(
17-
private readonly string $userId,
18-
private readonly string $email,
19-
private readonly int $attempts,
20-
private readonly ?string $code,
21-
private readonly ?DateTimeInterface $expiresAt,
22-
private readonly ?DateTimeInterface $lastSentAt
15+
private string $userId,
16+
private string $email,
2317
) {
2418
}
2519

26-
public function getId(): string
20+
public function getUserId(): string
2721
{
2822
return $this->userId;
2923
}
3024

31-
public function getCode(): ?string
32-
{
33-
return $this->code;
34-
}
35-
36-
public function getAttempts(): int
37-
{
38-
return $this->attempts;
39-
}
40-
41-
public function getExpiresAt(): ?DateTimeInterface
42-
{
43-
return $this->expiresAt;
44-
}
45-
46-
public function getLastSentAt(): ?DateTimeInterface
47-
{
48-
return $this->lastSentAt;
49-
}
50-
5125
public function getEmail(): string
5226
{
5327
return $this->email;

src/Authentication/TwoFactorAuth/DTO/UserInterface.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,13 @@
55
* See LICENSE file for license details.
66
*/
77

8-
namespace OxidEsales\SecurityModule\Authentication\TwoFactorAuth\DTO;
8+
declare(strict_types=1);
99

10-
use DateTimeInterface;
10+
namespace OxidEsales\SecurityModule\Authentication\TwoFactorAuth\DTO;
1111

1212
interface UserInterface
1313
{
14-
public function getId(): string;
15-
16-
public function getCode(): ?string;
17-
18-
public function getAttempts(): int;
19-
20-
public function getExpiresAt(): ?DateTimeInterface;
21-
22-
public function getLastSentAt(): ?DateTimeInterface;
14+
public function getUserId(): string;
2315

2416
public function getEmail(): string;
2517
}

src/Authentication/TwoFactorAuth/Exception/VerificatorNotFoundException.php

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/Authentication/TwoFactorAuth/Infrastructure/Factory/NewUserFactory.php renamed to src/Authentication/TwoFactorAuth/Infrastructure/Factory/UserFactory.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
namespace OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Infrastructure\Factory;
1111

1212
use OxidEsales\Eshop\Application\Model\User;
13-
use OxidEsales\SecurityModule\Authentication\TwoFactorAuth\DTO\NewUser;
14-
use OxidEsales\SecurityModule\Authentication\TwoFactorAuth\DTO\NewUserInterface;
13+
use OxidEsales\SecurityModule\Authentication\TwoFactorAuth\DTO\User as UserDto;
14+
use OxidEsales\SecurityModule\Authentication\TwoFactorAuth\DTO\UserInterface;
1515

16-
class NewUserFactory implements NewUserFactoryInterface
16+
class UserFactory implements UserFactoryInterface
1717
{
18-
public function createFromModel(User $userModel): NewUserInterface
18+
public function createFromModel(User $userModel): UserInterface
1919
{
20-
return new NewUser(
20+
return new UserDto(
2121
userId: $userModel->getId(),
2222
email: $userModel->getFieldData('oxusername'),
2323
);

src/Authentication/TwoFactorAuth/Infrastructure/Factory/NewUserFactoryInterface.php renamed to src/Authentication/TwoFactorAuth/Infrastructure/Factory/UserFactoryInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
namespace OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Infrastructure\Factory;
1111

1212
use OxidEsales\Eshop\Application\Model\User;
13-
use OxidEsales\SecurityModule\Authentication\TwoFactorAuth\DTO\NewUserInterface;
13+
use OxidEsales\SecurityModule\Authentication\TwoFactorAuth\DTO\UserInterface;
1414

15-
interface NewUserFactoryInterface
15+
interface UserFactoryInterface
1616
{
17-
public function createFromModel(User $userModel): NewUserInterface;
17+
public function createFromModel(User $userModel): UserInterface;
1818
}

src/Authentication/TwoFactorAuth/Infrastructure/Factory/services.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ services:
66
OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Infrastructure\Factory\UserModelFactoryInterface:
77
class: OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Infrastructure\Factory\UserModelFactory
88

9-
OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Infrastructure\Factory\NewUserFactoryInterface:
10-
class: OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Infrastructure\Factory\NewUserFactory
9+
OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Infrastructure\Factory\UserFactoryInterface:
10+
class: OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Infrastructure\Factory\UserFactory
1111

1212
OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Infrastructure\Factory\EmailFactoryInterface:
1313
class: OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Infrastructure\Factory\EmailFactory

src/Authentication/TwoFactorAuth/Infrastructure/Repository/NewUserRepository.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/Authentication/TwoFactorAuth/Infrastructure/Repository/NewUserRepositoryInterface.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)