Skip to content

Commit c640145

Browse files
authored
Merge pull request #7783 from ya861220/230805-phpstan-Entity-Encryption
Dev: Remove the ignore errors of `Encryption` and `Entity` in phpstan.
2 parents aaf6b34 + f972677 commit c640145

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -806,26 +806,6 @@
806806
'count' => 1,
807807
'path' => __DIR__ . '/system/Email/Email.php',
808808
];
809-
$ignoreErrors[] = [
810-
'message' => '#^Method CodeIgniter\\\\Encryption\\\\Handlers\\\\SodiumHandler\\:\\:parseParams\\(\\) has no return type specified\\.$#',
811-
'count' => 1,
812-
'path' => __DIR__ . '/system/Encryption/Handlers/SodiumHandler.php',
813-
];
814-
$ignoreErrors[] = [
815-
'message' => '#^Property CodeIgniter\\\\Entity\\\\Entity\\:\\:\\$casts has no type specified\\.$#',
816-
'count' => 1,
817-
'path' => __DIR__ . '/system/Entity/Entity.php',
818-
];
819-
$ignoreErrors[] = [
820-
'message' => '#^Property CodeIgniter\\\\Entity\\\\Entity\\:\\:\\$datamap has no type specified\\.$#',
821-
'count' => 1,
822-
'path' => __DIR__ . '/system/Entity/Entity.php',
823-
];
824-
$ignoreErrors[] = [
825-
'message' => '#^Property CodeIgniter\\\\Entity\\\\Entity\\:\\:\\$dates has no type specified\\.$#',
826-
'count' => 1,
827-
'path' => __DIR__ . '/system/Entity/Entity.php',
828-
];
829809
$ignoreErrors[] = [
830810
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:on\\(\\) has parameter \\$callback with no signature specified for callable\\.$#',
831811
'count' => 1,

system/Encryption/Handlers/SodiumHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ public function decrypt($data, $params = null)
112112
*
113113
* @param array|string|null $params
114114
*
115+
* @return void
116+
*
115117
* @throws EncryptionException If key is empty
116118
*/
117119
protected function parseParams($params)

system/Entity/Entity.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,17 @@ class Entity implements JsonSerializable
4545
* $datamap = [
4646
* 'class_property_name' => 'db_column_name'
4747
* ];
48+
*
49+
* @var array<string, string>
4850
*/
4951
protected $datamap = [];
5052

53+
/**
54+
* The date fields.
55+
*
56+
* @var array<int, string>
57+
* @phpstan-var list<string>
58+
*/
5159
protected $dates = [
5260
'created_at',
5361
'updated_at',
@@ -57,6 +65,8 @@ class Entity implements JsonSerializable
5765
/**
5866
* Array of field names and the type of value to cast them as when
5967
* they are accessed.
68+
*
69+
* @var array<string, string>
6070
*/
6171
protected $casts = [];
6272

0 commit comments

Comments
 (0)