Skip to content

Commit b29e364

Browse files
committed
Support PHP 8.1
1 parent 9de3076 commit b29e364

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

.github/workflows/php.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
php-version:
13-
- 7.4
14-
- 8.0
13+
- 8.1
1514

1615
steps:
1716
- uses: actions/checkout@v2

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ Custom PHP session handler for [Nette Framework](http://nette.org/) that uses My
77
- [nette/database](https://github.com/nette/database) 3.1+
88
- [nette/di](https://github.com/nette/utils) 3.0+
99
- [nette/utils](https://github.com/nette/utils) 3.2+
10-
- PHP 7.4+
10+
- PHP 8.1+
1111

1212
<details>
1313
<summary>Requirements for previous versions</summary>
1414

15+
*Requirements for 2.2*
16+
- [nette/database](https://github.com/nette/database) 3.1+
17+
- [nette/di](https://github.com/nette/utils) 3.0+
18+
- [nette/utils](https://github.com/nette/utils) 3.2+
19+
- PHP 7.4+
20+
1521
*Requirements for 2.1 (not supported anymore)*
1622
- [nette/database](https://github.com/nette/database) 2.4+
1723
- [nette/di](https://github.com/nette/utils) 2.4+

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515
],
1616
"require": {
17-
"php": "^7.4 || ^8.0",
17+
"php": "^8.1",
1818
"nette/database": "^3.1",
1919
"nette/di": "^3.0",
2020
"nette/utils": "^3.2"
@@ -23,8 +23,8 @@
2323
"nette/schema": "^1.2",
2424
"php-parallel-lint/php-parallel-lint": "^1.3",
2525
"php-parallel-lint/php-console-highlighter": "^0.5.0",
26-
"phpstan/phpstan": "^0.12.99",
27-
"phpstan/phpstan-nette": "^0.12.21",
26+
"phpstan/phpstan": "^1.2",
27+
"phpstan/phpstan-nette": "^1.0",
2828
"spaze/coding-standard": "^0.0",
2929
"spaze/encryption": "^0.4.0"
3030
},

src/MysqlSessionHandler.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,7 @@ public function write($sessionId, $sessionData): bool
214214
}
215215

216216

217-
/**
218-
* @param int $maxLifeTime
219-
* @return bool
220-
*/
221-
public function gc($maxLifeTime): bool
217+
public function gc(int $maxLifeTime): int|false
222218
{
223219
$maxTimestamp = \time() - $maxLifeTime;
224220

@@ -235,11 +231,9 @@ public function gc($maxLifeTime): bool
235231
$maxTimestamp -= ($row->serverId - 1) * \max(86400, $maxLifeTime / 10);
236232
}
237233

238-
$this->explorer->table($this->tableName)
234+
return $this->explorer->table($this->tableName)
239235
->where('timestamp < ?', $maxTimestamp)
240236
->delete();
241-
242-
return true;
243237
}
244238

245239
}

0 commit comments

Comments
 (0)