diff --git a/src/behaviors/TestableResponseBehavior.php b/src/behaviors/TestableResponseBehavior.php index 92f8e70..6e33bdf 100644 --- a/src/behaviors/TestableResponseBehavior.php +++ b/src/behaviors/TestableResponseBehavior.php @@ -3,11 +3,11 @@ namespace markhuot\craftpest\behaviors; use Illuminate\Support\Arr; -use markhuot\craftpest\illuminate\Assert as PHPUnit; use markhuot\craftpest\dom\Form; use markhuot\craftpest\dom\NodeList; use markhuot\craftpest\http\RequestBuilder; use markhuot\craftpest\http\requests\WebRequest; +use markhuot\craftpest\illuminate\Assert as PHPUnit; use markhuot\craftpest\illuminate\AssertableJsonString; use markhuot\craftpest\test\Benchmark; use markhuot\craftpest\web\TestableResponse; @@ -476,13 +476,13 @@ public function assertJson(array|callable $value, $strict = false) $json->assertSubset($value, $strict); } else { PHPUnit::fail('Not implemented'); -// $assert = AssertableJson::fromAssertableJsonString($json); -// -// $value($assert); -// -// if (Arr::isAssoc($assert->toArray())) { -// $assert->interacted(); -// } + // $assert = AssertableJson::fromAssertableJsonString($json); + // + // $value($assert); + // + // if (Arr::isAssoc($assert->toArray())) { + // $assert->interacted(); + // } } return $this->response; diff --git a/src/illuminate/ArraySubset.php b/src/illuminate/ArraySubset.php index 4e3fbe5..c19d214 100644 --- a/src/illuminate/ArraySubset.php +++ b/src/illuminate/ArraySubset.php @@ -25,8 +25,6 @@ final class ArraySubset extends Constraint /** * Create a new array subset constraint instance. * - * @param iterable $subset - * @param bool $strict * @return void */ public function __construct(iterable $subset, bool $strict = false) @@ -46,9 +44,6 @@ public function __construct(iterable $subset, bool $strict = false) * failure. * * @param mixed $other - * @param string $description - * @param bool $returnResult - * @return bool|null * * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -89,7 +84,6 @@ public function evaluate($other, string $description = '', bool $returnResult = /** * Returns a string representation of the constraint. * - * @return string * * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -105,7 +99,6 @@ public function toString(): string * cases. This method should return the second part of that sentence. * * @param mixed $other - * @return string * * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -119,9 +112,6 @@ protected function failureDescription($other): string * * The beginning of failure messages is "Failed asserting that" in most * cases. This method should return the second part of that sentence. - * - * @param iterable $other - * @return array */ private function toArray(iterable $other): array { diff --git a/src/illuminate/Assert.php b/src/illuminate/Assert.php index 8e630aa..d34f91c 100644 --- a/src/illuminate/Assert.php +++ b/src/illuminate/Assert.php @@ -14,19 +14,16 @@ abstract class Assert extends PHPUnit /** * Asserts that an array has a specified subset. * - * @param \ArrayAccess|array $subset - * @param \ArrayAccess|array $array - * @param bool $checkForIdentity - * @param string $msg - * @return void + * @param \ArrayAccess|array $subset + * @param \ArrayAccess|array $array */ public static function assertArraySubset($subset, $array, bool $checkForIdentity = false, string $msg = ''): void { - if (!(is_array($subset) || $subset instanceof ArrayAccess)) { + if (! (is_array($subset) || $subset instanceof ArrayAccess)) { throw InvalidArgumentException::create(1, 'array or ArrayAccess'); } - if (!(is_array($array) || $array instanceof ArrayAccess)) { + if (! (is_array($array) || $array instanceof ArrayAccess)) { throw InvalidArgumentException::create(2, 'array or ArrayAccess'); } diff --git a/src/illuminate/AssertableJsonString.php b/src/illuminate/AssertableJsonString.php index fff4a7f..309d317 100644 --- a/src/illuminate/AssertableJsonString.php +++ b/src/illuminate/AssertableJsonString.php @@ -8,8 +8,8 @@ use Illuminate\Contracts\Support\Jsonable; use Illuminate\Support\Arr; use Illuminate\Support\Str; -use markhuot\craftpest\illuminate\Assert as PHPUnit; use JsonSerializable; +use markhuot\craftpest\illuminate\Assert as PHPUnit; class AssertableJsonString implements ArrayAccess, Countable { @@ -62,7 +62,6 @@ public function json($key = null) /** * Assert that the response JSON has the expected count of items at the given key. * - * @param int $count * @param string|null $key * @return $this */ @@ -88,7 +87,6 @@ public function assertCount(int $count, $key = null) /** * Assert that the response has the exact given JSON. * - * @param array $data * @return $this */ public function assertExact(array $data) @@ -108,7 +106,6 @@ public function assertExact(array $data) /** * Assert that the response has the similar JSON as given. * - * @param array $data * @return $this */ public function assertSimilar(array $data) @@ -126,7 +123,6 @@ public function assertSimilar(array $data) /** * Assert that the response contains the given JSON fragment. * - * @param array $data * @return $this */ public function assertFragment(array $data) @@ -154,7 +150,6 @@ public function assertFragment(array $data) /** * Assert that the response does not contain the given JSON fragment. * - * @param array $data * @param bool $exact * @return $this */ @@ -187,7 +182,6 @@ public function assertMissing(array $data, $exact = false) /** * Assert that the response does not contain the exact JSON fragment. * - * @param array $data * @return $this */ public function assertMissingExact(array $data) @@ -249,7 +243,6 @@ public function assertPath($path, $expect) /** * Assert that the response has a given JSON structure. * - * @param array|null $structure * @param array|null $responseData * @return $this */ @@ -285,7 +278,6 @@ public function assertStructure(array $structure = null, $responseData = null) /** * Assert that the response is a superset of the given JSON. * - * @param array $data * @param bool $strict * @return $this */ @@ -301,7 +293,6 @@ public function assertSubset(array $data, $strict = false) /** * Reorder associative array keys to make it easy to compare arrays. * - * @param array $data * @return array */ protected function reorderAssocKeys(array $data) @@ -321,7 +312,6 @@ protected function reorderAssocKeys(array $data) /** * Get the assertion message for assertJson. * - * @param array $data * @return string */ protected function assertJsonMessage(array $data) @@ -356,8 +346,6 @@ protected function jsonSearchStrings($key, $value) /** * Get the total number of items in the underlying JSON array. - * - * @return int */ public function count(): int { @@ -368,7 +356,6 @@ public function count(): int * Determine whether an offset exists. * * @param mixed $offset - * @return bool */ public function offsetExists($offset): bool { @@ -379,7 +366,6 @@ public function offsetExists($offset): bool * Get the value at the given offset. * * @param string $offset - * @return mixed */ public function offsetGet($offset): mixed { @@ -391,7 +377,6 @@ public function offsetGet($offset): mixed * * @param string $offset * @param mixed $value - * @return void */ public function offsetSet($offset, $value): void { @@ -402,7 +387,6 @@ public function offsetSet($offset, $value): void * Unset the value at the given offset. * * @param string $offset - * @return void */ public function offsetUnset($offset): void { diff --git a/src/illuminate/InvalidArgumentException.php b/src/illuminate/InvalidArgumentException.php index d715f55..e7683ab 100644 --- a/src/illuminate/InvalidArgumentException.php +++ b/src/illuminate/InvalidArgumentException.php @@ -8,8 +8,6 @@ class InvalidArgumentException extends Exception { /** * Creates a new exception for an invalid argument. - * - * @return static */ public static function create(int $argument, string $type): static {