mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
refacto: coding style updates
This commit is contained in:
@ -120,7 +120,7 @@ final class Expectation
|
|||||||
|
|
||||||
if (is_callable($callback)) {
|
if (is_callable($callback)) {
|
||||||
foreach ($this->value as $item) {
|
foreach ($this->value as $item) {
|
||||||
$callback(new Expectation($item));
|
$callback(new self($item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,10 +128,11 @@ final class Expectation
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @template TValue
|
|
||||||
* Allows you to specify a sequential set of expectations for each item in a iterable "value".
|
* Allows you to specify a sequential set of expectations for each item in a iterable "value".
|
||||||
*
|
*
|
||||||
* @param callable(Expectation, Expectation): void|TValue ...$callbacks
|
* @template TValue
|
||||||
|
*
|
||||||
|
* @param callable(self, self): void|TValue ...$callbacks
|
||||||
*/
|
*/
|
||||||
public function sequence(...$callbacks): Expectation
|
public function sequence(...$callbacks): Expectation
|
||||||
{
|
{
|
||||||
@ -152,11 +153,11 @@ final class Expectation
|
|||||||
|
|
||||||
foreach ($values as $key => $item) {
|
foreach ($values as $key => $item) {
|
||||||
if (is_callable($callbacks[$key])) {
|
if (is_callable($callbacks[$key])) {
|
||||||
call_user_func($callbacks[$key], new Expectation($item), new Expectation($keys[$key]));
|
call_user_func($callbacks[$key], new self($item), new self($keys[$key]));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
(new Expectation($item))->toEqual($callbacks[$key]);
|
(new self($item))->toEqual($callbacks[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|||||||
Reference in New Issue
Block a user