Skip to content

Commit

Permalink
Make AssertableJson easier to extend by replacing self with static (
Browse files Browse the repository at this point in the history
#37380)

* Replace `self` -> `static` in AssertableJson

* Change return type back to `self`
  • Loading branch information
tontonsb authored May 17, 2021
1 parent 11387ec commit ac2a366
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Illuminate/Testing/Fluent/AssertableJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected function scope(string $key, Closure $callback): self

PHPUnit::assertIsArray($props, sprintf('Property [%s] is not scopeable.', $path));

$scope = new self($props, $path);
$scope = new static($props, $path);
$callback($scope);
$scope->interacted();

Expand Down Expand Up @@ -125,7 +125,7 @@ public function first(Closure $callback): self
*/
public static function fromArray(array $data): self
{
return new self($data);
return new static($data);
}

/**
Expand All @@ -136,7 +136,7 @@ public static function fromArray(array $data): self
*/
public static function fromAssertableJsonString(AssertableJsonString $json): self
{
return self::fromArray($json->json());
return static::fromArray($json->json());
}

/**
Expand Down

0 comments on commit ac2a366

Please sign in to comment.