Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ab59b5

Browse files
Fix issue psalm. (#253)
1 parent 77fa093 commit 0ab59b5

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

.github/workflows/composer-require-checker.yml

+3
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,8 @@ jobs:
6868
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
6969
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
7070

71+
- name: Install dependencies with composer.
72+
run: composer update --no-interaction --no-progress --optimize-autoloader --ansi
73+
7174
- name: Check dependencies.
7275
run: vendor/bin/composer-require-checker

.github/workflows/static.yml

-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ jobs:
3434
matrix:
3535
os:
3636
- ubuntu-latest
37-
- windows-latest
3837

3938
php:
4039
- '8.0'
@@ -56,13 +55,8 @@ jobs:
5655
run: composer self-update
5756

5857
- name: Set environment variables pull request linux.
59-
if: matrix.os == 'ubuntu-latest'
6058
uses: yiisoft/actions/db/environment-linux@master
6159

62-
- name: Set environment variables pull request windows.
63-
if: matrix.os == 'windows-latest'
64-
uses: yiisoft/actions/db/environment-windows@master
65-
6660
- name: Install db.
6761
uses: yiisoft/actions/db/subpackage-install@master
6862
with:

src/DMLQueryBuilder.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,31 @@ public function insertWithReturningPks(string $table, QueryInterface|array $colu
2626
throw new NotSupportedException(__METHOD__ . '() is not supported by SQLite.');
2727
}
2828

29-
public function resetSequence(string $tableName, int|string $value = null): string
29+
public function resetSequence(string $table, int|string $value = null): string
3030
{
31-
$table = $this->schema->getTableSchema($tableName);
31+
$tableSchema = $this->schema->getTableSchema($table);
3232

33-
if ($table === null) {
34-
throw new InvalidArgumentException("Table not found: '$tableName'.");
33+
if ($tableSchema === null) {
34+
throw new InvalidArgumentException("Table not found: '$table'.");
3535
}
3636

37-
$sequenceName = $table->getSequenceName();
37+
$sequenceName = $tableSchema->getSequenceName();
3838

3939
if ($sequenceName === null) {
40-
throw new InvalidArgumentException("There is not sequence associated with table '$tableName'.'");
40+
throw new InvalidArgumentException("There is not sequence associated with table '$table'.'");
4141
}
4242

43-
$tableName = $this->quoter->quoteTableName($tableName);
43+
$tableName = $this->quoter->quoteTableName($table);
4444

4545
if ($value !== null) {
4646
$value = "'" . ((int) $value - 1) . "'";
4747
} else {
48-
$pk = $table->getPrimaryKey();
48+
$pk = $tableSchema->getPrimaryKey();
4949
$key = $this->quoter->quoteColumnName(reset($pk));
5050
$value = '(SELECT MAX(' . $key . ') FROM ' . $tableName . ')';
5151
}
5252

53-
return 'UPDATE sqlite_sequence SET seq=' . $value . " WHERE name='" . $table->getName() . "'";
53+
return 'UPDATE sqlite_sequence SET seq=' . $value . " WHERE name='" . $tableSchema->getName() . "'";
5454
}
5555

5656
public function upsert(

0 commit comments

Comments
 (0)