diff --git a/phpstan.neon b/phpstan.neon index 7ef3c6ca..2c2f287a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,7 +5,6 @@ includes: parameters: level: 8 - phpVersion: 70200 paths: - src @@ -21,10 +20,6 @@ parameters: message: '/^Instanceof between Ublaboo\\DataGrid\\Filter\\Filter and Ublaboo\\DataGrid\\Filter\\FilterDateRange will always evaluate to false\.$/' count: 1 path: src/DataGrid.php - - - message: "/^Cannot access offset 'submit' on Nette\\\\ComponentModel\\\\IComponent\\.$/" - count: 3 - path: src/DataGrid.php - message: '/^Class dibi referenced with incorrect case\: Dibi\.$/' count: 1 diff --git a/src/DataSource/DoctrineCollectionDataSource.php b/src/DataSource/DoctrineCollectionDataSource.php index afb33d87..9f4806c1 100755 --- a/src/DataSource/DoctrineCollectionDataSource.php +++ b/src/DataSource/DoctrineCollectionDataSource.php @@ -59,7 +59,7 @@ public function __construct(Collection $collection, string $primaryKey) public function getCount(): int { - return $this->getFilteredCollection()->count(); + return $this->dataSource->matching($this->criteria)->count(); } @@ -68,7 +68,7 @@ public function getCount(): int */ public function getData(): array { - return $this->getFilteredCollection()->toArray(); + return $this->dataSource->matching($this->criteria)->toArray(); } @@ -248,9 +248,4 @@ protected function applyFilterSelect(FilterSelect $filter): void } } - - private function getFilteredCollection(): Collection - { - return $this->dataSource->matching($this->criteria); - } }