Skip to content

Commit

Permalink
Merge branch 'master' into deprecate-schema-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik authored Feb 3, 2024
2 parents fd6c7dd + ff10686 commit 8506d51
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
- '8.0'
- '8.1'
- '8.2'
- '8.3'

steps:
- name: Checkout.
Expand Down Expand Up @@ -66,8 +67,10 @@ jobs:
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}

- name: Install dependencies with composer.
run: composer update --no-interaction --no-progress --optimize-autoloader --ansi

- name: Static analysis.
if: ${{ matrix.php != '8.0' }}
run: vendor/bin/psalm --config=${{ inputs.psalm-config }} --shepherd --stats --output-format=github --php-version=${{ matrix.php }}

- name: Static analysis.
if: ${{ matrix.php == '8.0' }}
run: vendor/bin/psalm --config=psalm4.xml --shepherd --stats --output-format=github --php-version=${{ matrix.php }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Enh #286: Change property `Schema::$typeMap` to constant `Schema::TYPE_MAP` (@Tigrov)
- Bug #287: Fix `DMLQueryBuilder::insertWithReturningPks()` and `Command::insertWithReturningPks()` methods (@Tigrov)
- Enh #292: Minor refactoring of `Command` and `Quoter` (@Tigrov)
- Enh #291: Resolve deprecated methods (@Tigrov)

## 1.1.0 November 12, 2023
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"rector/rector": "^0.19",
"roave/infection-static-analysis-plugin": "^1.16",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.3|^5.6",
"vimeo/psalm": "^4.30|^5.20",
"yiisoft/aliases": "^2.0",
"yiisoft/cache-file": "^3.1",
"yiisoft/var-dumper": "^1.5"
Expand Down
3 changes: 3 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<RiskyTruthyFalsyComparison errorLevel="suppress" />
</issueHandlers>
</psalm>
17 changes: 17 additions & 0 deletions psalm4.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
findUnusedBaselineEntry="true"
findUnusedCode="false"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
2 changes: 1 addition & 1 deletion src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class Command extends AbstractPdoCommand
public function insertWithReturningPks(string $table, array $columns): bool|array
{
if (empty($this->db->getSchema()->getTableSchema($table)?->getPrimaryKey())) {
if (parent::insert($table, $columns)->execute() === 0) {
if ($this->insert($table, $columns)->execute() === 0) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Quoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function quoteColumnName(string $name): string

public function getTableNameParts(string $name, bool $withColumn = false): array
{
if (preg_match_all('/([^.\[\]]+)|\[([^\[\]]+)]/', $name, $matches)) {
if (preg_match_all('/([^.\[\]]+)|\[([^\[\]]+)]/', $name, $matches) > 0) {
$parts = array_slice($matches[0], -4, 4);
} else {
$parts = [$name];
Expand Down

0 comments on commit 8506d51

Please sign in to comment.