diff --git a/src/Concerns/Pipeable.php b/src/Concerns/Pipeable.php index c23427cd..6e5a044b 100644 --- a/src/Concerns/Pipeable.php +++ b/src/Concerns/Pipeable.php @@ -19,6 +19,13 @@ trait Pipeable */ private static array $pipes = []; + /** + * The list of interceptors. + * + * @var array> + */ + private static array $interceptors = []; + /** * Register a pipe to be applied before an expectation is checked. */ @@ -38,6 +45,8 @@ trait Pipeable $filter = fn ($value): bool => $value instanceof $filter; } + self::$interceptors[$name][] = $handler; + $this->pipe($name, function ($next, ...$arguments) use ($handler, $filter): void { /* @phpstan-ignore-next-line */ if ($filter($this->value, ...$arguments)) {