Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Psalm 5.21.1 #6294

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"squizlabs/php_codesniffer": "3.8.1",
"symfony/cache": "^6.3.8|^7.0",
"symfony/console": "^5.4|^6.3|^7.0",
"vimeo/psalm": "5.16.0"
"vimeo/psalm": "5.21.1"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
Expand Down
4 changes: 3 additions & 1 deletion src/Driver/OCI8/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@

$connectionString = $this->getEasyConnectString($params);

/** @psalm-suppress RiskyTruthyFalsyComparison */
$persistent = ! empty($params['persistent']);
$exclusive = ! empty($params['driverOptions']['exclusive']);
/** @psalm-suppress RiskyTruthyFalsyComparison */
$exclusive = ! empty($params['driverOptions']['exclusive']);

Check warning on line 40 in src/Driver/OCI8/Driver.php

View check run for this annotation

Codecov / codecov/patch

src/Driver/OCI8/Driver.php#L40

Added line #L40 was not covered by tests

if ($persistent && $exclusive) {
throw InvalidConfiguration::forPersistentAndExclusive();
Expand Down
1 change: 1 addition & 0 deletions src/Platforms/SQLitePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ private function getSimpleAlterTableSQL(TableDiff $diff): array|false

$type = $definition['type'];

/** @psalm-suppress RiskyTruthyFalsyComparison */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to improve this code in 4.1 which should fix the error. This suppression is hopefully only temporary. 🤞🏻

switch (true) {
case isset($definition['columnDefinition']) || $definition['autoincrement'] || $definition['unique']:
case $type instanceof Types\DateTimeType && $definition['default'] === $this->getCurrentTimestampSQL():
Expand Down
1 change: 1 addition & 0 deletions tests/Functional/Driver/OCI8/ResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function testTruncatedFetch(
// after the initial prefetch that caches locally the first X results
$this->createOrReplacePipelinedFunction($expectedTotalRowCount + 10);

/** @var callable|null $previous */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$previous = null;
$previous = set_error_handler(static function (int $errno, string $errstr) use (&$previous): bool {
if (str_contains($errstr, 'ORA-04061')) {
Expand Down
1 change: 1 addition & 0 deletions tests/Functional/ExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function testInvalidFieldNameException(): void
$this->expectException(Exception\InvalidFieldNameException::class);

// prevent the PHPUnit error handler from handling the warning that db2_bind_param() may trigger
/** @var callable|null $previous */
$previous = null;
$previous = set_error_handler(static function (int $errno) use (&$previous): bool {
if (($errno & ~E_WARNING) === 0) {
Expand Down
1 change: 1 addition & 0 deletions tests/Functional/TransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private function expectConnectionLoss(callable $scenario): void
$this->expectException(ConnectionLost::class);

// prevent the PHPUnit error handler from handling the "MySQL server has gone away" warning
/** @var callable|null $previous */
$previous = null;
$previous = set_error_handler(static function (int $errno) use (&$previous): bool {
if (($errno & ~E_WARNING) === 0) {
Expand Down
Loading