Skip to content

Commit 747108f

Browse files
authored
Merge pull request #8808 from ddevsr/patch-3
docs: fix @param BaseBuilder.php
2 parents 1148a96 + c6e1747 commit 747108f

File tree

2 files changed

+24
-114
lines changed

2 files changed

+24
-114
lines changed

phpstan-baseline.php

Lines changed: 12 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,41 +1791,6 @@
17911791
'count' => 1,
17921792
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
17931793
];
1794-
$ignoreErrors[] = [
1795-
'message' => '#^Method CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:_deleteBatch\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#',
1796-
'count' => 1,
1797-
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
1798-
];
1799-
$ignoreErrors[] = [
1800-
'message' => '#^Method CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:_insert\\(\\) has parameter \\$keys with no value type specified in iterable type array\\.$#',
1801-
'count' => 1,
1802-
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
1803-
];
1804-
$ignoreErrors[] = [
1805-
'message' => '#^Method CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:_insert\\(\\) has parameter \\$unescapedKeys with no value type specified in iterable type array\\.$#',
1806-
'count' => 1,
1807-
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
1808-
];
1809-
$ignoreErrors[] = [
1810-
'message' => '#^Method CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:_like\\(\\) has parameter \\$field with no value type specified in iterable type array\\.$#',
1811-
'count' => 1,
1812-
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
1813-
];
1814-
$ignoreErrors[] = [
1815-
'message' => '#^Method CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:_replace\\(\\) has parameter \\$keys with no value type specified in iterable type array\\.$#',
1816-
'count' => 1,
1817-
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
1818-
];
1819-
$ignoreErrors[] = [
1820-
'message' => '#^Method CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:_replace\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#',
1821-
'count' => 1,
1822-
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
1823-
];
1824-
$ignoreErrors[] = [
1825-
'message' => '#^Method CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:_update\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#',
1826-
'count' => 1,
1827-
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
1828-
];
18291794
$ignoreErrors[] = [
18301795
'message' => '#^Method CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:_whereIn\\(\\) has parameter \\$values with no signature specified for Closure\\.$#',
18311796
'count' => 1,
@@ -2206,6 +2171,11 @@
22062171
'count' => 1,
22072172
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
22082173
];
2174+
$ignoreErrors[] = [
2175+
'message' => '#^Parameter \\#3 \\.\\.\\.\\$arrays of function array_map expects array, int\\|string given\\.$#',
2176+
'count' => 1,
2177+
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
2178+
];
22092179
$ignoreErrors[] = [
22102180
'message' => '#^Property CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:\\$QBFrom type has no value type specified in iterable type array\\.$#',
22112181
'count' => 1,
@@ -3122,37 +3092,22 @@
31223092
'path' => __DIR__ . '/system/Database/OCI8/Builder.php',
31233093
];
31243094
$ignoreErrors[] = [
3125-
'message' => '#^Method CodeIgniter\\\\Database\\\\OCI8\\\\Builder\\:\\:_deleteBatch\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#',
3126-
'count' => 1,
3127-
'path' => __DIR__ . '/system/Database/OCI8/Builder.php',
3128-
];
3129-
$ignoreErrors[] = [
3130-
'message' => '#^Method CodeIgniter\\\\Database\\\\OCI8\\\\Builder\\:\\:_replace\\(\\) has parameter \\$keys with no value type specified in iterable type array\\.$#',
3131-
'count' => 1,
3132-
'path' => __DIR__ . '/system/Database/OCI8/Builder.php',
3133-
];
3134-
$ignoreErrors[] = [
3135-
'message' => '#^Method CodeIgniter\\\\Database\\\\OCI8\\\\Builder\\:\\:_replace\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#',
3136-
'count' => 1,
3137-
'path' => __DIR__ . '/system/Database/OCI8/Builder.php',
3138-
];
3139-
$ignoreErrors[] = [
3140-
'message' => '#^Method CodeIgniter\\\\Database\\\\OCI8\\\\Builder\\:\\:_update\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#',
3095+
'message' => '#^Method CodeIgniter\\\\Database\\\\OCI8\\\\Builder\\:\\:fieldsFromQuery\\(\\) return type has no value type specified in iterable type array\\.$#',
31413096
'count' => 1,
31423097
'path' => __DIR__ . '/system/Database/OCI8/Builder.php',
31433098
];
31443099
$ignoreErrors[] = [
3145-
'message' => '#^Method CodeIgniter\\\\Database\\\\OCI8\\\\Builder\\:\\:fieldsFromQuery\\(\\) return type has no value type specified in iterable type array\\.$#',
3100+
'message' => '#^Method CodeIgniter\\\\Database\\\\OCI8\\\\Builder\\:\\:resetSelect\\(\\) has no return type specified\\.$#',
31463101
'count' => 1,
31473102
'path' => __DIR__ . '/system/Database/OCI8/Builder.php',
31483103
];
31493104
$ignoreErrors[] = [
3150-
'message' => '#^Method CodeIgniter\\\\Database\\\\OCI8\\\\Builder\\:\\:resetSelect\\(\\) has no return type specified\\.$#',
3105+
'message' => '#^PHPDoc type CodeIgniter\\\\Database\\\\OCI8\\\\Connection of property CodeIgniter\\\\Database\\\\OCI8\\\\Builder\\:\\:\\$db is not the same as PHPDoc type CodeIgniter\\\\Database\\\\BaseConnection of overridden property CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:\\$db\\.$#',
31513106
'count' => 1,
31523107
'path' => __DIR__ . '/system/Database/OCI8/Builder.php',
31533108
];
31543109
$ignoreErrors[] = [
3155-
'message' => '#^PHPDoc type CodeIgniter\\\\Database\\\\OCI8\\\\Connection of property CodeIgniter\\\\Database\\\\OCI8\\\\Builder\\:\\:\\$db is not the same as PHPDoc type CodeIgniter\\\\Database\\\\BaseConnection of overridden property CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:\\$db\\.$#',
3110+
'message' => '#^Parameter \\#3 \\.\\.\\.\\$arrays of function array_map expects array, int\\|string given\\.$#',
31563111
'count' => 1,
31573112
'path' => __DIR__ . '/system/Database/OCI8/Builder.php',
31583113
];
@@ -3317,27 +3272,12 @@
33173272
'path' => __DIR__ . '/system/Database/Postgre/Builder.php',
33183273
];
33193274
$ignoreErrors[] = [
3320-
'message' => '#^Method CodeIgniter\\\\Database\\\\Postgre\\\\Builder\\:\\:_deleteBatch\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#',
3321-
'count' => 1,
3322-
'path' => __DIR__ . '/system/Database/Postgre/Builder.php',
3323-
];
3324-
$ignoreErrors[] = [
3325-
'message' => '#^Method CodeIgniter\\\\Database\\\\Postgre\\\\Builder\\:\\:_insert\\(\\) has parameter \\$keys with no value type specified in iterable type array\\.$#',
3326-
'count' => 1,
3327-
'path' => __DIR__ . '/system/Database/Postgre/Builder.php',
3328-
];
3329-
$ignoreErrors[] = [
3330-
'message' => '#^Method CodeIgniter\\\\Database\\\\Postgre\\\\Builder\\:\\:_insert\\(\\) has parameter \\$unescapedKeys with no value type specified in iterable type array\\.$#',
3331-
'count' => 1,
3332-
'path' => __DIR__ . '/system/Database/Postgre/Builder.php',
3333-
];
3334-
$ignoreErrors[] = [
3335-
'message' => '#^Method CodeIgniter\\\\Database\\\\Postgre\\\\Builder\\:\\:_update\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#',
3275+
'message' => '#^Method CodeIgniter\\\\Database\\\\Postgre\\\\Builder\\:\\:replace\\(\\) has parameter \\$set with no value type specified in iterable type array\\.$#',
33363276
'count' => 1,
33373277
'path' => __DIR__ . '/system/Database/Postgre/Builder.php',
33383278
];
33393279
$ignoreErrors[] = [
3340-
'message' => '#^Method CodeIgniter\\\\Database\\\\Postgre\\\\Builder\\:\\:replace\\(\\) has parameter \\$set with no value type specified in iterable type array\\.$#',
3280+
'message' => '#^Parameter \\#3 \\.\\.\\.\\$arrays of function array_map expects array, int\\|string given\\.$#',
33413281
'count' => 1,
33423282
'path' => __DIR__ . '/system/Database/Postgre/Builder.php',
33433283
];
@@ -3676,31 +3616,6 @@
36763616
'count' => 9,
36773617
'path' => __DIR__ . '/system/Database/SQLSRV/Builder.php',
36783618
];
3679-
$ignoreErrors[] = [
3680-
'message' => '#^Method CodeIgniter\\\\Database\\\\SQLSRV\\\\Builder\\:\\:_insert\\(\\) has parameter \\$keys with no value type specified in iterable type array\\.$#',
3681-
'count' => 1,
3682-
'path' => __DIR__ . '/system/Database/SQLSRV/Builder.php',
3683-
];
3684-
$ignoreErrors[] = [
3685-
'message' => '#^Method CodeIgniter\\\\Database\\\\SQLSRV\\\\Builder\\:\\:_insert\\(\\) has parameter \\$unescapedKeys with no value type specified in iterable type array\\.$#',
3686-
'count' => 1,
3687-
'path' => __DIR__ . '/system/Database/SQLSRV/Builder.php',
3688-
];
3689-
$ignoreErrors[] = [
3690-
'message' => '#^Method CodeIgniter\\\\Database\\\\SQLSRV\\\\Builder\\:\\:_replace\\(\\) has parameter \\$keys with no value type specified in iterable type array\\.$#',
3691-
'count' => 1,
3692-
'path' => __DIR__ . '/system/Database/SQLSRV/Builder.php',
3693-
];
3694-
$ignoreErrors[] = [
3695-
'message' => '#^Method CodeIgniter\\\\Database\\\\SQLSRV\\\\Builder\\:\\:_replace\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#',
3696-
'count' => 1,
3697-
'path' => __DIR__ . '/system/Database/SQLSRV/Builder.php',
3698-
];
3699-
$ignoreErrors[] = [
3700-
'message' => '#^Method CodeIgniter\\\\Database\\\\SQLSRV\\\\Builder\\:\\:_update\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#',
3701-
'count' => 1,
3702-
'path' => __DIR__ . '/system/Database/SQLSRV/Builder.php',
3703-
];
37043619
$ignoreErrors[] = [
37053620
'message' => '#^Method CodeIgniter\\\\Database\\\\SQLSRV\\\\Builder\\:\\:fieldsFromQuery\\(\\) return type has no value type specified in iterable type array\\.$#',
37063621
'count' => 1,
@@ -3907,17 +3822,7 @@
39073822
'path' => __DIR__ . '/system/Database/SQLite3/Builder.php',
39083823
];
39093824
$ignoreErrors[] = [
3910-
'message' => '#^Method CodeIgniter\\\\Database\\\\SQLite3\\\\Builder\\:\\:_deleteBatch\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#',
3911-
'count' => 1,
3912-
'path' => __DIR__ . '/system/Database/SQLite3/Builder.php',
3913-
];
3914-
$ignoreErrors[] = [
3915-
'message' => '#^Method CodeIgniter\\\\Database\\\\SQLite3\\\\Builder\\:\\:_replace\\(\\) has parameter \\$keys with no value type specified in iterable type array\\.$#',
3916-
'count' => 1,
3917-
'path' => __DIR__ . '/system/Database/SQLite3/Builder.php',
3918-
];
3919-
$ignoreErrors[] = [
3920-
'message' => '#^Method CodeIgniter\\\\Database\\\\SQLite3\\\\Builder\\:\\:_replace\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#',
3825+
'message' => '#^Parameter \\#3 \\.\\.\\.\\$arrays of function array_map expects array, int\\|string given\\.$#',
39213826
'count' => 1,
39223827
'path' => __DIR__ . '/system/Database/SQLite3/Builder.php',
39233828
];

system/Database/BaseBuilder.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ public function orNotHavingLike($field, string $match = '', string $side = 'both
10901090
* @used-by notHavingLike()
10911091
* @used-by orNotHavingLike()
10921092
*
1093-
* @param array|RawSql|string $field
1093+
* @param array<string, string>|RawSql|string $field
10941094
*
10951095
* @return $this
10961096
*/
@@ -2376,7 +2376,9 @@ protected function validateInsert(): bool
23762376
/**
23772377
* Generates a platform-specific insert string from the supplied data
23782378
*
2379-
* @param string $table Protected table name
2379+
* @param string $table Protected table name
2380+
* @param list<string> $keys Keys of QBSet
2381+
* @param list<int|string> $unescapedKeys Values of QBSet
23802382
*/
23812383
protected function _insert(string $table, array $keys, array $unescapedKeys): string
23822384
{
@@ -2416,7 +2418,9 @@ public function replace(?array $set = null)
24162418
/**
24172419
* Generates a platform-specific replace string from the supplied data
24182420
*
2419-
* @param string $table Protected table name
2421+
* @param string $table Protected table name
2422+
* @param list<string> $keys Keys of QBSet
2423+
* @param list<int|string> $values Values of QBSet
24202424
*/
24212425
protected function _replace(string $table, array $keys, array $values): string
24222426
{
@@ -2512,7 +2516,8 @@ public function update($set = null, $where = null, ?int $limit = null): bool
25122516
/**
25132517
* Generates a platform-specific update string from the supplied data
25142518
*
2515-
* @param string $table Protected table name
2519+
* @param string $table Protected table name
2520+
* @param array<string, string> $values QBSet
25162521
*/
25172522
protected function _update(string $table, array $values): string
25182523
{
@@ -2863,9 +2868,9 @@ public function deleteBatch($set = null, $constraints = null, int $batchSize = 1
28632868
*
28642869
* @used-by batchExecute()
28652870
*
2866-
* @param string $table Protected table name
2867-
* @param list<string> $keys QBKeys
2868-
* @paramst<string|int>> $values QBSet
2871+
* @param string $table Protected table name
2872+
* @param list<string> $keys QBKeys
2873+
* @param list<int|string> $values QBSet
28692874
*/
28702875
protected function _deleteBatch(string $table, array $keys, array $values): string
28712876
{

0 commit comments

Comments
 (0)