Skip to content

Commit 608f8e9

Browse files
committed
Add type cast for doctrine + add PHP 8.1 tests
1 parent d7f152d commit 608f8e9

File tree

7 files changed

+27
-12
lines changed

7 files changed

+27
-12
lines changed

docker/compose-coverage.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "3.7"
22
services:
33
squirrel_queries_coverage:
4-
image: thecodingmachine/php:8.0-v4-cli
4+
image: thecodingmachine/php:8.1-v4-cli
55
container_name: squirrel_queries_coverage
66
tty: true
77
working_dir: /usr/src/app
@@ -31,7 +31,7 @@ services:
3131
SQUIRREL_TEST_POSTGRES: 'postgres://user:password@squirrel_queries_postgres/postgres?charset=UTF-8'
3232
SQUIRREL_TEST_MYSQL: 'mysql://user:password@squirrel_queries_mysql/shop'
3333
SQUIRREL_TEST_MARIADB: 'mysql://user:password@squirrel_queries_mariadb/shop'
34-
STARTUP_COMMAND_1: composer update --no-scripts --quiet
34+
STARTUP_COMMAND_1: composer update --no-scripts --no-plugins --quiet
3535
STARTUP_COMMAND_2: rm -rf /usr/src/app/tests/_reports/*
3636
depends_on:
3737
- squirrel_queries_postgres

docker/compose-test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "3.7"
22
services:
33
squirrel_queries_test:
4-
image: thecodingmachine/php:8.0-v4-cli
4+
image: thecodingmachine/php:8.1-v4-cli
55
container_name: squirrel_queries_test
66
tty: true
77
working_dir: /usr/src/app
@@ -25,7 +25,7 @@ services:
2525
SQUIRREL_TEST_POSTGRES: 'postgres://user:password@squirrel_queries_postgres/postgres?charset=UTF-8'
2626
SQUIRREL_TEST_MYSQL: 'mysql://user:password@squirrel_queries_mysql/shop'
2727
SQUIRREL_TEST_MARIADB: 'mysql://user:password@squirrel_queries_mariadb/shop'
28-
STARTUP_COMMAND_1: composer update --no-scripts --quiet
28+
STARTUP_COMMAND_1: composer update --no-scripts --no-plugins --quiet
2929
depends_on:
3030
- squirrel_queries_postgres
3131
- squirrel_queries_mysql

phpstan-baseline.neon

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Method Squirrel\\\\Queries\\\\Builder\\\\SelectEntries\\:\\:getFlattenedIntegerFields\\(\\) should return array\\<int\\> but returns array\\<bool\\|float\\|int\\|string\\|null\\>\\.$#"
4+
message: "#^Method Squirrel\\\\Queries\\\\Builder\\\\SelectEntries\\:\\:getFlattenedBooleanFields\\(\\) should return array\\<bool\\> but returns array\\<bool\\|float\\|int\\|string\\|null\\>\\.$#"
55
count: 1
66
path: src/Builder/SelectEntries.php
77

@@ -11,15 +11,30 @@ parameters:
1111
path: src/Builder/SelectEntries.php
1212

1313
-
14-
message: "#^Method Squirrel\\\\Queries\\\\Builder\\\\SelectEntries\\:\\:getFlattenedStringFields\\(\\) should return array\\<string\\> but returns array\\<bool\\|float\\|int\\|string\\|null\\>\\.$#"
14+
message: "#^Method Squirrel\\\\Queries\\\\Builder\\\\SelectEntries\\:\\:getFlattenedIntegerFields\\(\\) should return array\\<int\\> but returns array\\<bool\\|float\\|int\\|string\\|null\\>\\.$#"
1515
count: 1
1616
path: src/Builder/SelectEntries.php
1717

1818
-
19-
message: "#^Method Squirrel\\\\Queries\\\\Builder\\\\SelectEntries\\:\\:getFlattenedBooleanFields\\(\\) should return array\\<bool\\> but returns array\\<bool\\|float\\|int\\|string\\|null\\>\\.$#"
19+
message: "#^Method Squirrel\\\\Queries\\\\Builder\\\\SelectEntries\\:\\:getFlattenedStringFields\\(\\) should return array\\<string\\> but returns array\\<bool\\|float\\|int\\|string\\|null\\>\\.$#"
2020
count: 1
2121
path: src/Builder/SelectEntries.php
2222

23+
-
24+
message: "#^Dead catch \\- Doctrine\\\\DBAL\\\\Exception\\\\ConnectionException is never thrown in the try block\\.$#"
25+
count: 1
26+
path: src/Doctrine/DBErrorHandler.php
27+
28+
-
29+
message: "#^Dead catch \\- Doctrine\\\\DBAL\\\\Exception\\\\DeadlockException\\|Doctrine\\\\DBAL\\\\Exception\\\\LockWaitTimeoutException is never thrown in the try block\\.$#"
30+
count: 1
31+
path: src/Doctrine/DBErrorHandler.php
32+
33+
-
34+
message: "#^Dead catch \\- Doctrine\\\\DBAL\\\\Exception\\\\DriverException is never thrown in the try block\\.$#"
35+
count: 1
36+
path: src/Doctrine/DBErrorHandler.php
37+
2338
-
2439
message: "#^Cannot access offset 'v' on array\\<string, mixed\\>\\|false\\.$#"
2540
count: 1

psalm-baseline.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="4.7.3@38c452ae584467e939d55377aaf83b5a26f19dd1">
2+
<files psalm-version="4.13.1@5cf660f63b548ccd4a56f62d916ee4d6028e01a3">
33
<file src="src/Builder/FlattenedFieldsWithTypeTrait.php">
44
<InvalidReturnType occurrences="4">
55
<code>bool[]</code>

src/Doctrine/DBAbstractImplementation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function insert(string $table, array $row = [], string $autoIncrement = '
195195
}
196196

197197
// Return autoincrement ID
198-
return $this->connection->lastInsertId($table . '_' . $autoIncrement . '_seq');
198+
return \strval($this->connection->lastInsertId($table . '_' . $autoIncrement . '_seq'));
199199
}
200200

201201
public function update(string $table, array $changes, array $where = []): int

vendor-bin/phpstan/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"phpstan/phpstan": "^0.12"
3+
"phpstan/phpstan": "^1.0"
44
}
55
}

vendor-bin/psalm/composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"vimeo/psalm": "^4.0",
4-
"psalm/plugin-phpunit": "^0.16",
5-
"psalm/plugin-mockery": "^0.7"
4+
"psalm/plugin-phpunit": "*",
5+
"psalm/plugin-mockery": "*"
66
}
77
}

0 commit comments

Comments
 (0)