-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README.md * Fix: call_user_func expects callable, Closure given * Fix Closure(mixed) type issues * Formatting * Remove phpstan ignore * Add Lighthouse guard configuration section to README.md * Fix: call_user_func expects callable, Closure given * Fix Closure(mixed) type issues * Formatting * Remove phpstan ignore * Max phpstan level without ignoring errors * normalize composer.json * Ignore files for dist checkout * Ignore files for dist checkout * Update README.md
- Loading branch information
1 parent
a2618ab
commit ac7f617
Showing
14 changed files
with
73 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ coverage | |
.phpunit.cache | ||
.php_cs.cache | ||
.php_cs.tests.cache | ||
phpunit.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Illuminate\Notifications; | ||
|
||
class Notification | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Illuminate\Auth\Notifications; | ||
|
||
use Illuminate\Contracts\Auth\CanResetPassword; | ||
use Illuminate\Notifications\Notification; | ||
|
||
class ResetPassword extends Notification | ||
{ | ||
/** | ||
* Set a callback that should be used when creating the reset password button URL. | ||
* | ||
* @param \Closure(CanResetPassword, string): string $callback | ||
* @return void | ||
*/ | ||
public static function createUrlUsing($callback) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Illuminate\Contracts\Auth; | ||
|
||
interface CanResetPassword | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,8 @@ public function it_sends_a_reset_password_notification(): void | |
]); | ||
|
||
Notification::assertSentTo($user, function (ResetPassword $notification) use ($user) { | ||
/** @phpstan-ignore-next-line */ | ||
static::assertIsCallable($notification::$createUrlCallback); | ||
|
||
$url = call_user_func($notification::$createUrlCallback, $user, $notification->token); | ||
|
||
return $url === "https://my-front-end.com/[email protected]&token={$notification->token}"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,8 @@ public function it_resends_an_email_verification_notification(): void | |
static::assertSame('EMAIL_SENT', $response->json('data.resendEmailVerification.status')); | ||
|
||
Notification::assertSentTo($user, function (VerifyEmail $notification) use ($user) { | ||
static::assertIsCallable($notification::$createUrlCallback); | ||
|
||
$url = call_user_func($notification::$createUrlCallback, $user); | ||
|
||
$hash = sha1('[email protected]'); | ||
|
@@ -98,6 +100,8 @@ public function it_resends_a_signed_email_verification_notification(): void | |
static::assertSame('EMAIL_SENT', $response->json('data.resendEmailVerification.status')); | ||
|
||
Notification::assertSentTo($user, function (VerifyEmail $notification) use ($user) { | ||
static::assertIsCallable($notification::$createUrlCallback); | ||
|
||
$url = call_user_func($notification::$createUrlCallback, $user); | ||
|
||
$hash = sha1('[email protected]'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,8 @@ public function it_sets_the_verification_url(): void | |
|
||
$this->service->setVerificationUrl('https://mysite.com/verify-email/__ID__/__HASH__'); | ||
|
||
static::assertIsCallable(VerifyEmail::$createUrlCallback); | ||
|
||
$url = call_user_func(VerifyEmail::$createUrlCallback, $user); | ||
|
||
static::assertSame('https://mysite.com/verify-email/12345/' . sha1('[email protected]'), $url); | ||
|
@@ -102,6 +104,8 @@ public function it_sets_the_signed_verification_url(): void | |
|
||
$this->service->setVerificationUrl('https://mysite.com/verify-email/__ID__/__HASH__/__EXPIRES__/__SIGNATURE__'); | ||
|
||
static::assertIsCallable(VerifyEmail::$createUrlCallback); | ||
|
||
$url = call_user_func(VerifyEmail::$createUrlCallback, $user); | ||
|
||
$signature = hash_hmac('sha256', serialize([ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,8 @@ public function it_sets_the_reset_password_url(): void | |
|
||
$this->service->setResetPasswordUrl('https://mysite.com/reset-password/__EMAIL__/__TOKEN__'); | ||
|
||
/** @phpstan-ignore-next-line */ | ||
static::assertIsCallable(ResetPassword::$createUrlCallback); | ||
|
||
$url = call_user_func(ResetPassword::$createUrlCallback, $user, $token); | ||
|
||
static::assertSame('https://mysite.com/reset-password/[email protected]/token123', $url); | ||
|