Skip to content

Commit 6d15d8c

Browse files
authored
Merge pull request #416 from kenjis/fix-phpstan-error
refactor: fix PHPStan error
2 parents 300e9b4 + 19993c4 commit 6d15d8c

File tree

7 files changed

+9
-1
lines changed

7 files changed

+9
-1
lines changed

src/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function routes(RouteCollection &$routes, array $config = []): void
106106

107107
$routes->group('/', ['namespace' => 'CodeIgniter\Shield\Controllers'], static function (RouteCollection $routes) use ($authRoutes, $config): void {
108108
foreach ($authRoutes as $name => $row) {
109-
if (! isset($config['except']) || (isset($config['except']) && ! in_array($name, $config['except'], true))) {
109+
if (! isset($config['except']) || ! in_array($name, $config['except'], true)) {
110110
foreach ($row as $params) {
111111
$options = isset($params[3])
112112
? ['as' => $params[3]]

src/Config/Auth.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ class Auth extends BaseConfig
122122
* If no match is found, then the next in the chain will be checked.
123123
*
124124
* @var string[]
125+
*
125126
* @phpstan-var list<string>
126127
*/
127128
public array $authenticationChain = [

src/Entities/Entity.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ abstract class Entity extends FrameworkEntity
1616
* Custom convert handlers
1717
*
1818
* @var array<string, string>
19+
*
1920
* @phpstan-var array<string, class-string>
2021
*/
2122
protected $castHandlers = [

src/Entities/User.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ class User extends Entity
2727

2828
/**
2929
* @var string[]
30+
*
3031
* @phpstan-var list<string>
32+
*
3133
* @psalm-var list<string>
3234
*/
3335
protected $dates = [

src/Entities/UserIdentity.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ class UserIdentity extends Entity
3232

3333
/**
3434
* @var string[]
35+
*
3536
* @phpstan-var list<string>
37+
*
3638
* @psalm-var list<string>
3739
*/
3840
protected $dates = [

src/Models/UserModel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ protected function fetchIdentities(array $data): array
9898
* @param UserIdentity[] $identities
9999
*
100100
* @return User[] UserId => User object
101+
*
101102
* @phpstan-return array<int|string, User> UserId => User object
102103
*/
103104
private function assignIdentities(array $data, array $identities): array

src/Result.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class Result
2626

2727
/**
2828
* @phpstan-param array{success: bool, reason?: string|null, extraInfo?: string|User} $details
29+
*
2930
* @psalm-param array{success: bool, reason?: string|null, extraInfo?: string|User} $details
3031
*/
3132
public function __construct(array $details)

0 commit comments

Comments
 (0)