-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[12.x] use type declarations for Auth events #53969
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
namespace Illuminate\Auth\Events; | ||
|
||
use Illuminate\Contracts\Auth\Authenticatable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class Logout | ||
|
@@ -16,8 +17,8 @@ class Logout | |
* @return void | ||
*/ | ||
public function __construct( | ||
public $guard, | ||
public $user, | ||
public string $guard, | ||
public Authenticatable $user, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yah, i need to dig into this PR a little more. this is where it gets tricky, because do we change what the Event accepts? or do we force the calling code to actually follow what the event wants. even with just this small PR, it's clear there are some things that just naturally slipped through since we've been looser with our types so far. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was chatting to Taylor about this and suggested we go deeper on static analysis insights before we make refactors like this. Hopefully that would help expose places where the dockblocks are lying. We don't want to be unintentionally introducing breaking changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yah, anything we can do to move us towards more strict typing I'm down for that. I'd think I'd be on the side of forcing the calling code to adjust, for the most part. glad you guys are talking about it internally. would love to help how I can. |
||
) { | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add the docblock here that we would otherwise lose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, thanks