Skip to content

Commit 1bedcdb

Browse files
committed
fix DataStore's deprecated method implementation in PHP 8.1; Update version in changelog and composer
1 parent 05d539b commit 1bedcdb

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## Version 5.6.1
4+
5+
1. Fix DataStore's generator method.
6+
2. Fix DataStore's deprecated methods in PHP 8.1.
7+
38
## Version 5.6.0
49

510
1. Added: `AssetManager` ability to load resources with absolute paths.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "koolreport/core",
3-
"version":"5.6.0",
3+
"version":"5.6.1",
44
"description": "An Open Source PHP Reporting Framework for easier and faster report delivery.",
55
"keywords": ["php reporting framework","php reporting tools","data processing","data visualization","charts and graphs"],
66
"homepage": "https://www.koolreport.com",

src/core/DataStore.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,8 @@ public function columnMeta($settings)
14091409
*
14101410
* @return null
14111411
*/
1412-
public function getIterator()
1412+
// #[\ReturnTypeWillChange]
1413+
public function getIterator(): \Traversable
14131414
{
14141415
return new \ArrayIterator($this->rows);
14151416
}
@@ -1422,7 +1423,8 @@ public function getIterator()
14221423
*
14231424
* @return null
14241425
*/
1425-
public function offsetSet($index, $row)
1426+
// #[\ReturnTypeWillChange]
1427+
public function offsetSet($index, $row): void
14261428
{
14271429
if (is_null($index)) {
14281430
$this->rows[] = $row;
@@ -1438,7 +1440,8 @@ public function offsetSet($index, $row)
14381440
*
14391441
* @return null
14401442
*/
1441-
public function offsetExists($index)
1443+
// #[\ReturnTypeWillChange]
1444+
public function offsetExists($index): bool
14421445
{
14431446
return isset($this->rows[$index]);
14441447
}
@@ -1450,7 +1453,7 @@ public function offsetExists($index)
14501453
*
14511454
* @return null
14521455
*/
1453-
public function offsetUnset($index)
1456+
public function offsetUnset($index): void
14541457
{
14551458
unset($this->rows[$index]);
14561459
}
@@ -1462,8 +1465,10 @@ public function offsetUnset($index)
14621465
*
14631466
* @return array The row data at the context
14641467
*/
1468+
#[\ReturnTypeWillChange]
14651469
public function offsetGet($index)
14661470
{
1471+
return null;
14671472
return isset($this->rows[$index]) ? $this->rows[$index] : null;
14681473
}
14691474
}

0 commit comments

Comments
 (0)