Skip to content

Commit

Permalink
Fix tests on PHP < 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Nov 5, 2019
1 parent e491508 commit 1b4208b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<testsuites>
<testsuite name="Reflection tests">
<directory>tests</directory>
<exclude>tests/Classes</exclude>
</testsuite>
</testsuites>
<filter>
Expand Down
14 changes: 14 additions & 0 deletions tests/Classes/TypedProperties.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Brick\Reflection\Tests\Classes;

class TypedProperties {
/**
* @var int|string
*/
public $a;

public string $b;

public ?\PDO $c;
}
14 changes: 1 addition & 13 deletions tests/ReflectionToolsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Brick\Reflection\ReflectionTools;

use Brick\Reflection\Tests\Classes\TypedProperties;
use PHPUnit\Framework\TestCase;

/**
Expand Down Expand Up @@ -245,16 +246,3 @@ abstract protected function c(int $a = 1, float $b = 0.5, string $c = 'test', $e
private function d(?int $a, ?int $b) : ?string {}
private function e(?int $a, ?int $b = null) : ?string {}
}

if (version_compare(PHP_VERSION, '7.4') >= 0) {
class TypedProperties {
/**
* @var int|string
*/
public $a;

public string $b;

public ?\PDO $c;
}
}

0 comments on commit 1b4208b

Please sign in to comment.