Skip to content

Commit 96427d7

Browse files
committed
OXDEV-9078 Adjust exceptions tree
More clear structure and naming. The base TwoFAException to clearly see where issue is coming from.
1 parent 4d4c9b3 commit 96427d7

18 files changed

Lines changed: 119 additions & 12 deletions

src/Authentication/TwoFactorAuth/Exception/AttemptLimitExceededException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

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

12-
class AttemptLimitExceededException extends OTPValidationException
12+
class AttemptLimitExceededException extends CodeValidationException
1313
{
1414
public function __construct()
1515
{

src/Authentication/TwoFactorAuth/Exception/AuthenticationTypeNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

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

12-
class AuthenticationTypeNotFoundException extends \Exception
12+
class AuthenticationTypeNotFoundException extends TwoFAException
1313
{
1414
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
/**
4+
* Copyright © OXID eSales AG. All rights reserved.
5+
* See LICENSE file for license details.
6+
*/
7+
8+
declare(strict_types=1);
9+
10+
namespace OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Exception;
11+
12+
class CodeValidationException extends TwoFAException
13+
{
14+
}

src/Authentication/TwoFactorAuth/Exception/InvalidCodeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

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

12-
class InvalidCodeException extends OTPValidationException
12+
class InvalidCodeException extends CodeValidationException
1313
{
1414
public function __construct()
1515
{
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/**
4+
* Copyright © OXID eSales AG. All rights reserved.
5+
* See LICENSE file for license details.
6+
*/
7+
8+
declare(strict_types=1);
9+
10+
namespace OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Exception;
11+
12+
class MalformedRequestException extends TwoFAException
13+
{
14+
public function __construct()
15+
{
16+
parent::__construct('ERROR_MALFORMED_REQUEST');
17+
}
18+
}

src/Authentication/TwoFactorAuth/Exception/NotifierNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

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

12-
class NotifierNotFoundException extends \Exception
12+
class NotifierNotFoundException extends TwoFAException
1313
{
1414
}

src/Authentication/TwoFactorAuth/Exception/TimeExpiredException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

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

12-
class TimeExpiredException extends OTPValidationException
12+
class TimeExpiredException extends CodeValidationException
1313
{
1414
public function __construct()
1515
{

src/Authentication/TwoFactorAuth/Exception/OTPValidationException.php renamed to src/Authentication/TwoFactorAuth/Exception/TwoFAException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111

1212
use OxidEsales\Eshop\Core\Exception\StandardException;
1313

14-
class OTPValidationException extends StandardException
14+
class TwoFAException extends StandardException
1515
{
1616
}

src/Authentication/TwoFactorAuth/Exception/UserNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

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

12-
class UserNotFoundException extends \Exception
12+
class UserNotFoundException extends TwoFAException
1313
{
1414
}

src/Authentication/TwoFactorAuth/Exception/VerificatorNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

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

12-
class VerificatorNotFoundException extends \Exception
12+
class VerificatorNotFoundException extends TwoFAException
1313
{
1414
public function __construct()
1515
{

0 commit comments

Comments
 (0)