Skip to content

Commit

Permalink
Dev: Remove the ignore errors of Encryption and Entity in phpstan.
Browse files Browse the repository at this point in the history
  • Loading branch information
ya861220 committed Aug 5, 2023
1 parent 6c22cce commit 33d28cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
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
9 changes: 9 additions & 0 deletions system/Entity/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ class Entity implements JsonSerializable
* $datamap = [
* 'class_property_name' => 'db_column_name'
* ];
*
* @var array<string, string>
*/
protected $datamap = [];

/**
* The date fields.
*
* @var array<string>
*/
protected $dates = [
'created_at',
'updated_at',
Expand All @@ -57,6 +64,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

0 comments on commit 33d28cc

Please sign in to comment.