Skip to content

Commit 377d358

Browse files
nclsHartnorberttech
authored andcommitted
Fix PHPUnit 8 BC break by conditionally call Constraint constructor (coduo#148)
1 parent 00297a5 commit 377d358

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PHPUnit/PHPMatcherConstraint.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ final class PHPMatcherConstraint extends Constraint
1616

1717
public function __construct(string $pattern)
1818
{
19-
parent::__construct();
19+
if (\method_exists(Constraint::class, '__construct')) {
20+
parent::__construct();
21+
}
2022

2123
$this->pattern = $pattern;
2224
$this->matcher = $this->createMatcher();

0 commit comments

Comments
 (0)