Skip to content

Commit dd9d4b2

Browse files
committed
Fix PHPStan iterable type errors in BaseModel, Model, and CLI; clean baseline (#8732)
1 parent 45b5a80 commit dd9d4b2

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

system/CLI/CLI.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ public static function promptByMultipleKeys(string $text, array $options): array
374374

375375
/**
376376
* Validation for $options in promptByKey() and promptByMultipleKeys(). Return an error if $options is an empty array.
377+
*
378+
* @param array<int,string> $options List of options
379+
*
380+
* @return void
377381
*/
378382
private static function isZeroOptions(array $options): void
379383
{

system/Commands/ListCommands.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ public function run(array $params)
8787

8888
/**
8989
* Lists the commands with accompanying info.
90+
*
91+
* @param array<string,array<string,string>> $commands Array of commands keyed by name, each with metadata
9092
*
9193
* @return int
9294
*/

utils/phpstan-baseline/missingType.iterableValue.neon

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,6 @@ parameters:
142142
count: 1
143143
path: ../../system/BaseModel.php
144144

145-
-
146-
message: '#^Method CodeIgniter\\CLI\\CLI\:\:isZeroOptions\(\) has parameter \$options with no value type specified in iterable type array\.$#'
147-
count: 1
148-
path: ../../system/CLI/CLI.php
149-
150145
-
151146
message: '#^Method CodeIgniter\\CLI\\CLI\:\:printKeysAndValues\(\) has parameter \$options with no value type specified in iterable type array\.$#'
152147
count: 1
@@ -207,11 +202,6 @@ parameters:
207202
count: 1
208203
path: ../../system/CodeIgniter.php
209204

210-
-
211-
message: '#^Method CodeIgniter\\Commands\\ListCommands\:\:listFull\(\) has parameter \$commands with no value type specified in iterable type array\.$#'
212-
count: 1
213-
path: ../../system/Commands/ListCommands.php
214-
215205
-
216206
message: '#^Method CodeIgniter\\Commands\\ListCommands\:\:listSimple\(\) has parameter \$commands with no value type specified in iterable type array\.$#'
217207
count: 1

0 commit comments

Comments
 (0)