File tree Expand file tree Collapse file tree 7 files changed +50
-10
lines changed Expand file tree Collapse file tree 7 files changed +50
-10
lines changed Original file line number Diff line number Diff line change 44
44
- ' 8.0'
45
45
- ' 8.1'
46
46
- ' 8.2'
47
+ - ' 8.3'
47
48
48
49
steps :
49
50
- name : Checkout.
71
72
FULL_BRANCH_NAME : ${{ env.FULL_BRANCH_NAME }}
72
73
WORK_PACKAGE_URL : ${{ env.WORK_PACKAGE_URL }}
73
74
74
- - name : Install dependencies with composer.
75
- run : composer update --no-interaction --no-progress --optimize-autoloader --ansi
76
-
77
75
- name : Static analysis.
76
+ if : ${{ matrix.php != '8.0' }}
78
77
run : vendor/bin/psalm --config=${{ inputs.psalm-config }} --shepherd --stats --output-format=github --php-version=${{ matrix.php }}
78
+
79
+ - name : Static analysis.
80
+ if : ${{ matrix.php == '8.0' }}
81
+ run : vendor/bin/psalm --config=psalm4.xml --shepherd --stats --output-format=github --php-version=${{ matrix.php }}
Original file line number Diff line number Diff line change 6
6
- Bug #250 : Fix ` Command::insertWithReturningPks() ` method for table without primary keys (@Tigrov )
7
7
- Enh #251 : Allow to use ` DMLQueryBuilderInterface::batchInsert() ` method with empty columns (@Tigrov )
8
8
- Bug #238 : Fix execution ` Query ` without table(s) to select from (@Tigrov )
9
+ - Bug #254 : Fix, table sequence name should be null if sequence name not found (@Tigrov )
9
10
10
11
## 1.2.0 November 12, 2023
11
12
Original file line number Diff line number Diff line change 30
30
"rector/rector" : " ^0.19" ,
31
31
"roave/infection-static-analysis-plugin" : " ^1.16" ,
32
32
"spatie/phpunit-watcher" : " ^1.23" ,
33
- "vimeo/psalm" : " ^4.3 |^5.6 " ,
33
+ "vimeo/psalm" : " ^4.30 |^5.20 " ,
34
34
"yiisoft/aliases" : " ^2.0" ,
35
35
"yiisoft/cache-file" : " ^3.1" ,
36
36
"yiisoft/var-dumper" : " ^1.5"
Original file line number Diff line number Diff line change 16
16
</projectFiles >
17
17
<issueHandlers >
18
18
<MixedAssignment errorLevel =" suppress" />
19
+ <RiskyTruthyFalsyComparison errorLevel =" suppress" />
19
20
</issueHandlers >
20
21
</psalm >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ <psalm
3
+ errorLevel =" 1"
4
+ findUnusedBaselineEntry =" true"
5
+ findUnusedCode =" false"
6
+ resolveFromConfigFile =" true"
7
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
8
+ xmlns =" https://getpsalm.org/schema/config"
9
+ xsi : schemaLocation =" https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
10
+ >
11
+ <projectFiles >
12
+ <directory name =" src" />
13
+ <ignoreFiles >
14
+ <directory name =" vendor" />
15
+ </ignoreFiles >
16
+ </projectFiles >
17
+ <issueHandlers >
18
+ <MixedAssignment errorLevel =" suppress" />
19
+ </issueHandlers >
20
+ </psalm >
Original file line number Diff line number Diff line change @@ -423,11 +423,11 @@ protected function findColumns(TableSchemaInterface $table): bool
423
423
* @throws InvalidConfigException
424
424
* @throws Throwable
425
425
*
426
- * @return bool|float|int| string|null Whether the sequence exists.
426
+ * @return string|null Whether the sequence exists.
427
427
*
428
428
* @internal TableSchemaInterface `$table->getName()` The table schema.
429
429
*/
430
- protected function getTableSequenceName (string $ tableName ): bool | float | int | string |null
430
+ protected function getTableSequenceName (string $ tableName ): string |null
431
431
{
432
432
$ sequenceNameSql = <<<SQL
433
433
SELECT
@@ -441,6 +441,7 @@ protected function getTableSequenceName(string $tableName): bool|float|int|strin
441
441
SQL ;
442
442
$ sequenceName = $ this ->db ->createCommand ($ sequenceNameSql , [':tableName ' => $ tableName ])->queryScalar ();
443
443
444
+ /** @var string|null */
444
445
return $ sequenceName === false ? null : $ sequenceName ;
445
446
}
446
447
@@ -560,7 +561,7 @@ protected function findConstraints(TableSchemaInterface $table): void
560
561
$ table ->primaryKey ($ row ['column_name ' ]);
561
562
562
563
if (empty ($ table ->getSequenceName ())) {
563
- $ table ->sequenceName (( string ) $ this ->getTableSequenceName ($ table ->getName ()));
564
+ $ table ->sequenceName ($ this ->getTableSequenceName ($ table ->getName ()));
564
565
}
565
566
}
566
567
Original file line number Diff line number Diff line change @@ -566,16 +566,30 @@ public function testResetSequence(): void
566
566
* @throws InvalidConfigException
567
567
* @throws NotSupportedException
568
568
*/
569
- public function testResetSequenceCompositeException (): void
569
+ public function testResetNonExistSequenceException (): void
570
570
{
571
571
$ db = $ this ->getConnection (true );
572
+ $ qb = $ db ->getQueryBuilder ();
573
+
574
+ $ this ->expectException (InvalidArgumentException::class);
575
+ $ this ->expectExceptionMessage ("There is not sequence associated with table 'default_multiple_pk'. " );
576
+ $ qb ->resetSequence ('default_multiple_pk ' );
577
+
578
+ $ db ->close ();
579
+ }
580
+
581
+ public function testResetSequenceCompositeException (): void
582
+ {
583
+ self ::markTestSkipped ('Sequence name not found for composite primary key ' );
572
584
585
+ $ db = $ this ->getConnection (true );
573
586
$ qb = $ db ->getQueryBuilder ();
574
587
575
588
$ this ->expectException (InvalidArgumentException::class);
576
- $ this ->expectExceptionMessage ("Can't reset sequence for composite primary key in table: default_multiple_pk " );
589
+ $ this ->expectExceptionMessage ("Can't reset sequence for composite primary key in table: employee " );
590
+ $ qb ->resetSequence ('employee ' );
577
591
578
- $ qb -> resetSequence ( ' default_multiple_pk ' );
592
+ $ db -> close ( );
579
593
}
580
594
581
595
/**
You can’t perform that action at this time.
0 commit comments