Skip to content

Commit 9f4f889

Browse files
authored
Merge pull request #15 from nanasess/improve/php8.1RC3
PHP8.1.0RC3 Support
2 parents 24d1814 + 10e0809 commit 9f4f889

File tree

14 files changed

+34
-14
lines changed

14 files changed

+34
-14
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"require": {
2323
"php": ">=5.3.3",
24-
"phpunit/php-file-iterator": "~1.4",
24+
"php5friends/php-file-iterator14": "~1.4.6",
2525
"phpunit/php-text-template": "~1.2",
2626
"phpunit/php-code-coverage": "~2.1",
2727
"phpunit/php-timer": "^1.0.6",
@@ -32,13 +32,13 @@
3232
"sebastian/diff": "~1.2",
3333
"sebastian/environment": "~1.3",
3434
"sebastian/exporter": "~1.2",
35-
"sebastian/global-state": "~1.0",
3635
"sebastian/version": "~1.0",
3736
"ext-dom": "*",
3837
"ext-json": "*",
3938
"ext-pcre": "*",
4039
"ext-reflection": "*",
41-
"ext-spl": "*"
40+
"ext-spl": "*",
41+
"php5friends/global-state11": "~1.1.2"
4242
},
4343
"config": {
4444
"platform": {

src/Extensions/PhptTestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public function __construct($filename)
7676
*
7777
* @return int
7878
*/
79+
#[\ReturnTypeWillChange]
7980
public function count()
8081
{
8182
return 1;

src/Extensions/TestDecorator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public function basicRun(PHPUnit_Framework_TestResult $result)
6363
*
6464
* @return int
6565
*/
66+
#[\ReturnTypeWillChange]
6667
public function count()
6768
{
6869
return count($this->test);

src/Framework/Constraint.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ protected function matches($other)
8181
*
8282
* @since Method available since Release 3.4.0
8383
*/
84+
#[\ReturnTypeWillChange]
8485
public function count()
8586
{
8687
return 1;

src/Framework/TestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ public function toString()
304304
*
305305
* @return int
306306
*/
307+
#[\ReturnTypeWillChange]
307308
public function count()
308309
{
309310
return 1;

src/Framework/TestResult.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,7 @@ public function run(PHPUnit_Framework_Test $test)
738738
*
739739
* @return int
740740
*/
741+
#[\ReturnTypeWillChange]
741742
public function count()
742743
{
743744
return $this->runTests;

src/Framework/TestSuite.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ public function addTestFiles($filenames)
392392
*
393393
* @return int
394394
*/
395+
#[\ReturnTypeWillChange]
395396
public function count($preferCache = false)
396397
{
397398
if ($preferCache && $this->cachedNumTests != null) {
@@ -968,6 +969,7 @@ public function setBackupStaticAttributes($backupStaticAttributes)
968969
*
969970
* @since Method available since Release 3.1.0
970971
*/
972+
#[\ReturnTypeWillChange]
971973
public function getIterator()
972974
{
973975
$iterator = new PHPUnit_Util_TestSuiteIterator($this);

src/Runner/Filter/Group.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ function ($test) {
4444
/**
4545
* @return bool
4646
*/
47+
#[\ReturnTypeWillChange]
4748
public function accept()
4849
{
4950
$test = $this->getInnerIterator()->current();

src/Runner/Filter/Test.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ protected function setFilter($filter)
8888
/**
8989
* @return bool
9090
*/
91+
#[\ReturnTypeWillChange]
9192
public function accept()
9293
{
9394
$test = $this->getInnerIterator()->current();

src/Util/TestSuiteIterator.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function __construct(PHPUnit_Framework_TestSuite $testSuite)
3636
/**
3737
* Rewinds the Iterator to the first element.
3838
*/
39+
#[\ReturnTypeWillChange]
3940
public function rewind()
4041
{
4142
$this->position = 0;
@@ -46,6 +47,7 @@ public function rewind()
4647
*
4748
* @return bool
4849
*/
50+
#[\ReturnTypeWillChange]
4951
public function valid()
5052
{
5153
return $this->position < count($this->tests);
@@ -56,6 +58,7 @@ public function valid()
5658
*
5759
* @return int
5860
*/
61+
#[\ReturnTypeWillChange]
5962
public function key()
6063
{
6164
return $this->position;
@@ -66,6 +69,7 @@ public function key()
6669
*
6770
* @return PHPUnit_Framework_Test
6871
*/
72+
#[\ReturnTypeWillChange]
6973
public function current()
7074
{
7175
return $this->valid() ? $this->tests[$this->position] : null;
@@ -74,6 +78,7 @@ public function current()
7478
/**
7579
* Moves forward to next element.
7680
*/
81+
#[\ReturnTypeWillChange]
7782
public function next()
7883
{
7984
$this->position++;
@@ -84,6 +89,7 @@ public function next()
8489
*
8590
* @return PHPUnit_Util_TestSuiteIterator
8691
*/
92+
#[\ReturnTypeWillChange]
8793
public function getChildren()
8894
{
8995
return new self(
@@ -96,6 +102,7 @@ public function getChildren()
96102
*
97103
* @return bool
98104
*/
105+
#[\ReturnTypeWillChange]
99106
public function hasChildren()
100107
{
101108
return $this->tests[$this->position] instanceof PHPUnit_Framework_TestSuite;

tests/_files/DoubleTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public function __construct(PHPUnit_Framework_TestCase $testCase)
77
{
88
$this->testCase = $testCase;
99
}
10-
10+
#[\ReturnTypeWillChange]
1111
public function count()
1212
{
1313
return 2;

tests/_files/SampleArrayAccess.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public function __construct()
1313
{
1414
$this->container = array();
1515
}
16+
#[\ReturnTypeWillChange]
1617
public function offsetSet($offset, $value)
1718
{
1819
if (is_null($offset)) {
@@ -21,14 +22,17 @@ public function offsetSet($offset, $value)
2122
$this->container[$offset] = $value;
2223
}
2324
}
25+
#[\ReturnTypeWillChange]
2426
public function offsetExists($offset)
2527
{
2628
return isset($this->container[$offset]);
2729
}
30+
#[\ReturnTypeWillChange]
2831
public function offsetUnset($offset)
2932
{
3033
unset($this->container[$offset]);
3134
}
35+
#[\ReturnTypeWillChange]
3236
public function offsetGet($offset)
3337
{
3438
return isset($this->container[$offset]) ? $this->container[$offset] : null;

tests/_files/TestIterator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@ public function __construct($array = array())
88
{
99
$this->array = $array;
1010
}
11-
11+
#[\ReturnTypeWillChange]
1212
public function rewind()
1313
{
1414
$this->position = 0;
1515
}
16-
16+
#[\ReturnTypeWillChange]
1717
public function valid()
1818
{
1919
return $this->position < count($this->array);
2020
}
21-
21+
#[\ReturnTypeWillChange]
2222
public function key()
2323
{
2424
return $this->position;
2525
}
26-
26+
#[\ReturnTypeWillChange]
2727
public function current()
2828
{
2929
return $this->array[$this->position];
3030
}
31-
31+
#[\ReturnTypeWillChange]
3232
public function next()
3333
{
3434
$this->position++;

tests/_files/TestIterator2.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ public function __construct(array $array)
77
{
88
$this->data = $array;
99
}
10-
10+
#[\ReturnTypeWillChange]
1111
public function current()
1212
{
1313
return current($this->data);
1414
}
15-
15+
#[\ReturnTypeWillChange]
1616
public function next()
1717
{
1818
next($this->data);
1919
}
20-
20+
#[\ReturnTypeWillChange]
2121
public function key()
2222
{
2323
return key($this->data);
2424
}
25-
25+
#[\ReturnTypeWillChange]
2626
public function valid()
2727
{
2828
return key($this->data) !== null;
2929
}
30-
30+
#[\ReturnTypeWillChange]
3131
public function rewind()
3232
{
3333
reset($this->data);

0 commit comments

Comments
 (0)