Skip to content

Commit

Permalink
Remove param from ProxyQueryInterface::execute (#6827)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Jan 31, 2021
1 parent 7809bc9 commit fb1399b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/Datagrid/ProxyQueryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ interface ProxyQueryInterface
public function __call($name, $args);

/**
* @param int|null $hydrationMode
*
* @return mixed
*/
public function execute(array $params = [], $hydrationMode = null);
public function execute();

/**
* @param array $parentAssociationMappings
Expand Down
1 change: 1 addition & 0 deletions src/Datagrid/SimplePager.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public function getResults($hydrationMode = null)
return $this->results;
}

// @phpstan-ignore-next-line
$this->results = $this->getQuery()->execute([], $hydrationMode);
$this->thresholdCount = \count($this->results);
if (\count($this->results) > $this->getMaxPerPage()) {
Expand Down
2 changes: 1 addition & 1 deletion tests/App/Datagrid/ProxyQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __call($name, $args)
{
}

public function execute(array $params = [], $hydrationMode = null)
public function execute()
{
throw new \BadMethodCallException('Not implemented.');
}
Expand Down
5 changes: 0 additions & 5 deletions tests/Datagrid/SimplePagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public function testInitNumPages(): void
$pager = new SimplePager(10, 2);
$this->proxyQuery->expects($this->once())
->method('execute')
->with([], null)
->willReturn(new ArrayCollection(range(0, 12)));

$this->proxyQuery->expects($this->once())
Expand All @@ -60,7 +59,6 @@ public function testInitOffset(): void
{
$this->proxyQuery->expects($this->once())
->method('execute')
->with([], null)
->willReturn(new ArrayCollection(range(0, 12)));

$this->proxyQuery->expects($this->once())
Expand Down Expand Up @@ -102,7 +100,6 @@ public function testNoPagesForNoResults(): void
{
$this->proxyQuery->expects($this->once())
->method('execute')
->with([], null)
->willReturn([]);

$this->proxyQuery->expects($this->once())
Expand Down Expand Up @@ -131,7 +128,6 @@ public function testGetCurrentPageResultsReturnTypeArrayCollection(): void
{
$this->proxyQuery->expects($this->once())
->method('execute')
->with([], null)
->willReturn(['foo', 'bar']);

$this->pager->setQuery($this->proxyQuery);
Expand All @@ -155,7 +151,6 @@ public function testGetCurrentPageResultsReturnTypeArray(array $queryReturnValue
{
$this->proxyQuery->expects($this->once())
->method('execute')
->with([], null)
->willReturn($queryReturnValues);

$this->pager->setQuery($this->proxyQuery);
Expand Down

0 comments on commit fb1399b

Please sign in to comment.