Skip to content

Commit

Permalink
Merge pull request #2 from Larium/feature/upgrade-php8
Browse files Browse the repository at this point in the history
Upgrade to php 8.1
  • Loading branch information
akDeveloper authored Apr 1, 2023
2 parents 0d13ec6 + 85fd273 commit 41f8cca
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ php:
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
before_script: composer install
script:
- ./vendor/bin/phpunit tests/
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
}
],
"require": {
"php": ">=7.2"
"php": ">=8.1"
},
"require-dev": {
"phpunit/phpunit": "~8.3.5",
"doctrine/dbal": "^2.9",
"pagerfanta/pagerfanta": "~2.1.3"
"phpunit/phpunit": "^9.5",
"doctrine/dbal": "^3.6",
"pagerfanta/pagerfanta": "^4.0"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 4 additions & 4 deletions src/Doctrine/Dbal/DoctrineDbalResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public function fetch(int $offset, int $limit): array
{
$this->queryBuilder->setFirstResult($offset);
$this->queryBuilder->setMaxResults($limit);
$stmt = $this->queryBuilder->execute();
$stmt = $this->queryBuilder->executeQuery();

return $stmt->fetchAll(PDO::FETCH_ASSOC);
return $stmt->fetchAllAssociative();
}

public function count()
public function count(): int
{
if (null === $this->count) {
$qb = clone $this->queryBuilder;
Expand All @@ -48,7 +48,7 @@ public function count()
->setMaxResults(1);
}

$this->count = intval($qb->execute()->fetchColumn());
$this->count = intval($qb->executeQuery()->fetchOne());
}

return $this->count;
Expand Down
4 changes: 2 additions & 2 deletions src/Pagerfanta/SearchAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ public function __construct(Result $result)
/**
* {@inheritDoc}
*/
public function getNbResults()
public function getNbResults(): int
{
return $this->result->count();
}

/**
* {@inheritDoc}
*/
public function getSlice($offset, $length)
public function getSlice($offset, $length): iterable
{
return $this->result->fetch($offset, $length);
}
Expand Down

0 comments on commit 41f8cca

Please sign in to comment.