Skip to content

Commit 96d9072

Browse files
committed
support for PHP 8.5
1 parent 2bcad19 commit 96d9072

8 files changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-22.04
1212
strategy:
1313
matrix:
14-
php: ['8.1', '8.2', '8.3', '8.4']
14+
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
1515

1616
fail-fast: false
1717

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": "8.1 - 8.4",
18+
"php": "8.1 - 8.5",
1919
"ext-pdo": "*",
2020
"nette/caching": "^3.2",
2121
"nette/utils": "^4.0"

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The recommended way to install is via Composer:
4040
composer require nette/database
4141
```
4242

43-
It requires PHP version 8.1 and supports PHP up to 8.4.
43+
It requires PHP version 8.1 and supports PHP up to 8.5.
4444

4545

4646
Usage

src/Database/Table/ActiveRow.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ public function accessColumn(?string $key, bool $selectColumn = true): bool
285285
$this->dataRefreshed = true;
286286
}
287287

288+
$key ??= '';
288289
return isset($this->data[$key]) || array_key_exists($key, $this->data);
289290
}
290291

src/Database/Table/Selection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ protected function saveCacheState(): void
644644
*/
645645
protected function getRefTable(&$refPath): self
646646
{
647+
$refPath = '';
647648
return $this;
648649
}
649650

@@ -944,7 +945,7 @@ public function getReferencedTable(ActiveRow $row, ?string $table, ?string $colu
944945
}
945946
}
946947

947-
return $selection[$checkPrimaryKey] ?? null;
948+
return $selection[$checkPrimaryKey ?? ''] ?? null;
948949
}
949950

950951

tests/Database/Explorer/Explorer.cache.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ test('shared accessed columns in related instances', function () use ($explorer)
120120

121121
foreach ($relatedStack as $related) {
122122
$property = (new ReflectionClass($related))->getProperty('accessedColumns');
123-
$property->setAccessible(true);
124123
// checks if instances have shared data of accessed columns
125124
Assert::same(['id', 'author_id'], array_keys((array) $property->getValue($related)));
126125
}

tests/Database/Explorer/SqlBuilder.tryDelimite().phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ $explorer = connectToDB();
1515

1616
$sqlBuilder = new Nette\Database\Table\SqlBuilder('book', $explorer);
1717
$tryDelimite = (new ReflectionClass($sqlBuilder))->getMethod('tryDelimite');
18-
$tryDelimite->setAccessible(true);
1918

2019
Assert::same(reformat('[hello]'), $tryDelimite->invoke($sqlBuilder, 'hello'));
2120
Assert::same(reformat(' [hello] '), $tryDelimite->invoke($sqlBuilder, ' hello '));

tests/Database/ResultSet.fetch().phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test('detects duplicate column names in simple query', function () use ($connect
3838
test('handles cursor management in stored procedures', function () use ($connection, $driverName) {
3939
if ($driverName === 'mysql') {
4040
$connection->query('CREATE DEFINER = CURRENT_USER PROCEDURE `testProc`(IN param int(10) unsigned) BEGIN SELECT * FROM book WHERE id != param; END;;');
41-
$connection->getPdo()->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
41+
$connection->getPdo()->setAttribute(PHP_VERSION_ID < 80500 ? PDO::MYSQL_ATTR_USE_BUFFERED_QUERY : Pdo\Mysql::ATTR_USE_BUFFERED_QUERY, false);
4242

4343
$res = $connection->query('CALL testProc(1)');
4444
foreach ($res as $row) {

0 commit comments

Comments
 (0)