Skip to content

Commit 89d1beb

Browse files
committed
PHP 8.4 compatibility: Fixes "Creation of dynamic property is deprecated", removes E_STRICT, sets PHP 7.1 as minimum version
1 parent be847a6 commit 89d1beb

19 files changed

Lines changed: 39 additions & 43 deletions

.github/workflows/tests.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,14 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
php:
17-
- "5.3"
18-
- "5.4"
19-
- "5.5"
20-
- "5.6"
21-
- "7.0"
2217
- "7.1"
2318
- "7.2"
2419
- "7.3"
2520
- "8.0"
2621
- "8.1"
2722
- "8.2"
23+
- "8.3"
24+
- "8.4"
2825
php_invoker: [true, false]
2926
coverage: [false]
3027
experimental: [false]

PHPUnit/Extensions/PhptTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ public function count()
115115
/**
116116
* Runs a test and collects its result in a TestResult instance.
117117
*
118-
* @param PHPUnit_Framework_TestResult $result
118+
* @param ?PHPUnit_Framework_TestResult $result
119119
* @param array $options
120120
* @return PHPUnit_Framework_TestResult
121121
*/
122-
public function run(PHPUnit_Framework_TestResult $result = NULL, array $options = array())
122+
public function run(?PHPUnit_Framework_TestResult $result = NULL, array $options = array())
123123
{
124124
if (!class_exists('PEAR_RunTest', FALSE)) {
125125
throw new PHPUnit_Framework_Exception('Class PEAR_RunTest not found.');

PHPUnit/Extensions/RepeatedTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ public function count()
125125
* Runs the decorated test and collects the
126126
* result in a TestResult.
127127
*
128-
* @param PHPUnit_Framework_TestResult $result
128+
* @param ?PHPUnit_Framework_TestResult $result
129129
* @return PHPUnit_Framework_TestResult
130130
* @throws PHPUnit_Framework_Exception
131131
*/
132-
public function run(PHPUnit_Framework_TestResult $result = NULL)
132+
public function run(?PHPUnit_Framework_TestResult $result = NULL)
133133
{
134134
if ($result === NULL) {
135135
$result = $this->createResult();

PHPUnit/Extensions/TestDecorator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ public function getTest()
134134
* Runs the decorated test and collects the
135135
* result in a TestResult.
136136
*
137-
* @param PHPUnit_Framework_TestResult $result
137+
* @param ?PHPUnit_Framework_TestResult $result
138138
* @return PHPUnit_Framework_TestResult
139139
*/
140-
public function run(PHPUnit_Framework_TestResult $result = NULL)
140+
public function run(?PHPUnit_Framework_TestResult $result = NULL)
141141
{
142142
if ($result === NULL) {
143143
$result = $this->createResult();

PHPUnit/Framework/Constraint.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ public function count()
123123
*
124124
* @param mixed $other Evaluated value or object.
125125
* @param string $description Additional information about the test
126-
* @param PHPUnit_Framework_ComparisonFailure $comparisonFailure
126+
* @param ?PHPUnit_Framework_ComparisonFailure $comparisonFailure
127127
* @throws PHPUnit_Framework_ExpectationFailedException
128128
*/
129-
protected function fail($other, $description, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL)
129+
protected function fail($other, $description, ?PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL)
130130
{
131131
$failureDescription = sprintf(
132132
'Failed asserting that %s.',

PHPUnit/Framework/Error.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ class PHPUnit_Framework_Error extends Exception
6363
* @param integer $code
6464
* @param string $file
6565
* @param integer $line
66-
* @param Exception $previous
66+
* @param ?Exception $previous
6767
*/
68-
public function __construct($message, $code, $file, $line, Exception $previous = NULL)
68+
public function __construct($message, $code, $file, $line, ?Exception $previous = NULL)
6969
{
7070
parent::__construct($message, $code, $previous);
7171

PHPUnit/Framework/ExpectationFailedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class PHPUnit_Framework_ExpectationFailedException extends PHPUnit_Framework_Ass
6565
*/
6666
protected $comparisonFailure;
6767

68-
public function __construct($message, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL, Exception $previous = NULL)
68+
public function __construct($message, ?PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL, ?Exception $previous = NULL)
6969
{
7070
$this->comparisonFailure = $comparisonFailure;
7171

PHPUnit/Framework/Test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ interface PHPUnit_Framework_Test extends Countable
5959
/**
6060
* Runs a test and collects its result in a TestResult instance.
6161
*
62-
* @param PHPUnit_Framework_TestResult $result
62+
* @param ?PHPUnit_Framework_TestResult $result
6363
* @return PHPUnit_Framework_TestResult
6464
*/
65-
public function run(PHPUnit_Framework_TestResult $result = NULL);
65+
public function run(?PHPUnit_Framework_TestResult $result = NULL);
6666
}

PHPUnit/Framework/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,11 +672,11 @@ public function hasFailed()
672672
* Runs the test case and collects the results in a TestResult object.
673673
* If no TestResult object is passed a new one will be created.
674674
*
675-
* @param PHPUnit_Framework_TestResult $result
675+
* @param ?PHPUnit_Framework_TestResult $result
676676
* @return PHPUnit_Framework_TestResult
677677
* @throws PHPUnit_Framework_Exception
678678
*/
679-
public function run(PHPUnit_Framework_TestResult $result = NULL)
679+
public function run(?PHPUnit_Framework_TestResult $result = NULL)
680680
{
681681
if ($result === NULL) {
682682
$result = $this->createResult();

PHPUnit/Framework/TestResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ public function run(PHPUnit_Framework_Test $test)
582582
if ($this->convertErrorsToExceptions) {
583583
$oldErrorHandler = set_error_handler(
584584
array('PHPUnit_Util_ErrorHandler', 'handleError'),
585-
E_ALL | E_STRICT
585+
E_ALL
586586
);
587587

588588
if ($oldErrorHandler === NULL) {

0 commit comments

Comments
 (0)