Skip to content

Commit 601ec58

Browse files
committed
docs: fix @phpstan-return
1 parent 3f56cc5 commit 601ec58

4 files changed

Lines changed: 5 additions & 14 deletions

File tree

phpstan-baseline.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,11 +1451,6 @@
14511451
'count' => 1,
14521452
'path' => __DIR__ . '/system/Database/Postgre/Forge.php',
14531453
];
1454-
$ignoreErrors[] = [
1455-
'message' => '#^Return type \\(array\\|bool\\|string\\) of method CodeIgniter\\\\Database\\\\Postgre\\\\Forge\\:\\:_alterTable\\(\\) should be covariant with return type \\(array\\<string\\>\\|string\\|false\\) of method CodeIgniter\\\\Database\\\\Forge\\:\\:_alterTable\\(\\)$#',
1456-
'count' => 1,
1457-
'path' => __DIR__ . '/system/Database/Postgre/Forge.php',
1458-
];
14591454
$ignoreErrors[] = [
14601455
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
14611456
'count' => 1,
@@ -1656,11 +1651,6 @@
16561651
'count' => 1,
16571652
'path' => __DIR__ . '/system/Database/SQLite3/Forge.php',
16581653
];
1659-
$ignoreErrors[] = [
1660-
'message' => '#^Return type \\(array\\|string\\|null\\) of method CodeIgniter\\\\Database\\\\SQLite3\\\\Forge\\:\\:_alterTable\\(\\) should be covariant with return type \\(array\\<string\\>\\|string\\|false\\) of method CodeIgniter\\\\Database\\\\Forge\\:\\:_alterTable\\(\\)$#',
1661-
'count' => 1,
1662-
'path' => __DIR__ . '/system/Database/SQLite3/Forge.php',
1663-
];
16641654
$ignoreErrors[] = [
16651655
'message' => '#^Return type \\(SQLite3Result\\|false\\) of method CodeIgniter\\\\Database\\\\SQLite3\\\\PreparedQuery\\:\\:_getResult\\(\\) should be covariant with return type \\(object\\|resource\\|null\\) of method CodeIgniter\\\\Database\\\\BasePreparedQuery\\<SQLite3,SQLite3Stmt,SQLite3Result\\>\\:\\:_getResult\\(\\)$#',
16661656
'count' => 1,

system/Database/Forge.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,8 @@ public function modifyColumn(string $table, $field): bool
822822
* @param array|string $processedFields Processed column definitions
823823
* or column names to DROP
824824
*
825-
* @return list<string>|string SQL string
826-
* @phpstan-return ($alterType is 'DROP' ? string : list<string>)
825+
* @return false|list<string>|string|null SQL string
826+
* @phpstan-return ($alterType is 'DROP' ? string : list<string>|false|null)
827827
*/
828828
protected function _alterTable(string $alterType, string $table, $processedFields)
829829
{

system/Database/SQLSRV/Forge.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ protected function _createTableAttributes(array $attributes): string
129129
* @param array|string $processedFields Processed column definitions
130130
* or column names to DROP
131131
*
132-
* @return list<string>|string SQL string
133-
* @phpstan-return ($alterType is 'DROP' ? string : list<string>)
132+
* @return false|list<string>|string SQL string or false
133+
* @phpstan-return ($alterType is 'DROP' ? string : list<string>|false)
134134
*/
135135
protected function _alterTable(string $alterType, string $table, $processedFields)
136136
{

system/Database/SQLite3/Forge.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public function dropDatabase(string $dbName): bool
114114
*
115115
* @return array|string|null
116116
* @return list<string>|string|null SQL string or null
117+
* @phpstan-return ($alterType is 'DROP' ? string : list<string>|false|null)
117118
*/
118119
protected function _alterTable(string $alterType, string $table, $processedFields)
119120
{

0 commit comments

Comments
 (0)