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

Dev: Remove the ignore errors of Encryption and Entity in phpstan. #7783

Merged
Merged
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
20 changes: 0 additions & 20 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -806,26 +806,6 @@
'count' => 1,
'path' => __DIR__ . '/system/Email/Email.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Encryption\\\\Handlers\\\\SodiumHandler\\:\\:parseParams\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Encryption/Handlers/SodiumHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Property CodeIgniter\\\\Entity\\\\Entity\\:\\:\\$casts has no type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Entity/Entity.php',
];
$ignoreErrors[] = [
'message' => '#^Property CodeIgniter\\\\Entity\\\\Entity\\:\\:\\$datamap has no type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Entity/Entity.php',
];
$ignoreErrors[] = [
'message' => '#^Property CodeIgniter\\\\Entity\\\\Entity\\:\\:\\$dates has no type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Entity/Entity.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:on\\(\\) has parameter \\$callback with no signature specified for callable\\.$#',
'count' => 1,
Expand Down
2 changes: 2 additions & 0 deletions system/Encryption/Handlers/SodiumHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ public function decrypt($data, $params = null)
*
* @param array|string|null $params
*
* @return void
*
* @throws EncryptionException If key is empty
*/
protected function parseParams($params)
Expand Down
10 changes: 10 additions & 0 deletions system/Entity/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,17 @@ class Entity implements JsonSerializable
* $datamap = [
* 'class_property_name' => 'db_column_name'
* ];
*
* @var array<string, string>
*/
protected $datamap = [];

/**
* The date fields.
*
* @var array<int, string>
* @phpstan-var list<string>
*/
protected $dates = [
'created_at',
'updated_at',
Expand All @@ -57,6 +65,8 @@ class Entity implements JsonSerializable
/**
* Array of field names and the type of value to cast them as when
* they are accessed.
*
* @var array<string, string>
*/
protected $casts = [];

Expand Down