Skip to content
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
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Install composer dependencies
run: composer update --prefer-dist
env:
COMPOSER_ROOT_VERSION: dev-master
COMPOSER_ROOT_VERSION: 2.x-dev

- name: Generate aux code
run: vendor/bin/codecept build
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
- name: Install composer dependencies
run: composer update --prefer-dist
env:
COMPOSER_ROOT_VERSION: dev-master
COMPOSER_ROOT_VERSION: 2.x-dev

- name: Run PHPCodeSniffer
run: vendor/bin/phpcs --report=checkstyle --cache=~/.cache/phpcs -q --parallel=1 | cs2pr
Expand Down Expand Up @@ -176,19 +176,19 @@ jobs:
run: composer update --prefer-dist --no-interaction
if: ${{ matrix.deps == 'high' }}
env:
COMPOSER_ROOT_VERSION: dev-master
COMPOSER_ROOT_VERSION: 2.x-dev

- name: Install composer dependencies (low deps)
run: composer update --prefer-dist --no-interaction --prefer-stable --prefer-lowest
if: ${{ matrix.deps == 'low' }}
env:
COMPOSER_ROOT_VERSION: dev-master
COMPOSER_ROOT_VERSION: 2.x-dev

- name: Install composer dependencies (stable deps)
run: composer update --prefer-dist --no-interaction --prefer-stable
if: ${{ matrix.deps == 'stable' }}
env:
COMPOSER_ROOT_VERSION: dev-master
COMPOSER_ROOT_VERSION: 2.x-dev

- name: Show Psalm version
run: vendor/bin/psalm --version
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"php": "^8.2",
"composer-runtime-api": "^2",
"psalm/psalm-plugin-api": "^0.4 || ^0.5",
"vimeo/psalm": "^7.0.0-rc28|dev-master"
"vimeo/psalm": "^7.13|dev-master"
},
"conflict": {
"doctrine/collections": "<1.8",
Expand Down
16 changes: 16 additions & 0 deletions stubs/DBAL/before-4/Connection.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ class Connection implements DriverConnection
/**
* @throws DBALException
* @psalm-taint-sink sql $statement
* @psalm-database-prepare $statement
*/
public function prepare(string $statement): Statement {}

/**
* @psalm-taint-sink sql $statement
* @psalm-database-query $statement none
*/
public function exec(string $statement): int {}

Expand All @@ -67,6 +69,7 @@ class Connection implements DriverConnection
*
* @throws DBALException
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params none
*/
public function executeUpdate(string $query, array $params = [], array $types = []): int {}

Expand All @@ -78,6 +81,7 @@ class Connection implements DriverConnection
*
* @throws DBALException
* @psalm-taint-sink sql $sql
* @psalm-database-query $sql $params result
*/
public function executeQuery($sql, array $params = [], $types = [], ?Cache\QueryCacheProfile $qcp = null) {}

Expand All @@ -87,6 +91,7 @@ class Connection implements DriverConnection
*
* @throws DBALException
* @psalm-taint-sink sql $sql
* @psalm-database-query $sql $params none
*/
public function executeStatement($sql, array $params = [], array $types = []): int {}

Expand Down Expand Up @@ -114,6 +119,7 @@ class Connection implements DriverConnection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params result
*/
public function fetchAssociative(string $query, array $params = [], array $types = []) {}

Expand All @@ -130,6 +136,7 @@ class Connection implements DriverConnection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params result
*/
public function fetchNumeric(string $query, array $params = [], array $types = []) {}

Expand All @@ -146,6 +153,7 @@ class Connection implements DriverConnection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params value
*/
public function fetchOne(string $query, array $params = [], array $types = []) {}

Expand All @@ -161,6 +169,7 @@ class Connection implements DriverConnection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params rows
*/
public function fetchAllNumeric(string $query, array $params = [], array $types = []): array {}

Expand All @@ -176,6 +185,7 @@ class Connection implements DriverConnection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params rows
*/
public function fetchAllAssociative(string $query, array $params = [], array $types = []): array {}

Expand Down Expand Up @@ -209,6 +219,7 @@ class Connection implements DriverConnection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params rows
*/
public function fetchAllAssociativeIndexed(string $query, array $params = [], array $types = []): array {}

Expand All @@ -224,6 +235,7 @@ class Connection implements DriverConnection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params column
*/
public function fetchFirstColumn(string $query, array $params = [], array $types = []): array {}

Expand All @@ -239,6 +251,7 @@ class Connection implements DriverConnection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params rows
*/
public function iterateNumeric(string $query, array $params = [], array $types = []): Traversable {}

Expand All @@ -255,6 +268,7 @@ class Connection implements DriverConnection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params rows
*/
public function iterateAssociative(string $query, array $params = [], array $types = []): Traversable {}

Expand Down Expand Up @@ -288,6 +302,7 @@ class Connection implements DriverConnection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params rows
*/
public function iterateAssociativeIndexed(string $query, array $params = [], array $types = []): Traversable {}

Expand All @@ -303,6 +318,7 @@ class Connection implements DriverConnection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params column
*/
public function iterateColumn(string $query, array $params = [], array $types = []): Traversable {}
}
14 changes: 14 additions & 0 deletions stubs/DBAL/since-4/Connection.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $sql
* @psalm-database-prepare $sql
*/
public function prepare(string $sql): Statement {}

Expand All @@ -39,6 +40,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $sql
* @psalm-database-query $sql $params result
*/
public function executeQuery(
string $sql,
Expand Down Expand Up @@ -67,6 +69,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $sql
* @psalm-database-query $sql $params none
*/
public function executeStatement(string $sql, array $params = [], array $types = []): int|string {}

Expand All @@ -93,6 +96,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params result
*/
public function fetchAssociative(string $query, array $params = [], array $types = []): array|false {}

Expand All @@ -108,6 +112,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params result
*/
public function fetchNumeric(string $query, array $params = [], array $types = []): array|false {}

Expand All @@ -123,6 +128,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params value
*/
public function fetchOne(string $query, array $params = [], array $types = []): mixed {}

Expand All @@ -137,6 +143,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params rows
*/
public function fetchAllNumeric(string $query, array $params = [], array $types = []): array {}

Expand All @@ -151,6 +158,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params rows
*/
public function fetchAllAssociative(string $query, array $params = [], array $types = []): array {}

Expand Down Expand Up @@ -182,6 +190,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params rows
*/
public function fetchAllAssociativeIndexed(string $query, array $params = [], array $types = []): array {}

Expand All @@ -196,6 +205,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params column
*/
public function fetchFirstColumn(string $query, array $params = [], array $types = []): array {}

Expand All @@ -210,6 +220,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params rows
*/
public function iterateNumeric(string $query, array $params = [], array $types = []): Traversable {}

Expand All @@ -225,6 +236,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params rows
*/
public function iterateAssociative(string $query, array $params = [], array $types = []): Traversable {}

Expand Down Expand Up @@ -256,6 +268,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params rows
*/
public function iterateAssociativeIndexed(string $query, array $params = [], array $types = []): Traversable {}

Expand All @@ -270,6 +283,7 @@ class Connection
* @throws Exception
*
* @psalm-taint-sink sql $query
* @psalm-database-query $query $params column
*/
public function iterateColumn(string $query, array $params = [], array $types = []): Traversable {}
}
110 changes: 110 additions & 0 deletions stubs/DBAL/since-4/Result.phpstub
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?php
// phpcs:ignoreFile
namespace Doctrine\DBAL;

use Traversable;

/**
* What the rows of a result of doctrine/dbal 4 hold.
*/
class Result
{
/**
* @return list<mixed>|false
*
* @throws Exception
*
* @psalm-database-fetch result
*/
public function fetchNumeric(): array|false {}

/**
* @return array<string, mixed>|false
*
* @throws Exception
*
* @psalm-database-fetch result
*/
public function fetchAssociative(): array|false {}

/**
* @return mixed|false
*
* @throws Exception
*
* @psalm-database-fetch value
*/
public function fetchOne(): mixed {}

/**
* @return list<list<mixed>>
*
* @throws Exception
*
* @psalm-database-fetch rows
*/
public function fetchAllNumeric(): array {}

/**
* @return list<array<string,mixed>>
*
* @throws Exception
*
* @psalm-database-fetch rows
*/
public function fetchAllAssociative(): array {}

/**
* @return array<mixed,array<string,mixed>>
*
* @throws Exception
*
* @psalm-database-fetch rows
*/
public function fetchAllAssociativeIndexed(): array {}

/**
* @return list<mixed>
*
* @throws Exception
*
* @psalm-database-fetch column
*/
public function fetchFirstColumn(): array {}

/**
* @return Traversable<int,list<mixed>>
*
* @throws Exception
*
* @psalm-database-fetch rows
*/
public function iterateNumeric(): Traversable {}

/**
* @return Traversable<int,array<string,mixed>>
*
* @throws Exception
*
* @psalm-database-fetch rows
*/
public function iterateAssociative(): Traversable {}

/**
* @return Traversable<mixed,array<string,mixed>>
*
* @throws Exception
*
* @psalm-database-fetch rows
*/
public function iterateAssociativeIndexed(): Traversable {}

/**
* @return Traversable<int,mixed>
*
* @throws Exception
*
* @psalm-database-fetch column
*/
public function iterateColumn(): Traversable {}
}
Loading