@@ -65,7 +65,7 @@ public function __construct(InvocationHandler $handler, Matcher $matcher, Config
65
65
*
66
66
* @return $this
67
67
*/
68
- public function id (string $ id ): self
68
+ public function id (string $ id ): InvocationStubber
69
69
{
70
70
$ this ->invocationHandler ->registerMatcher ($ id , $ this ->matcher );
71
71
@@ -75,7 +75,7 @@ public function id(string $id): self
75
75
/**
76
76
* @return $this
77
77
*/
78
- public function will (Stub $ stub ): self
78
+ public function will (Stub $ stub ): InvocationStubber
79
79
{
80
80
$ this ->matcher ->setStub ($ stub );
81
81
@@ -85,7 +85,7 @@ public function will(Stub $stub): self
85
85
/**
86
86
* @throws IncompatibleReturnValueException
87
87
*/
88
- public function willReturn (mixed $ value , mixed ...$ nextValues ): self
88
+ public function willReturn (mixed $ value , mixed ...$ nextValues ): InvocationStubber
89
89
{
90
90
if (count ($ nextValues ) === 0 ) {
91
91
$ this ->ensureTypeOfReturnValues ([$ value ]);
@@ -104,14 +104,14 @@ public function willReturn(mixed $value, mixed ...$nextValues): self
104
104
return $ this ->will ($ stub );
105
105
}
106
106
107
- public function willReturnReference (mixed &$ reference ): self
107
+ public function willReturnReference (mixed &$ reference ): InvocationStubber
108
108
{
109
109
$ stub = new ReturnReference ($ reference );
110
110
111
111
return $ this ->will ($ stub );
112
112
}
113
113
114
- public function willReturnMap (array $ valueMap ): self
114
+ public function willReturnMap (array $ valueMap ): InvocationStubber
115
115
{
116
116
$ method = $ this ->configuredMethod ();
117
117
@@ -156,35 +156,35 @@ public function willReturnMap(array $valueMap): self
156
156
return $ this ->will ($ stub );
157
157
}
158
158
159
- public function willReturnArgument (int $ argumentIndex ): self
159
+ public function willReturnArgument (int $ argumentIndex ): InvocationStubber
160
160
{
161
161
$ stub = new ReturnArgument ($ argumentIndex );
162
162
163
163
return $ this ->will ($ stub );
164
164
}
165
165
166
- public function willReturnCallback (callable $ callback ): self
166
+ public function willReturnCallback (callable $ callback ): InvocationStubber
167
167
{
168
168
$ stub = new ReturnCallback ($ callback );
169
169
170
170
return $ this ->will ($ stub );
171
171
}
172
172
173
- public function willReturnSelf (): self
173
+ public function willReturnSelf (): InvocationStubber
174
174
{
175
175
$ stub = new ReturnSelf ;
176
176
177
177
return $ this ->will ($ stub );
178
178
}
179
179
180
- public function willReturnOnConsecutiveCalls (mixed ...$ values ): self
180
+ public function willReturnOnConsecutiveCalls (mixed ...$ values ): InvocationStubber
181
181
{
182
182
$ stub = new ConsecutiveCalls ($ values );
183
183
184
184
return $ this ->will ($ stub );
185
185
}
186
186
187
- public function willThrowException (Throwable $ exception ): self
187
+ public function willThrowException (Throwable $ exception ): InvocationStubber
188
188
{
189
189
$ stub = new Exception ($ exception );
190
190
@@ -194,7 +194,7 @@ public function willThrowException(Throwable $exception): self
194
194
/**
195
195
* @return $this
196
196
*/
197
- public function after (string $ id ): self
197
+ public function after (string $ id ): InvocationStubber
198
198
{
199
199
$ this ->matcher ->setAfterMatchBuilderId ($ id );
200
200
@@ -208,7 +208,7 @@ public function after(string $id): self
208
208
*
209
209
* @return $this
210
210
*/
211
- public function with (mixed ...$ arguments ): self
211
+ public function with (mixed ...$ arguments ): InvocationStubber
212
212
{
213
213
$ this ->ensureParametersCanBeConfigured ();
214
214
@@ -223,7 +223,7 @@ public function with(mixed ...$arguments): self
223
223
*
224
224
* @return $this
225
225
*/
226
- public function withAnyParameters (): self
226
+ public function withAnyParameters (): InvocationStubber
227
227
{
228
228
$ this ->ensureParametersCanBeConfigured ();
229
229
@@ -239,7 +239,7 @@ public function withAnyParameters(): self
239
239
*
240
240
* @return $this
241
241
*/
242
- public function method (Constraint |PropertyHook |string $ constraint ): self
242
+ public function method (Constraint |PropertyHook |string $ constraint ): InvocationStubber
243
243
{
244
244
if ($ this ->matcher ->hasMethodNameRule ()) {
245
245
throw new MethodNameAlreadyConfiguredException ;
0 commit comments