Skip to content

Commit 17cd4d4

Browse files
author
Philippe Damen
committed
Rename verificationcodeinterface to verificationcodecreatedinterface to avoid confusion
1 parent 7fb12c9 commit 17cd4d4

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ You sometimes may want to exclude one or more characters from the selected or de
6161
The amount of hours it takes for a verification code to expire. You're free to increase this in the config.
6262

6363
### Custom Notification
64-
If you want to use a custom notification to send the verification code, you can create your own notification class which should extend the `VerificationCodeInterface`. Make sure you don't forget to pass the verification code to the mail.
64+
If you want to use a custom notification to send the verification code, you can create your own notification class which should extend the `VerificationCodeCreatedInterface`. Make sure you don't forget to pass the verification code to the mail.
6565

6666
Lastly set the config value `notification` to the full path of your newly created notification.
6767

config/verification-code.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
|
5959
| It should implement the following interfaces:
6060
| - Illuminate\Contracts\Queue\ShouldQueue
61-
| - NextApps\VerificationCode\Notifications\VerificationCodeInterface
61+
| - NextApps\VerificationCode\Notifications\VerificationCodeCreatedInterface
6262
|
6363
*/
6464
'notification' => \NextApps\VerificationCode\Notifications\VerificationCodeCreated::class,

src/Exceptions/InvalidClassException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ class InvalidClassException extends Exception
88
{
99
public static function handle(): self
1010
{
11-
return new static('The notification should extend the VerificationCodeInterface.');
11+
return new static('The notification should extend the VerificationCodeCreatedInterface.');
1212
}
1313
}

src/Notifications/VerificationCodeCreated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Illuminate\Notifications\Messages\MailMessage;
88
use Illuminate\Notifications\Notification;
99

10-
class VerificationCodeCreated extends Notification implements ShouldQueue, VerificationCodeInterface
10+
class VerificationCodeCreated extends Notification implements ShouldQueue, VerificationCodeCreatedInterface
1111
{
1212
use Queueable;
1313

src/Notifications/VerificationCodeInterface.php renamed to src/Notifications/VerificationCodeCreatedInterface.php

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

33
namespace NextApps\VerificationCode\Notifications;
44

5-
interface VerificationCodeInterface
5+
interface VerificationCodeCreatedInterface
66
{
77
/**
88
* Create a new message instance.

src/VerificationCodeManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use NextApps\VerificationCode\Exceptions\InvalidClassException;
88
use NextApps\VerificationCode\Models\VerificationCode;
99
use NextApps\VerificationCode\Notifications\VerificationCodeCreated;
10-
use NextApps\VerificationCode\Notifications\VerificationCodeInterface;
10+
use NextApps\VerificationCode\Notifications\VerificationCodeCreatedInterface;
1111

1212
class VerificationCodeManager
1313
{
@@ -25,7 +25,7 @@ public function send($verifiable, $channel = 'mail')
2525
$notificationClass = config('verification-code.notification', VerificationCodeCreated::class);
2626
$queue = config('verification-code.queue', null);
2727

28-
if (! is_subclass_of($notificationClass, VerificationCodeInterface::class)) {
28+
if (! is_subclass_of($notificationClass, VerificationCodeCreatedInterface::class)) {
2929
throw InvalidClassException::handle();
3030
}
3131

tests/VerificationCodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ function ($notification, $channels, $notifiable) use ($email) {
197197
public function it_throws_an_error_if_notification_does_not_extend_the_verification_notification_class()
198198
{
199199
$this->expectException(InvalidClassException::class);
200-
$this->expectExceptionMessage('The notification should extend the VerificationCodeInterface.');
200+
$this->expectExceptionMessage('The notification should extend the VerificationCodeCreatedInterface.');
201201
$email = $this->faker->safeEmail;
202202

203203
config()->set('verification-code.notification', WrongNotification::class);

0 commit comments

Comments
 (0)