Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unneeded Entities\Cast\IntBoolCast #1187

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading