Skip to content

Commit

Permalink
support for PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 25, 2021
1 parent 73e16eb commit 5286406
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.2', '7.3', '7.4', '8.0']
php: ['7.2', '7.3', '7.4', '8.0', '8.1']

fail-fast: false

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Install Dibi via Composer:
composer require dibi/dibi
```

The Dibi 4.2 requires PHP version 7.2 and supports PHP up to 8.0.
The Dibi 4.2 requires PHP version 7.2 and supports PHP up to 8.1.


Usage
Expand Down
2 changes: 2 additions & 0 deletions src/Dibi/ResultIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function rewind(): void
}


#[\ReturnTypeWillChange]
/**
* Returns the key of the current element.
* @return mixed
Expand All @@ -54,6 +55,7 @@ public function key()
}


#[\ReturnTypeWillChange]
/**
* Returns the current element.
* @return mixed
Expand Down
11 changes: 6 additions & 5 deletions src/Dibi/Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,37 +62,38 @@ public function __isset(string $key): bool
/********************* interfaces ArrayAccess, Countable & IteratorAggregate ****************d*g**/


final public function count()
final public function count(): int
{
return count((array) $this);
}


final public function getIterator()
final public function getIterator(): \ArrayIterator
{
return new \ArrayIterator($this);
}


final public function offsetSet($nm, $val)
final public function offsetSet($nm, $val): void
{
$this->$nm = $val;
}


#[\ReturnTypeWillChange]
final public function offsetGet($nm)
{
return $this->$nm;
}


final public function offsetExists($nm)
final public function offsetExists($nm): bool
{
return isset($this->$nm);
}


final public function offsetUnset($nm)
final public function offsetUnset($nm): void
{
unset($this->$nm);
}
Expand Down
2 changes: 0 additions & 2 deletions tests/dibi/DateTime.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Assert::same('1978-01-23 11:40:00.000000', (string) new DateTime(254400000));
Assert::same('1978-01-23 11:40:00.000000', (string) (new DateTime)->setTimestamp(254400000));
Assert::same(254400000, (new DateTime(254400000))->getTimestamp());

Assert::same('2050-08-13 11:40:00.000000', (string) new DateTime(2544000000));
Assert::same('2050-08-13 11:40:00.000000', (string) (new DateTime)->setTimestamp(2544000000));
Assert::same(is_int(2544000000) ? 2544000000 : '2544000000', (new DateTime(2544000000))->getTimestamp()); // 64 bit

Assert::same('1978-05-05 00:00:00.000000', (string) new DateTime('1978-05-05'));

0 comments on commit 5286406

Please sign in to comment.