mirror of
https://github.com/pestphp/pest.git
synced 2026-03-08 08:47:22 +01:00
Code quality improvements
This commit is contained in:
@ -25,17 +25,12 @@ final class ExpectationPipeline
|
||||
*/
|
||||
private array $passables;
|
||||
|
||||
/**
|
||||
* The expectation closure.
|
||||
*/
|
||||
private Closure $closure;
|
||||
|
||||
/**
|
||||
* Creates a new instance of Expectation Pipeline.
|
||||
*/
|
||||
public function __construct(Closure $closure)
|
||||
{
|
||||
$this->closure = $closure;
|
||||
public function __construct(
|
||||
private readonly Closure $closure
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
@ -89,10 +84,6 @@ final class ExpectationPipeline
|
||||
*/
|
||||
public function carry(): Closure
|
||||
{
|
||||
return function ($stack, $pipe): Closure {
|
||||
return function () use ($stack, $pipe) {
|
||||
return $pipe($stack, ...$this->passables);
|
||||
};
|
||||
};
|
||||
return fn ($stack, $pipe): Closure => fn () => $pipe($stack, ...$this->passables);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user