File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Mkdev \LaravelAdvancedOTP \Exceptions ;
4
+ use Exception ;
5
+
6
+ class InvalidOTPMethodException extends Exception
7
+ {
8
+ public function __construct ()
9
+ {
10
+ parent ::__construct ();
11
+ }
12
+ }
Original file line number Diff line number Diff line change 3
3
namespace Mkdev \LaravelAdvancedOTP ;
4
4
5
5
6
- use http \Exception \BadConversionException ;
7
6
use Mkdev \LaravelAdvancedOTP \Contracts \OTPProviderContract ;
8
7
use Mkdev \LaravelAdvancedOTP \Enums \OTPStatusEnum ;
8
+ use Mkdev \LaravelAdvancedOTP \Exceptions \InvalidOTPMethodException ;
9
9
use Mkdev \LaravelAdvancedOTP \Interfaces \OTPProviderInterface ;
10
10
11
11
class LaravelAdvancedOTP
12
12
{
13
13
14
-
15
14
private function getMethod (string $ method )
16
15
{
17
16
$ otpMethod = new $ method ();
18
17
if (!$ otpMethod instanceof OTPProviderContract) {
19
- throw new BadConversionException ;
18
+ throw new InvalidOTPMethodException ;
20
19
}
21
20
return $ otpMethod ;
22
21
}
You can’t perform that action at this time.
0 commit comments