Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/contributte/datagrid
Browse files Browse the repository at this point in the history
  • Loading branch information
paveljanda committed Mar 5, 2021
2 parents 1a72233 + dd37e31 commit ab91aad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 0 additions & 8 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/DataSource/IDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/DataSource/NetteDatabaseTableDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ab91aad

Please sign in to comment.