|
9 | 9 |
|
10 | 10 | namespace JsonSchema\Tests;
|
11 | 11 |
|
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 |
20 | 19 | {
|
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 | + } |
25 | 27 | }
|
26 |
| - } |
27 | 28 |
|
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 | + } |
34 | 36 | }
|
35 | 37 | }
|
| 38 | +} else { |
| 39 | + trait PolyfillTrait |
| 40 | + { |
| 41 | + } |
36 | 42 | }
|
0 commit comments