Skip to content

Commit 7f8b32f

Browse files
committed
Bummer, we still need to account for return void
1 parent d31898e commit 7f8b32f

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

tests/PolyfillTrait.php

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,34 @@
99

1010
namespace JsonSchema\Tests;
1111

12-
/**
13-
* Inspired by https://github.com/PHPUnitGoodPractices/polyfill
14-
*
15-
* @license MIT
16-
*/
17-
trait PolyfillTrait
18-
{
19-
public function expectException($exception)
12+
if (version_compare(PHP_VERSION, '7.4.0') < 0) {
13+
/**
14+
* Inspired by https://github.com/PHPUnitGoodPractices/polyfill
15+
*
16+
* @license MIT
17+
*/
18+
trait PolyfillTrait
2019
{
21-
if (\is_callable(array('PHPUnit\Framework\TestCase', 'expectException'))) {
22-
parent::expectException($exception);
23-
} else {
24-
$this->setExpectedException($exception);
20+
public function expectException($exception)
21+
{
22+
if (\is_callable(array('PHPUnit\Framework\TestCase', 'expectException'))) {
23+
parent::expectException($exception);
24+
} else {
25+
$this->setExpectedException($exception);
26+
}
2527
}
26-
}
2728

28-
public static function assertIsArray($actual, $message = '')
29-
{
30-
if (\is_callable(array('PHPUnit\Framework\TestCase', 'assertIsArray'))) {
31-
parent::assertIsArray($actual, $message);
32-
} else {
33-
static::assertInternalType('array', $actual, $message);
29+
public static function assertIsArray($actual, $message = '')
30+
{
31+
if (\is_callable(array('PHPUnit\Framework\TestCase', 'assertIsArray'))) {
32+
parent::assertIsArray($actual, $message);
33+
} else {
34+
static::assertInternalType('array', $actual, $message);
35+
}
3436
}
3537
}
38+
} else {
39+
trait PolyfillTrait
40+
{
41+
}
3642
}

0 commit comments

Comments
 (0)