Skip to content
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

Revert "[11.x] use promoted properties" #53832

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions src/Illuminate/Auth/Access/Events/GateEvaluated.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@

class GateEvaluated
{
/**
* The authenticatable model.
*
* @var \Illuminate\Contracts\Auth\Authenticatable|null
*/
public $user;

/**
* The ability being evaluated.
*
* @var string
*/
public $ability;

/**
* The result of the evaluation.
*
* @var bool|null
*/
public $result;

/**
* The arguments given during evaluation.
*
* @var array
*/
public $arguments;

/**
* Create a new event instance.
*
Expand All @@ -13,11 +41,11 @@ class GateEvaluated
* @param array $arguments
* @return void
*/
public function __construct(
public $user,
public $ability,
public $result,
public $arguments,
) {
public function __construct($user, $ability, $result, $arguments)
{
$this->user = $user;
$this->ability = $ability;
$this->result = $result;
$this->arguments = $arguments;
}
}
31 changes: 26 additions & 5 deletions src/Illuminate/Auth/DatabaseUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@

class DatabaseUserProvider implements UserProvider
{
/**
* The active database connection.
*
* @var \Illuminate\Database\ConnectionInterface
*/
protected $connection;

/**
* The hasher implementation.
*
* @var \Illuminate\Contracts\Hashing\Hasher
*/
protected $hasher;

/**
* The table containing the users.
*
* @var string
*/
protected $table;

/**
* Create a new database user provider.
*
Expand All @@ -19,11 +40,11 @@ class DatabaseUserProvider implements UserProvider
* @param string $table
* @return void
*/
public function __construct(
protected ConnectionInterface $connection,
protected HasherContract $hasher,
protected $table,
) {
public function __construct(ConnectionInterface $connection, HasherContract $hasher, $table)
{
$this->connection = $connection;
$this->table = $table;
$this->hasher = $hasher;
}

/**
Expand Down
22 changes: 18 additions & 4 deletions src/Illuminate/Auth/EloquentUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@

class EloquentUserProvider implements UserProvider
{
/**
* The hasher implementation.
*
* @var \Illuminate\Contracts\Hashing\Hasher
*/
protected $hasher;

/**
* The Eloquent user model.
*
* @var string
*/
protected $model;

/**
* The callback that may modify the user retrieval queries.
*
Expand All @@ -24,10 +38,10 @@ class EloquentUserProvider implements UserProvider
* @param string $model
* @return void
*/
public function __construct(
protected HasherContract $hasher,
protected $model,
) {
public function __construct(HasherContract $hasher, $model)
{
$this->model = $model;
$this->hasher = $hasher;
}

/**
Expand Down
31 changes: 26 additions & 5 deletions src/Illuminate/Auth/Events/Attempting.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@

class Attempting
{
/**
* The authentication guard name.
*
* @var string
*/
public $guard;

/**
* The credentials for the user.
*
* @var array
*/
public $credentials;

/**
* Indicates if the user should be "remembered".
*
* @var bool
*/
public $remember;

/**
* Create a new event instance.
*
Expand All @@ -12,10 +33,10 @@ class Attempting
* @param bool $remember
* @return void
*/
public function __construct(
public $guard,
#[\SensitiveParameter] public $credentials,
public $remember,
) {
public function __construct($guard, #[\SensitiveParameter] $credentials, $remember)
{
$this->guard = $guard;
$this->remember = $remember;
$this->credentials = $credentials;
}
}
22 changes: 18 additions & 4 deletions src/Illuminate/Auth/Events/Authenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,30 @@ class Authenticated
{
use SerializesModels;

/**
* The authentication guard name.
*
* @var string
*/
public $guard;

/**
* The authenticated user.
*
* @var \Illuminate\Contracts\Auth\Authenticatable
*/
public $user;

/**
* Create a new event instance.
*
* @param string $guard
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @return void
*/
public function __construct(
public $guard,
public $user,
) {
public function __construct($guard, $user)
{
$this->user = $user;
$this->guard = $guard;
}
}
22 changes: 18 additions & 4 deletions src/Illuminate/Auth/Events/CurrentDeviceLogout.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,30 @@ class CurrentDeviceLogout
{
use SerializesModels;

/**
* The authentication guard name.
*
* @var string
*/
public $guard;

/**
* The authenticated user.
*
* @var \Illuminate\Contracts\Auth\Authenticatable
*/
public $user;

/**
* Create a new event instance.
*
* @param string $guard
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @return void
*/
public function __construct(
public $guard,
public $user,
) {
public function __construct($guard, $user)
{
$this->user = $user;
$this->guard = $guard;
}
}
31 changes: 26 additions & 5 deletions src/Illuminate/Auth/Events/Failed.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@

class Failed
{
/**
* The authentication guard name.
*
* @var string
*/
public $guard;

/**
* The user the attempter was trying to authenticate as.
*
* @var \Illuminate\Contracts\Auth\Authenticatable|null
*/
public $user;

/**
* The credentials provided by the attempter.
*
* @var array
*/
public $credentials;

/**
* Create a new event instance.
*
Expand All @@ -12,10 +33,10 @@ class Failed
* @param array $credentials
* @return void
*/
public function __construct(
public $guard,
public $user,
#[\SensitiveParameter] public $credentials,
) {
public function __construct($guard, $user, #[\SensitiveParameter] $credentials)
{
$this->user = $user;
$this->guard = $guard;
$this->credentials = $credentials;
}
}
31 changes: 26 additions & 5 deletions src/Illuminate/Auth/Events/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@ class Login
{
use SerializesModels;

/**
* The authentication guard name.
*
* @var string
*/
public $guard;

/**
* The authenticated user.
*
* @var \Illuminate\Contracts\Auth\Authenticatable
*/
public $user;

/**
* Indicates if the user should be "remembered".
*
* @var bool
*/
public $remember;

/**
* Create a new event instance.
*
Expand All @@ -16,10 +37,10 @@ class Login
* @param bool $remember
* @return void
*/
public function __construct(
public $guard,
public $user,
public $remember,
) {
public function __construct($guard, $user, $remember)
{
$this->user = $user;
$this->guard = $guard;
$this->remember = $remember;
}
}
22 changes: 18 additions & 4 deletions src/Illuminate/Auth/Events/Logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,30 @@ class Logout
{
use SerializesModels;

/**
* The authentication guard name.
*
* @var string
*/
public $guard;

/**
* The authenticated user.
*
* @var \Illuminate\Contracts\Auth\Authenticatable
*/
public $user;

/**
* Create a new event instance.
*
* @param string $guard
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @return void
*/
public function __construct(
public $guard,
public $user,
) {
public function __construct($guard, $user)
{
$this->user = $user;
$this->guard = $guard;
}
}
Loading
Loading