Skip to content

Commit 43add5a

Browse files
authored
Merge pull request #1188 from grimpirate/develop
refactor: remove unneeded Entities\Cast\IntBoolCast
2 parents 7d692f3 + 461a895 commit 43add5a

File tree

6 files changed

+7
-106
lines changed

6 files changed

+7
-106
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -232,36 +232,6 @@
232232
'count' => 1,
233233
'path' => __DIR__ . '/src/Database/Migrations/2020-12-28-223112_create_auth_tables.php',
234234
];
235-
$ignoreErrors[] = [
236-
// identifier: method.childParameterType
237-
'message' => '#^Parameter \\#1 \\$value \\(bool\\|int\\|string\\) of method CodeIgniter\\\\Shield\\\\Entities\\\\Cast\\\\IntBoolCast\\:\\:set\\(\\) should be contravariant with parameter \\$value \\(array\\|bool\\|float\\|int\\|object\\|string\\|null\\) of method CodeIgniter\\\\Entity\\\\Cast\\\\BaseCast\\:\\:set\\(\\)$#',
238-
'count' => 1,
239-
'path' => __DIR__ . '/src/Entities/Cast/IntBoolCast.php',
240-
];
241-
$ignoreErrors[] = [
242-
// identifier: method.childParameterType
243-
'message' => '#^Parameter \\#1 \\$value \\(bool\\|int\\|string\\) of method CodeIgniter\\\\Shield\\\\Entities\\\\Cast\\\\IntBoolCast\\:\\:set\\(\\) should be contravariant with parameter \\$value \\(array\\|bool\\|float\\|int\\|object\\|string\\|null\\) of method CodeIgniter\\\\Entity\\\\Cast\\\\CastInterface\\:\\:set\\(\\)$#',
244-
'count' => 1,
245-
'path' => __DIR__ . '/src/Entities/Cast/IntBoolCast.php',
246-
];
247-
$ignoreErrors[] = [
248-
// identifier: method.childParameterType
249-
'message' => '#^Parameter \\#1 \\$value \\(int\\) of method CodeIgniter\\\\Shield\\\\Entities\\\\Cast\\\\IntBoolCast\\:\\:get\\(\\) should be contravariant with parameter \\$value \\(array\\|bool\\|float\\|int\\|object\\|string\\|null\\) of method CodeIgniter\\\\Entity\\\\Cast\\\\BaseCast\\:\\:get\\(\\)$#',
250-
'count' => 1,
251-
'path' => __DIR__ . '/src/Entities/Cast/IntBoolCast.php',
252-
];
253-
$ignoreErrors[] = [
254-
// identifier: method.childParameterType
255-
'message' => '#^Parameter \\#1 \\$value \\(int\\) of method CodeIgniter\\\\Shield\\\\Entities\\\\Cast\\\\IntBoolCast\\:\\:get\\(\\) should be contravariant with parameter \\$value \\(array\\|bool\\|float\\|int\\|object\\|string\\|null\\) of method CodeIgniter\\\\Entity\\\\Cast\\\\CastInterface\\:\\:get\\(\\)$#',
256-
'count' => 1,
257-
'path' => __DIR__ . '/src/Entities/Cast/IntBoolCast.php',
258-
];
259-
$ignoreErrors[] = [
260-
// identifier: property.phpDocType
261-
'message' => '#^PHPDoc type array\\<string, class\\-string\\> of property CodeIgniter\\\\Shield\\\\Entities\\\\Entity\\:\\:\\$castHandlers is not the same as PHPDoc type array\\<string, string\\> of overridden property CodeIgniter\\\\Entity\\\\Entity\\:\\:\\$castHandlers\\.$#',
262-
'count' => 1,
263-
'path' => __DIR__ . '/src/Entities/Entity.php',
264-
];
265235
$ignoreErrors[] = [
266236
// identifier: codeigniter.factoriesClassConstFetch
267237
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\GroupModel\\:\\:class is discouraged\\.$#',

src/Entities/Cast/IntBoolCast.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/Entities/Entity.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/Entities/Login.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313

1414
namespace CodeIgniter\Shield\Entities;
1515

16+
use CodeIgniter\Entity\Entity;
17+
1618
class Login extends Entity
1719
{
1820
/**
1921
* @var array<string, string>
2022
*/
2123
protected $casts = [
2224
'date' => 'datetime',
23-
'success' => 'int_bool',
25+
'success' => 'int-bool',
2426
];
2527
}

src/Entities/User.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace CodeIgniter\Shield\Entities;
1515

1616
use CodeIgniter\Database\Exceptions\DataException;
17+
use CodeIgniter\Entity\Entity;
1718
use CodeIgniter\I18n\Time;
1819
use CodeIgniter\Shield\Authentication\Authenticators\Session;
1920
use CodeIgniter\Shield\Authentication\Traits\HasAccessTokens;
@@ -67,7 +68,7 @@ class User extends Entity
6768
*/
6869
protected $casts = [
6970
'id' => '?integer',
70-
'active' => 'int_bool',
71+
'active' => 'int-bool',
7172
'permissions' => 'array',
7273
'groups' => 'array',
7374
];

src/Entities/UserIdentity.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace CodeIgniter\Shield\Entities;
1515

16+
use CodeIgniter\Entity\Entity;
1617
use CodeIgniter\I18n\Time;
1718
use CodeIgniter\Shield\Authentication\Passwords;
1819

@@ -41,7 +42,7 @@ class UserIdentity extends Entity
4142
*/
4243
protected $casts = [
4344
'id' => '?integer',
44-
'force_reset' => 'int_bool',
45+
'force_reset' => 'int-bool',
4546
];
4647

4748
/**

0 commit comments

Comments
 (0)