Skip to content

Commit 5800dd3

Browse files
authored
Revert "[11.x] use promoted properties (#53807)"
This reverts commit 69b19ce.
1 parent 69b19ce commit 5800dd3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+702
-175
lines changed

src/Illuminate/Auth/Access/Events/GateEvaluated.php

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@
44

55
class GateEvaluated
66
{
7+
/**
8+
* The authenticatable model.
9+
*
10+
* @var \Illuminate\Contracts\Auth\Authenticatable|null
11+
*/
12+
public $user;
13+
14+
/**
15+
* The ability being evaluated.
16+
*
17+
* @var string
18+
*/
19+
public $ability;
20+
21+
/**
22+
* The result of the evaluation.
23+
*
24+
* @var bool|null
25+
*/
26+
public $result;
27+
28+
/**
29+
* The arguments given during evaluation.
30+
*
31+
* @var array
32+
*/
33+
public $arguments;
34+
735
/**
836
* Create a new event instance.
937
*
@@ -13,11 +41,11 @@ class GateEvaluated
1341
* @param array $arguments
1442
* @return void
1543
*/
16-
public function __construct(
17-
public $user,
18-
public $ability,
19-
public $result,
20-
public $arguments,
21-
) {
44+
public function __construct($user, $ability, $result, $arguments)
45+
{
46+
$this->user = $user;
47+
$this->ability = $ability;
48+
$this->result = $result;
49+
$this->arguments = $arguments;
2250
}
2351
}

src/Illuminate/Auth/DatabaseUserProvider.php

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,27 @@
1111

1212
class DatabaseUserProvider implements UserProvider
1313
{
14+
/**
15+
* The active database connection.
16+
*
17+
* @var \Illuminate\Database\ConnectionInterface
18+
*/
19+
protected $connection;
20+
21+
/**
22+
* The hasher implementation.
23+
*
24+
* @var \Illuminate\Contracts\Hashing\Hasher
25+
*/
26+
protected $hasher;
27+
28+
/**
29+
* The table containing the users.
30+
*
31+
* @var string
32+
*/
33+
protected $table;
34+
1435
/**
1536
* Create a new database user provider.
1637
*
@@ -19,11 +40,11 @@ class DatabaseUserProvider implements UserProvider
1940
* @param string $table
2041
* @return void
2142
*/
22-
public function __construct(
23-
protected ConnectionInterface $connection,
24-
protected HasherContract $hasher,
25-
protected $table,
26-
) {
43+
public function __construct(ConnectionInterface $connection, HasherContract $hasher, $table)
44+
{
45+
$this->connection = $connection;
46+
$this->table = $table;
47+
$this->hasher = $hasher;
2748
}
2849

2950
/**

src/Illuminate/Auth/EloquentUserProvider.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@
1010

1111
class EloquentUserProvider implements UserProvider
1212
{
13+
/**
14+
* The hasher implementation.
15+
*
16+
* @var \Illuminate\Contracts\Hashing\Hasher
17+
*/
18+
protected $hasher;
19+
20+
/**
21+
* The Eloquent user model.
22+
*
23+
* @var string
24+
*/
25+
protected $model;
26+
1327
/**
1428
* The callback that may modify the user retrieval queries.
1529
*
@@ -24,10 +38,10 @@ class EloquentUserProvider implements UserProvider
2438
* @param string $model
2539
* @return void
2640
*/
27-
public function __construct(
28-
protected HasherContract $hasher,
29-
protected $model,
30-
) {
41+
public function __construct(HasherContract $hasher, $model)
42+
{
43+
$this->model = $model;
44+
$this->hasher = $hasher;
3145
}
3246

3347
/**

src/Illuminate/Auth/Events/Attempting.php

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@
44

55
class Attempting
66
{
7+
/**
8+
* The authentication guard name.
9+
*
10+
* @var string
11+
*/
12+
public $guard;
13+
14+
/**
15+
* The credentials for the user.
16+
*
17+
* @var array
18+
*/
19+
public $credentials;
20+
21+
/**
22+
* Indicates if the user should be "remembered".
23+
*
24+
* @var bool
25+
*/
26+
public $remember;
27+
728
/**
829
* Create a new event instance.
930
*
@@ -12,10 +33,10 @@ class Attempting
1233
* @param bool $remember
1334
* @return void
1435
*/
15-
public function __construct(
16-
public $guard,
17-
#[\SensitiveParameter] public $credentials,
18-
public $remember,
19-
) {
36+
public function __construct($guard, #[\SensitiveParameter] $credentials, $remember)
37+
{
38+
$this->guard = $guard;
39+
$this->remember = $remember;
40+
$this->credentials = $credentials;
2041
}
2142
}

src/Illuminate/Auth/Events/Authenticated.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,30 @@ class Authenticated
88
{
99
use SerializesModels;
1010

11+
/**
12+
* The authentication guard name.
13+
*
14+
* @var string
15+
*/
16+
public $guard;
17+
18+
/**
19+
* The authenticated user.
20+
*
21+
* @var \Illuminate\Contracts\Auth\Authenticatable
22+
*/
23+
public $user;
24+
1125
/**
1226
* Create a new event instance.
1327
*
1428
* @param string $guard
1529
* @param \Illuminate\Contracts\Auth\Authenticatable $user
1630
* @return void
1731
*/
18-
public function __construct(
19-
public $guard,
20-
public $user,
21-
) {
32+
public function __construct($guard, $user)
33+
{
34+
$this->user = $user;
35+
$this->guard = $guard;
2236
}
2337
}

src/Illuminate/Auth/Events/CurrentDeviceLogout.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,30 @@ class CurrentDeviceLogout
88
{
99
use SerializesModels;
1010

11+
/**
12+
* The authentication guard name.
13+
*
14+
* @var string
15+
*/
16+
public $guard;
17+
18+
/**
19+
* The authenticated user.
20+
*
21+
* @var \Illuminate\Contracts\Auth\Authenticatable
22+
*/
23+
public $user;
24+
1125
/**
1226
* Create a new event instance.
1327
*
1428
* @param string $guard
1529
* @param \Illuminate\Contracts\Auth\Authenticatable $user
1630
* @return void
1731
*/
18-
public function __construct(
19-
public $guard,
20-
public $user,
21-
) {
32+
public function __construct($guard, $user)
33+
{
34+
$this->user = $user;
35+
$this->guard = $guard;
2236
}
2337
}

src/Illuminate/Auth/Events/Failed.php

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@
44

55
class Failed
66
{
7+
/**
8+
* The authentication guard name.
9+
*
10+
* @var string
11+
*/
12+
public $guard;
13+
14+
/**
15+
* The user the attempter was trying to authenticate as.
16+
*
17+
* @var \Illuminate\Contracts\Auth\Authenticatable|null
18+
*/
19+
public $user;
20+
21+
/**
22+
* The credentials provided by the attempter.
23+
*
24+
* @var array
25+
*/
26+
public $credentials;
27+
728
/**
829
* Create a new event instance.
930
*
@@ -12,10 +33,10 @@ class Failed
1233
* @param array $credentials
1334
* @return void
1435
*/
15-
public function __construct(
16-
public $guard,
17-
public $user,
18-
#[\SensitiveParameter] public $credentials,
19-
) {
36+
public function __construct($guard, $user, #[\SensitiveParameter] $credentials)
37+
{
38+
$this->user = $user;
39+
$this->guard = $guard;
40+
$this->credentials = $credentials;
2041
}
2142
}

src/Illuminate/Auth/Events/Login.php

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,27 @@ class Login
88
{
99
use SerializesModels;
1010

11+
/**
12+
* The authentication guard name.
13+
*
14+
* @var string
15+
*/
16+
public $guard;
17+
18+
/**
19+
* The authenticated user.
20+
*
21+
* @var \Illuminate\Contracts\Auth\Authenticatable
22+
*/
23+
public $user;
24+
25+
/**
26+
* Indicates if the user should be "remembered".
27+
*
28+
* @var bool
29+
*/
30+
public $remember;
31+
1132
/**
1233
* Create a new event instance.
1334
*
@@ -16,10 +37,10 @@ class Login
1637
* @param bool $remember
1738
* @return void
1839
*/
19-
public function __construct(
20-
public $guard,
21-
public $user,
22-
public $remember,
23-
) {
40+
public function __construct($guard, $user, $remember)
41+
{
42+
$this->user = $user;
43+
$this->guard = $guard;
44+
$this->remember = $remember;
2445
}
2546
}

src/Illuminate/Auth/Events/Logout.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,30 @@ class Logout
88
{
99
use SerializesModels;
1010

11+
/**
12+
* The authentication guard name.
13+
*
14+
* @var string
15+
*/
16+
public $guard;
17+
18+
/**
19+
* The authenticated user.
20+
*
21+
* @var \Illuminate\Contracts\Auth\Authenticatable
22+
*/
23+
public $user;
24+
1125
/**
1226
* Create a new event instance.
1327
*
1428
* @param string $guard
1529
* @param \Illuminate\Contracts\Auth\Authenticatable $user
1630
* @return void
1731
*/
18-
public function __construct(
19-
public $guard,
20-
public $user,
21-
) {
32+
public function __construct($guard, $user)
33+
{
34+
$this->user = $user;
35+
$this->guard = $guard;
2236
}
2337
}

0 commit comments

Comments
 (0)