Skip to content

Commit

Permalink
Merge pull request #7783 from ya861220/230805-phpstan-Entity-Encryption
Browse files Browse the repository at this point in the history
Dev: Remove the ignore errors of `Encryption` and `Entity` in phpstan.
  • Loading branch information
paulbalandan authored Aug 8, 2023
2 parents aaf6b34 + f972677 commit c640145
Show file tree
Hide file tree
Showing 3 changed files with 12 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
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

0 comments on commit c640145

Please sign in to comment.