@@ -37,8 +37,8 @@ class Pipeline {
37
37
protected Closure $ catcher ;
38
38
39
39
/**
40
- * @throws InvalidPipeError When invalid pipe given.
41
- * @throws UnexpectedPipelineException When could not determine thrown exception.
40
+ * @throws InvalidPipe When invalid pipe given.
41
+ * @throws InvalidPipeline When could not determine thrown exception.
42
42
* @phpstan-param class-string<Pipe>|Pipe|Closure(mixed $subject, Closure $next, mixed ...$use): mixed $pipe
43
43
*/
44
44
// phpcs:ignore Squiz.Commenting.FunctionCommentThrowTag.WrongNumber -- Exactly 2 exception thrown.
@@ -47,17 +47,17 @@ final public static function resolve( string|Closure|Pipe $pipe ): Closure {
47
47
48
48
try {
49
49
return match ( true ) {
50
- default => throw InvalidPipeError ::from ( $ pipe ),
50
+ default => throw InvalidPipe ::from ( $ pipe ),
51
51
$ isClassName => PipelineBridge::make ( $ pipe )->handle ( ... ),
52
52
$ pipe instanceof Pipe => $ pipe ->handle ( ... ),
53
53
$ pipe instanceof Closure => $ pipe ,
54
54
};
55
55
} catch ( Throwable $ e ) {
56
- if ( $ e instanceof InvalidPipeError ) {
56
+ if ( $ e instanceof InvalidPipe ) {
57
57
throw $ e ;
58
58
}
59
59
60
- throw new UnexpectedPipelineException ( $ e ->getMessage (), $ e ->getCode (), $ e );
60
+ throw new InvalidPipeline ( $ e ->getMessage (), $ e ->getCode (), $ e );
61
61
}
62
62
}
63
63
@@ -161,8 +161,8 @@ public function pipe( string|Closure|Pipe $pipe ): static {
161
161
* Gets the transformed subject after passing through one last pipe.
162
162
*
163
163
* @param Closure(mixed $subject, mixed ...$use): mixed $return
164
- * @throws InvalidPipeError When pipe type could not be resolved.
165
- * @throws UnexpectedPipelineException When a pipe abrupt the pipeline by throwing an exception & sealWith not used.
164
+ * @throws InvalidPipe When pipe type could not be resolved.
165
+ * @throws InvalidPipeline When a pipe abrupt the pipeline by throwing an exception & sealWith not used.
166
166
*/
167
167
// phpcs:ignore Squiz.Commenting.FunctionCommentThrowTag.Missing -- Doesn't throw throwable.
168
168
public function then ( Closure $ return ): mixed {
@@ -177,17 +177,17 @@ public function then( Closure $return ): mixed {
177
177
return $ catcher ( $ e , ...$ use );
178
178
}
179
179
180
- return $ e instanceof InvalidPipeError
180
+ return $ e instanceof InvalidPipe
181
181
? throw $ e
182
- : throw new UnexpectedPipelineException ( $ e ->getMessage (), $ e ->getCode (), $ e );
182
+ : throw new InvalidPipeline ( $ e ->getMessage (), $ e ->getCode (), $ e );
183
183
}
184
184
}
185
185
186
186
/**
187
187
* Passes through pipes in the pipeline and returns the transformed result.
188
188
*
189
- * @throws InvalidPipeError When pipe type could not be resolved.
190
- * @throws UnexpectedPipelineException When a pipe abrupt the pipeline by throwing an exception & sealWith not used.
189
+ * @throws InvalidPipe When pipe type could not be resolved.
190
+ * @throws InvalidPipeline When a pipe abrupt the pipeline by throwing an exception & sealWith not used.
191
191
*/
192
192
public function thenReturn () {
193
193
return $ this ->then ( return: static fn ( $ transformed ) => $ transformed );
0 commit comments