Skip to content

Commit

Permalink
Fix PHPUnit 8 Constraint::_construct removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Maks3w committed Mar 19, 2019
1 parent c1a6f3c commit c501645
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/PhpUnit/JsonSchemaConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class JsonSchemaConstraint extends Constraint

public function __construct($expectedSchema, string $context, Validator $validator)
{
parent::__construct();
if (is_callable([Constraint::class, '__construct'])) {
parent::__construct();
}

$this->expectedSchema = $expectedSchema;
$this->context = $context;
Expand Down
4 changes: 3 additions & 1 deletion src/PhpUnit/MediaTypeConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class MediaTypeConstraint extends Constraint
*/
public function __construct(array $allowedMediaTypes)
{
parent::__construct();
if (is_callable([Constraint::class, '__construct'])) {
parent::__construct();
}

$this->allowedMediaTypes = $allowedMediaTypes;
}
Expand Down

0 comments on commit c501645

Please # to comment.