Skip to content

Commit 5e69cdb

Browse files
authored
Merge pull request #1355 from datamweb/fix-phpstan-errors
chore: fix rector and phpstan errors
2 parents ec4b65b + 82db85d commit 5e69cdb

10 files changed

Lines changed: 3 additions & 37 deletions

File tree

‎phpstan-baseline.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,19 +260,19 @@
260260
'path' => __DIR__ . '/src/Models/UserModel.php',
261261
];
262262
$ignoreErrors[] = [
263-
'rawMessage' => 'Parameter #1 $row (array|CodeIgniter\\Shield\\Entities\\User) of method CodeIgniter\\Shield\\Models\\UserModel::insert() should be contravariant with parameter $row (array<int|string, bool|float|int|object|string|null>|object|null) of method CodeIgniter\\Model::insert()',
263+
'rawMessage' => 'Parameter #1 $row (array|CodeIgniter\\Shield\\Entities\\User) of method CodeIgniter\\Shield\\Models\\UserModel::insert() should be contravariant with parameter $row (array<mixed>|object|null) of method CodeIgniter\\Model::insert()',
264264
'identifier' => 'method.childParameterType',
265265
'count' => 1,
266266
'path' => __DIR__ . '/src/Models/UserModel.php',
267267
];
268268
$ignoreErrors[] = [
269-
'rawMessage' => 'Parameter #1 $row (array|CodeIgniter\\Shield\\Entities\\User) of method CodeIgniter\\Shield\\Models\\UserModel::save() should be contravariant with parameter $row (array<int|string, bool|float|int|object|string|null>|object) of method CodeIgniter\\BaseModel::save()',
269+
'rawMessage' => 'Parameter #1 $row (array|CodeIgniter\\Shield\\Entities\\User) of method CodeIgniter\\Shield\\Models\\UserModel::save() should be contravariant with parameter $row (array<mixed>|object) of method CodeIgniter\\BaseModel::save()',
270270
'identifier' => 'method.childParameterType',
271271
'count' => 1,
272272
'path' => __DIR__ . '/src/Models/UserModel.php',
273273
];
274274
$ignoreErrors[] = [
275-
'rawMessage' => 'Parameter #2 $row (array|CodeIgniter\\Shield\\Entities\\User) of method CodeIgniter\\Shield\\Models\\UserModel::update() should be contravariant with parameter $row (array<int|string, bool|float|int|object|string|null>|object|null) of method CodeIgniter\\Model::update()',
275+
'rawMessage' => 'Parameter #2 $row (array|CodeIgniter\\Shield\\Entities\\User) of method CodeIgniter\\Shield\\Models\\UserModel::update() should be contravariant with parameter $row (array<mixed>|object|null) of method CodeIgniter\\Model::update()',
276276
'identifier' => 'method.childParameterType',
277277
'count' => 1,
278278
'path' => __DIR__ . '/src/Models/UserModel.php',

‎src/Auth.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ protected function ensureAuthentication(): void
7171

7272
/**
7373
* Sets the Authenticator alias that should be used for this request.
74-
*
75-
* @return $this
7674
*/
7775
public function setAuthenticator(?string $alias = null): self
7876
{

‎src/Authentication/Authentication.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ public function factory(?string $alias = null): AuthenticatorInterface
6969

7070
/**
7171
* Sets the User Provider to use.
72-
*
73-
* @return $this
7472
*/
7573
public function setProvider(UserModel $provider): self
7674
{

‎src/Authentication/Authenticators/Session.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ private function checkSecurityConfig(): void
112112

113113
/**
114114
* Sets the $shouldRemember flag
115-
*
116-
* @return $this
117115
*/
118116
public function remember(bool $shouldRemember = true): self
119117
{

‎src/Authentication/Traits/HasAccessTokens.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ public function currentAccessToken(): ?AccessToken
155155

156156
/**
157157
* Sets the current active token for this user.
158-
*
159-
* @return $this
160158
*/
161159
public function setAccessToken(?AccessToken $accessToken): self
162160
{

‎src/Authentication/Traits/HasHmacTokens.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ public function currentHmacToken(): ?AccessToken
145145

146146
/**
147147
* Sets the current active token for this user.
148-
*
149-
* @return $this
150148
*/
151149
public function setHmacToken(?AccessToken $accessToken): self
152150
{

‎src/Authorization/Traits/Authorizable.php‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ trait Authorizable
2626

2727
/**
2828
* Adds one or more groups to the current User.
29-
*
30-
* @return $this
3129
*/
3230
public function addGroup(string ...$groups): self
3331
{
@@ -63,8 +61,6 @@ public function addGroup(string ...$groups): self
6361

6462
/**
6563
* Removes one or more groups from the user.
66-
*
67-
* @return $this
6864
*/
6965
public function removeGroup(string ...$groups): self
7066
{
@@ -88,8 +84,6 @@ public function removeGroup(string ...$groups): self
8884
* so only those groups are valid for this user, removing
8985
* all groups not in this list.
9086
*
91-
* @return $this
92-
*
9387
* @throws AuthorizationException
9488
*/
9589
public function syncGroups(string ...$groups): self
@@ -150,8 +144,6 @@ public function getPermissions(): ?array
150144
/**
151145
* Adds one or more permissions to the current user.
152146
*
153-
* @return $this
154-
*
155147
* @throws AuthorizationException
156148
*/
157149
public function addPermission(string ...$permissions): self
@@ -188,8 +180,6 @@ public function addPermission(string ...$permissions): self
188180

189181
/**
190182
* Removes one or more permissions from the current user.
191-
*
192-
* @return $this
193183
*/
194184
public function removePermission(string ...$permissions): self
195185
{
@@ -213,8 +203,6 @@ public function removePermission(string ...$permissions): self
213203
* so only those permissions are valid for this user, removing
214204
* all permissions not in this list.
215205
*
216-
* @return $this
217-
*
218206
* @throws AuthorizationException
219207
*/
220208
public function syncPermissions(string ...$permissions): self

‎src/Models/UserModel.php‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ protected function initialize(): void
7676

7777
/**
7878
* Mark the next find* query to include identities
79-
*
80-
* @return $this
8179
*/
8280
public function withIdentities(): self
8381
{
@@ -88,8 +86,6 @@ public function withIdentities(): self
8886

8987
/**
9088
* Mark the next find* query to include groups
91-
*
92-
* @return $this
9389
*/
9490
public function withGroups(): self
9591
{
@@ -100,8 +96,6 @@ public function withGroups(): self
10096

10197
/**
10298
* Mark the next find* query to include permissions
103-
*
104-
* @return $this
10599
*/
106100
public function withPermissions(): self
107101
{

‎src/Test/AuthenticationTesting.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ trait AuthenticationTesting
2727
* Logs the user for testing purposes.
2828
*
2929
* @param bool $pending Whether pending login state or not.
30-
*
31-
* @return $this
3230
*/
3331
public function actingAs(User $user, bool $pending = false): self
3432
{

‎src/Traits/Bannable.php‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ public function isBanned(): bool
2525

2626
/**
2727
* Ban the user from logging in.
28-
*
29-
* @return $this
3028
*/
3129
public function ban(?string $message = null): self
3230
{
@@ -42,8 +40,6 @@ public function ban(?string $message = null): self
4240

4341
/**
4442
* Unban the user and allow them to login
45-
*
46-
* @return $this
4743
*/
4844
public function unBan(): self
4945
{

0 commit comments

Comments
 (0)