@@ -14,13 +14,8 @@ class VerificationCodeManager
14
14
{
15
15
/**
16
16
* Create and send a verification code.
17
- *
18
- * @param string $verifiable
19
- * @param string $channel
20
- *
21
- * @return void
22
17
*/
23
- public function send (string $ verifiable , string $ channel = 'mail ' )
18
+ public function send (string $ verifiable , string $ channel = 'mail ' ) : void
24
19
{
25
20
if ($ this ->isTestVerifiable ($ verifiable )) {
26
21
return ;
@@ -38,16 +33,7 @@ public function send(string $verifiable, string $channel = 'mail')
38
33
Notification::route ($ channel , $ verifiable )->notify ($ notification );
39
34
}
40
35
41
- /**
42
- * Verify the code.
43
- *
44
- * @param string $code
45
- * @param string $verifiable
46
- * @param bool $deleteAfterVerification
47
- *
48
- * @return bool
49
- */
50
- public function verify (string $ code , string $ verifiable , bool $ deleteAfterVerification = true )
36
+ public function verify (string $ code , string $ verifiable , bool $ deleteAfterVerification = true ) : bool
51
37
{
52
38
if ($ this ->isTestVerifiable ($ verifiable )) {
53
39
return $ this ->isTestCode ($ code );
@@ -72,14 +58,7 @@ public function verify(string $code, string $verifiable, bool $deleteAfterVerifi
72
58
return true ;
73
59
}
74
60
75
- /**
76
- * Check if the verifiable is a test verifiable.
77
- *
78
- * @param string $verifiable
79
- *
80
- * @return bool
81
- */
82
- protected function isTestVerifiable (string $ verifiable )
61
+ protected function isTestVerifiable (string $ verifiable ) : bool
83
62
{
84
63
$ testVerifiables = config ('verification-code.test_verifiables ' , []);
85
64
@@ -90,14 +69,7 @@ protected function isTestVerifiable(string $verifiable)
90
69
return in_array (strtolower ($ verifiable ), $ testVerifiables );
91
70
}
92
71
93
- /**
94
- * Check if the code is the test code.
95
- *
96
- * @param string $code
97
- *
98
- * @return bool
99
- */
100
- protected function isTestCode (string $ code )
72
+ protected function isTestCode (string $ code ) : bool
101
73
{
102
74
if (empty (config ('verification-code.test_code ' ))) {
103
75
return false ;
@@ -106,14 +78,7 @@ protected function isTestCode(string $code)
106
78
return $ code === config ('verification-code.test_code ' );
107
79
}
108
80
109
- /**
110
- * Get the notification class.
111
- *
112
- * @throws \RuntimeException
113
- *
114
- * @return string
115
- */
116
- protected function getNotificationClass ()
81
+ protected function getNotificationClass () : string
117
82
{
118
83
$ notificationClass = config ('verification-code.notification ' , VerificationCodeCreated::class);
119
84
0 commit comments