Skip to content

Commit 063df95

Browse files
committed
support for PHP 8.1
1 parent 7706b56 commit 063df95

10 files changed

Lines changed: 14 additions & 12 deletions

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
10+
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
1111

1212
fail-fast: false
1313

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
],
1717
"require": {
18-
"php": ">=7.1 <8.1",
18+
"php": ">=7.1 <8.2",
1919
"ext-json": "*",
2020
"ext-tokenizer": "*"
2121
},

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ The recommended way to install Latte is via Composer (alternatively you can [dow
8585
composer require latte/latte
8686
```
8787

88-
Latte requires PHP version 7.1 and supports PHP up to 8.0.
88+
Latte requires PHP version 7.1 and supports PHP up to 8.1.
8989

9090

9191
Usage

tests/Latte/CachingIterator.basic.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ test('', function () {
8383
test('Check if next position is valid', function () {
8484
// empty iterator
8585
$inner = new class implements Iterator {
86+
#[ReturnTypeWillChange]
8687
public function current()
8788
{
8889
throw new RuntimeException('Invalid state');
@@ -94,6 +95,7 @@ test('Check if next position is valid', function () {
9495
}
9596

9697

98+
#[ReturnTypeWillChange]
9799
public function key()
98100
{
99101
throw new RuntimeException('Invalid state');

tests/Latte/CachingIterator.construct.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ test('object', function () {
8787

8888
class RecursiveIteratorAggregate implements IteratorAggregate
8989
{
90-
public function getIterator()
90+
public function getIterator(): ArrayObject
9191
{
9292
return new ArrayObject(['Nette', 'Framework']);
9393
}

tests/Latte/Engine.onCompile.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ test('', function () {
9090
}
9191

9292

93-
public function getIterator()
93+
public function getIterator(): ArrayIterator
9494
{
9595
return new ArrayIterator($this->events);
9696
}

tests/Latte/Filters.length().phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Assert::same(2, Filters::length(['one', 'two']));
2020

2121
class CountableClass implements Countable
2222
{
23-
public function count()
23+
public function count(): int
2424
{
2525
return 4;
2626
}
@@ -31,7 +31,7 @@ Assert::same(4, Filters::length(new CountableClass));
3131

3232
class TraversableClass implements IteratorAggregate
3333
{
34-
public function getIterator()
34+
public function getIterator(): ArrayIterator
3535
{
3636
return new ArrayIterator(['one', 'two', 'three']);
3737
}

tests/Latte/Filters.reverse().phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Assert::same([1 => 'two', 0 => 'one'], Filters::reverse(['one', 'two'], true));
2121

2222
class TraversableClass implements IteratorAggregate
2323
{
24-
public function getIterator()
24+
public function getIterator(): ArrayIterator
2525
{
2626
return new ArrayIterator(['one', 'two', 'three']);
2727
}

tests/Latte/Filters.substring().phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ class CountableTraversableStringClass implements Countable, IteratorAggregate
3535
}
3636

3737

38-
public function count()
38+
public function count(): int
3939
{
4040
}
4141

4242

43-
public function getIterator()
43+
public function getIterator(): Iterator
4444
{
4545
}
4646
}

tests/Latte/Filters.truncate().phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ class CountableTraversableStringClass implements Countable, IteratorAggregate
5959
}
6060

6161

62-
public function count()
62+
public function count(): int
6363
{
6464
}
6565

6666

67-
public function getIterator()
67+
public function getIterator(): Iterator
6868
{
6969
}
7070
}

0 commit comments

Comments
 (0)