Skip to content

Commit

Permalink
Merge pull request #1188 from grimpirate/develop
Browse files Browse the repository at this point in the history
refactor: remove unneeded Entities\Cast\IntBoolCast
  • Loading branch information
datamweb authored Aug 27, 2024
2 parents 7d692f3 + 461a895 commit 43add5a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 106 deletions.
30 changes: 0 additions & 30 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,36 +232,6 @@
'count' => 1,
'path' => __DIR__ . '/src/Database/Migrations/2020-12-28-223112_create_auth_tables.php',
];
$ignoreErrors[] = [
// identifier: method.childParameterType
'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\\(\\)$#',
'count' => 1,
'path' => __DIR__ . '/src/Entities/Cast/IntBoolCast.php',
];
$ignoreErrors[] = [
// identifier: method.childParameterType
'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\\(\\)$#',
'count' => 1,
'path' => __DIR__ . '/src/Entities/Cast/IntBoolCast.php',
];
$ignoreErrors[] = [
// identifier: method.childParameterType
'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\\(\\)$#',
'count' => 1,
'path' => __DIR__ . '/src/Entities/Cast/IntBoolCast.php',
];
$ignoreErrors[] = [
// identifier: method.childParameterType
'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\\(\\)$#',
'count' => 1,
'path' => __DIR__ . '/src/Entities/Cast/IntBoolCast.php',
];
$ignoreErrors[] = [
// identifier: property.phpDocType
'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\\.$#',
'count' => 1,
'path' => __DIR__ . '/src/Entities/Entity.php',
];
$ignoreErrors[] = [
// identifier: codeigniter.factoriesClassConstFetch
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\GroupModel\\:\\:class is discouraged\\.$#',
Expand Down
40 changes: 0 additions & 40 deletions src/Entities/Cast/IntBoolCast.php

This file was deleted.

33 changes: 0 additions & 33 deletions src/Entities/Entity.php

This file was deleted.

4 changes: 3 additions & 1 deletion src/Entities/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@

namespace CodeIgniter\Shield\Entities;

use CodeIgniter\Entity\Entity;

class Login extends Entity
{
/**
* @var array<string, string>
*/
protected $casts = [
'date' => 'datetime',
'success' => 'int_bool',
'success' => 'int-bool',
];
}
3 changes: 2 additions & 1 deletion src/Entities/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace CodeIgniter\Shield\Entities;

use CodeIgniter\Database\Exceptions\DataException;
use CodeIgniter\Entity\Entity;
use CodeIgniter\I18n\Time;
use CodeIgniter\Shield\Authentication\Authenticators\Session;
use CodeIgniter\Shield\Authentication\Traits\HasAccessTokens;
Expand Down Expand Up @@ -67,7 +68,7 @@ class User extends Entity
*/
protected $casts = [
'id' => '?integer',
'active' => 'int_bool',
'active' => 'int-bool',
'permissions' => 'array',
'groups' => 'array',
];
Expand Down
3 changes: 2 additions & 1 deletion src/Entities/UserIdentity.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace CodeIgniter\Shield\Entities;

use CodeIgniter\Entity\Entity;
use CodeIgniter\I18n\Time;
use CodeIgniter\Shield\Authentication\Passwords;

Expand Down Expand Up @@ -41,7 +42,7 @@ class UserIdentity extends Entity
*/
protected $casts = [
'id' => '?integer',
'force_reset' => 'int_bool',
'force_reset' => 'int-bool',
];

/**
Expand Down

0 comments on commit 43add5a

Please sign in to comment.