diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4dbd81dd..178279aa 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,7 +11,7 @@ on: - cron: "0 8 * * 1" # At 08:00 on Monday env: - extensions: "json" + extensions: "json, mysqli, pdo_sqlite" cache-version: "1" composer-version: "v2" composer-install: "composer update --no-interaction --no-progress --no-suggest --prefer-dist --prefer-stable" diff --git a/phpstan.neon b/phpstan.neon index 6db4aba4..3c2012ac 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -37,11 +37,3 @@ parameters: message: '/^Instanceof between Dibi\\Result and Dibi\\Result will always evaluate to true\.$/' count: 1 path: src/DataSource/DibiFluentMssqlDataSource.php - - - message: '/^Parameter #2 \$offset of method Nette\\Database\\Table\\Selection::limit\(\) expects int<0, max>\|null, int given\.$/' - count: 1 - path: src/DataSource/NetteDatabaseTableDataSource.php - - - message: '/^Parameter #1 \$limit of method Nette\\Database\\Table\\Selection::limit\(\) expects int<0, max>\|null, int given\.$/' - count: 1 - path: src/DataSource/NetteDatabaseTableDataSource.php diff --git a/src/DataSource/IDataSource.php b/src/DataSource/IDataSource.php index 57e0401e..e1d1ce8e 100644 --- a/src/DataSource/IDataSource.php +++ b/src/DataSource/IDataSource.php @@ -37,6 +37,8 @@ public function filterOne(array $condition): self; /** * Apply limit and offset on data * + * @phpstan-param positive-int|0 $offset + * @phpstan-param positive-int|0 $limit * @return static */ public function limit(int $offset, int $limit): self; diff --git a/src/DataSource/NetteDatabaseTableDataSource.php b/src/DataSource/NetteDatabaseTableDataSource.php index 1a914c48..67be9bd6 100755 --- a/src/DataSource/NetteDatabaseTableDataSource.php +++ b/src/DataSource/NetteDatabaseTableDataSource.php @@ -100,6 +100,10 @@ public function filterOne(array $condition): IDataSource } + /** + * @phpstan-param positive-int|0 $offset + * @phpstan-param positive-int|0 $limit + */ public function limit(int $offset, int $limit): IDataSource { $this->data = $this->dataSource->limit($limit, $offset)->fetchAll();