diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 301ab7c15..cc4ab5a8a 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -28,4 +28,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.1', '8.2'] + ['8.3'] diff --git a/composer.json b/composer.json index f9199cc8b..2272a2539 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "rector/rector": "^0.19", "roave/infection-static-analysis-plugin": "^1.16", "spatie/phpunit-watcher": "^1.23", - "vimeo/psalm": "^4.30|^5.12", + "vimeo/psalm": "^5.20", "yiisoft/aliases": "^3.0", "yiisoft/cache-file": "^3.1", "yiisoft/di": "^1.0", diff --git a/psalm.xml b/psalm.xml index 54a52e176..fc5771199 100644 --- a/psalm.xml +++ b/psalm.xml @@ -16,5 +16,6 @@ + diff --git a/src/Cache/SchemaCache.php b/src/Cache/SchemaCache.php index 27a7b6d31..fcfbab66d 100644 --- a/src/Cache/SchemaCache.php +++ b/src/Cache/SchemaCache.php @@ -201,12 +201,12 @@ private function normalize(mixed $key): string if (is_string($key) || is_int($key)) { $key = (string)$key; $length = mb_strlen($key, '8bit'); - return (strpbrk($key, '{}()/\@:') || $length < 1 || $length > 64) ? md5($key) : $key; + return (strpbrk($key, '{}()/\@:') !== false || $length < 1 || $length > 64) ? md5($key) : $key; } $key = json_encode($key); - if (!$key) { + if ($key === false) { throw new PsrInvalidArgumentException('Invalid key. ' . json_last_error_msg()); } diff --git a/src/Driver/Pdo/AbstractPdoCommand.php b/src/Driver/Pdo/AbstractPdoCommand.php index 3f632e3ce..0611c834e 100644 --- a/src/Driver/Pdo/AbstractPdoCommand.php +++ b/src/Driver/Pdo/AbstractPdoCommand.php @@ -211,7 +211,7 @@ protected function internalExecute(string|null $rawSql): void } break; } catch (PDOException $e) { - $rawSql = $rawSql ?: $this->getRawSql(); + $rawSql ??= $this->getRawSql(); $e = (new ConvertException($e, $rawSql))->run(); if ($this->retryHandler === null || !($this->retryHandler)($e, $attempt)) { diff --git a/src/QueryBuilder/AbstractDDLQueryBuilder.php b/src/QueryBuilder/AbstractDDLQueryBuilder.php index d73f57853..095cf04fb 100644 --- a/src/QueryBuilder/AbstractDDLQueryBuilder.php +++ b/src/QueryBuilder/AbstractDDLQueryBuilder.php @@ -159,7 +159,7 @@ public function createIndex( string $indexType = null, string $indexMethod = null ): string { - return 'CREATE ' . ($indexType ? ($indexType . ' ') : '') . 'INDEX ' + return 'CREATE ' . (!empty($indexType) ? $indexType . ' ' : '') . 'INDEX ' . $this->quoter->quoteTableName($name) . ' ON ' . $this->quoter->quoteTableName($table) . ' (' . $this->queryBuilder->buildColumns($columns) . ')';