From dd37e31760f648ece9c55e8f3ec3b4b11865b2f0 Mon Sep 17 00:00:00 2001 From: Dalibor Korpar Date: Tue, 2 Mar 2021 18:39:00 +0100 Subject: [PATCH] fix build, add missing mysqli extension to php in github actions --- .github/workflows/main.yaml | 2 +- phpstan.neon | 8 -------- src/DataSource/IDataSource.php | 2 ++ src/DataSource/NetteDatabaseTableDataSource.php | 4 ++++ 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4dbd81dd7..178279aae 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 6db4aba4e..3c2012acf 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 57e0401ed..e1d1ce8e4 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 1a914c484..67be9bd66 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();