Skip to content

Commit

Permalink
chore: support doctrine-extra 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alekitto committed Oct 19, 2023
1 parent 1bc05e0 commit 54c09c9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"jackalope/jackalope-doctrine-dbal": "^1.4",
"phpunit/phpunit": "^9.4",
"psr/http-message": "^1.0",
"refugis/doctrine-extra": "^2.4.0",
"refugis/doctrine-extra": "^2.4 || ^3.0",
"refugis/elastica-odm": "2.x-dev",
"roave/security-advisories": "dev-master",
"solido/php-coding-standards": "dev-master",
Expand Down
11 changes: 9 additions & 2 deletions src/Doctrine/DBAL/PagerIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

namespace Solido\Pagination\Doctrine\DBAL;

use BadMethodCallException;
use Doctrine\DBAL\Driver\ResultStatement;
use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Types\Types;
use Doctrine\Persistence\ObjectManager;
use Refugis\DoctrineExtra\DBAL\IteratorTrait;
use Refugis\DoctrineExtra\ObjectIteratorInterface;
use RuntimeException;
Expand Down Expand Up @@ -81,7 +83,7 @@ public function rewind(): void
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
protected function filterObjects(array $objects): array
{
Expand All @@ -93,7 +95,7 @@ protected function filterObjects(array $objects): array
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
protected function getObjects(): array
{
Expand Down Expand Up @@ -143,4 +145,9 @@ private static function toArray(object $rowObject): array
{
return json_decode(json_encode($rowObject, JSON_THROW_ON_ERROR, 512), true, 512, JSON_THROW_ON_ERROR);
}

public function getObjectManager(): ObjectManager
{
throw new BadMethodCallException('Cannot retrieve the object manager from a DBAL iterator');
}
}
4 changes: 2 additions & 2 deletions src/Doctrine/ORM/PagerIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function setFetchMode(string $className, string $associationName, string
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
protected function filterObjects(array $objects): array
{
Expand All @@ -98,7 +98,7 @@ protected function filterObjects(array $objects): array
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
protected function getObjects(): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Doctrine/PhpCr/PagerIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function rewind(): void
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
protected function filterObjects(array $objects): array
{
Expand All @@ -79,7 +79,7 @@ protected function filterObjects(array $objects): array
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
protected function getObjects(): array
{
Expand Down
10 changes: 8 additions & 2 deletions src/Elastica/PagerIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Solido\Pagination\Elastica;

use DateTimeImmutable;
use Doctrine\Persistence\ObjectManager;
use Elastica\Query;
use Refugis\DoctrineExtra\IteratorTrait;
use Refugis\DoctrineExtra\ObjectIteratorInterface;
Expand Down Expand Up @@ -68,7 +69,7 @@ public function rewind(): void
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
protected function filterObjects(array $objects): array
{
Expand All @@ -80,7 +81,7 @@ protected function filterObjects(array $objects): array
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
protected function getObjects(): array
{
Expand Down Expand Up @@ -146,4 +147,9 @@ protected function getObjects(): array

return $search->execute();
}

public function getObjectManager(): ObjectManager
{
return $this->search->getDocumentManager();
}
}

0 comments on commit 54c09c9

Please sign in to comment.