Skip to content

Commit

Permalink
Fix PHP 8.2 deprecations (#531)
Browse files Browse the repository at this point in the history
* Fix deprecation: Use of "parent" in callables is deprecated

* Fix deprecations in tests

Creation of dynamic properties is deprecated since php 8.2
  • Loading branch information
stefket authored Aug 18, 2023
1 parent 4a2075b commit dff80cd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/DebugBar/DataCollector/PDO/TraceablePDOStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function bindParam($parameter, &$variable, $data_type = PDO::PARAM_STR, $
public function bindValue($parameter, $value, $data_type = PDO::PARAM_STR) : bool
{
$this->boundParameters[$parameter] = $value;
return call_user_func_array(['parent', 'bindValue'], func_get_args());
return parent::bindValue(...func_get_args());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

class AggregatedCollectorTest extends DebugBarTestCase
{
private $c;

public function setUp(): void
{
$this->c = new AggregatedCollector('test');
Expand Down
3 changes: 3 additions & 0 deletions tests/DebugBar/Tests/DataCollector/TimeDataCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

class TimeDataCollectorTest extends DebugBarTestCase
{
private $s;
private $c;

public function setUp(): void
{
$this->s = microtime(true);
Expand Down
2 changes: 2 additions & 0 deletions tests/DebugBar/Tests/DebugBarTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

abstract class DebugBarTestCase extends TestCase
{
protected $debugbar;

public function setUp(): void
{
$this->debugbar = new DebugBar();
Expand Down
2 changes: 2 additions & 0 deletions tests/DebugBar/Tests/OpenHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

class OpenHandlerTest extends DebugBarTestCase
{
private $openHandler;

public function setUp(): void
{
parent::setUp();
Expand Down
2 changes: 2 additions & 0 deletions tests/DebugBar/Tests/Storage/FileStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
class FileStorageTest extends DebugBarTestCase
{
private $dirname;
private $s;
private $data;

public function setUp(): void
{
Expand Down

0 comments on commit dff80cd

Please sign in to comment.