Skip to content

Commit 4219d62

Browse files
authored
Merge pull request #898 from datamweb/fix-new-CI-phpstan
fix: phpstan errors for phpstan-codeigniter (v1.4.0.70400)
2 parents fd2dff9 + e167b69 commit 4219d62

1 file changed

Lines changed: 95 additions & 1 deletion

File tree

phpstan-baseline.php

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,22 @@
2727
'count' => 2,
2828
'path' => __DIR__ . '/src/Authentication/Actions/Email2FA.php',
2929
];
30+
$ignoreErrors[] = [
31+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#',
32+
'count' => 2,
33+
'path' => __DIR__ . '/src/Authentication/Actions/Email2FA.php',
34+
];
3035
$ignoreErrors[] = [
3136
'message' => '#^Call to deprecated function random_string\\(\\)\\:
3237
The type \'basic\', \'md5\', and \'sha1\' are deprecated\\. They are not cryptographically secure\\.$#',
3338
'count' => 1,
3439
'path' => __DIR__ . '/src/Authentication/Actions/EmailActivator.php',
3540
];
41+
$ignoreErrors[] = [
42+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#',
43+
'count' => 2,
44+
'path' => __DIR__ . '/src/Authentication/Actions/EmailActivator.php',
45+
];
3646
$ignoreErrors[] = [
3747
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
3848
'count' => 1,
@@ -48,6 +58,16 @@
4858
'count' => 1,
4959
'path' => __DIR__ . '/src/Authentication/Authenticators/AccessTokens.php',
5060
];
61+
$ignoreErrors[] = [
62+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\TokenLoginModel\\:\\:class is discouraged\\.$#',
63+
'count' => 1,
64+
'path' => __DIR__ . '/src/Authentication/Authenticators/AccessTokens.php',
65+
];
66+
$ignoreErrors[] = [
67+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#',
68+
'count' => 1,
69+
'path' => __DIR__ . '/src/Authentication/Authenticators/AccessTokens.php',
70+
];
5171
$ignoreErrors[] = [
5272
'message' => '#^Parameter \\#1 \\$credentials \\(array\\{token\\?\\: string\\}\\) of method CodeIgniter\\\\Shield\\\\Authentication\\\\Authenticators\\\\JWT\\:\\:attempt\\(\\) should be contravariant with parameter \\$credentials \\(array\\) of method CodeIgniter\\\\Shield\\\\Authentication\\\\AuthenticatorInterface\\:\\:attempt\\(\\)$#',
5373
'count' => 1,
@@ -58,6 +78,11 @@
5878
'count' => 1,
5979
'path' => __DIR__ . '/src/Authentication/Authenticators/JWT.php',
6080
];
81+
$ignoreErrors[] = [
82+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\TokenLoginModel\\:\\:class is discouraged\\.$#',
83+
'count' => 1,
84+
'path' => __DIR__ . '/src/Authentication/Authenticators/JWT.php',
85+
];
6186
$ignoreErrors[] = [
6287
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
6388
'count' => 3,
@@ -88,6 +113,21 @@
88113
'count' => 1,
89114
'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php',
90115
];
116+
$ignoreErrors[] = [
117+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\LoginModel\\:\\:class is discouraged\\.$#',
118+
'count' => 1,
119+
'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php',
120+
];
121+
$ignoreErrors[] = [
122+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\RememberModel\\:\\:class is discouraged\\.$#',
123+
'count' => 1,
124+
'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php',
125+
];
126+
$ignoreErrors[] = [
127+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#',
128+
'count' => 1,
129+
'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php',
130+
];
91131
$ignoreErrors[] = [
92132
'message' => '#^Call to method CodeIgniter\\\\Shield\\\\Result\\:\\:isOK\\(\\) with incorrect case\\: isOk$#',
93133
'count' => 1,
@@ -159,6 +199,16 @@
159199
'count' => 1,
160200
'path' => __DIR__ . '/src/Controllers/MagicLinkController.php',
161201
];
202+
$ignoreErrors[] = [
203+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#',
204+
'count' => 2,
205+
'path' => __DIR__ . '/src/Controllers/MagicLinkController.php',
206+
];
207+
$ignoreErrors[] = [
208+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\LoginModel\\:\\:class is discouraged\\.$#',
209+
'count' => 1,
210+
'path' => __DIR__ . '/src/Controllers/MagicLinkController.php',
211+
];
162212
$ignoreErrors[] = [
163213
'message' => '#^Call to function assert\\(\\) with false and \'Config Auth…\' will always evaluate to false\\.$#',
164214
'count' => 1,
@@ -224,6 +274,21 @@
224274
'count' => 1,
225275
'path' => __DIR__ . '/src/Entities/User.php',
226276
];
277+
$ignoreErrors[] = [
278+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#',
279+
'count' => 19,
280+
'path' => __DIR__ . '/src/Entities/User.php',
281+
];
282+
$ignoreErrors[] = [
283+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\LoginModel\\:\\:class is discouraged\\.$#',
284+
'count' => 2,
285+
'path' => __DIR__ . '/src/Entities/User.php',
286+
];
287+
$ignoreErrors[] = [
288+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserModel\\:\\:class is discouraged\\.$#',
289+
'count' => 9,
290+
'path' => __DIR__ . '/src/Commands/User.php',
291+
];
227292
$ignoreErrors[] = [
228293
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
229294
'count' => 1,
@@ -306,6 +371,11 @@
306371
'count' => 1,
307372
'path' => __DIR__ . '/src/Models/UserModel.php',
308373
];
374+
$ignoreErrors[] = [
375+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#',
376+
'count' => 1,
377+
'path' => __DIR__ . '/src/Models/UserModel.php',
378+
];
309379
$ignoreErrors[] = [
310380
'message' => '#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with \'CodeIgniter\\\\\\\\Shield\\\\\\\\Result\' and CodeIgniter\\\\Shield\\\\Result will always evaluate to true\\.$#',
311381
'count' => 2,
@@ -366,5 +436,29 @@
366436
'count' => 1,
367437
'path' => __DIR__ . '/tests/_support/Config/Registrar.php',
368438
];
369-
439+
$ignoreErrors[] = [
440+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\TokenLoginModel\\:\\:class is discouraged\\.$#',
441+
'count' => 1,
442+
'path' => __DIR__ . '/src/Authentication/Authenticators/HmacSha256.php',
443+
];
444+
$ignoreErrors[] = [
445+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#',
446+
'count' => 1,
447+
'path' => __DIR__ . '/src/Authentication/Authenticators/HmacSha256.php',
448+
];
449+
$ignoreErrors[] = [
450+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\GroupModel\\:\\:class is discouraged\\.$#',
451+
'count' => 2,
452+
'path' => __DIR__ . '/src/Authorization/Traits/Authorizable.php',
453+
];
454+
$ignoreErrors[] = [
455+
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\PermissionModel\\:\\:class is discouraged\\.$#',
456+
'count' => 2,
457+
'path' => __DIR__ . '/src/Authorization/Traits/Authorizable.php',
458+
];
459+
$ignoreErrors[] = [
460+
'message' => '#^Call to function config with Config\\\\Email\\:\\:class is discouraged\\.$#',
461+
'count' => 1,
462+
'path' => __DIR__ . '/src/Commands/Setup.php',
463+
];
370464
return ['parameters' => ['ignoreErrors' => $ignoreErrors]];

0 commit comments

Comments
 (0)