66
77use DateTimeImmutable ;
88use Saloon \Data \RecordedResponse ;
9- use Saloon \Http \Faking \SimulatedResponsePayload ;
10- use Saloon \Contracts \SimulatedResponsePayload as SimulatedResponsePayloadContract ;
9+ use Saloon \Http \Faking \FakeResponse ;
10+ use Saloon \Contracts \FakeResponse as FakeResponseContract ;
1111
1212class CachedResponse
1313{
1414 /**
1515 * Constructor
16- *
17- * @param \Saloon\Data\RecordedResponse $recordedResponse
18- * @param \DateTimeImmutable $expiresAt
19- * @param int $ttl
2016 */
2117 public function __construct (
2218 readonly public RecordedResponse $ recordedResponse ,
@@ -28,8 +24,6 @@ public function __construct(
2824
2925 /**
3026 * Check if the response has expired.
31- *
32- * @return bool
3327 */
3428 public function hasExpired (): bool
3529 {
@@ -38,24 +32,20 @@ public function hasExpired(): bool
3832
3933 /**
4034 * Check if the response has not expired.
41- *
42- * @return bool
4335 */
4436 public function hasNotExpired (): bool
4537 {
4638 return ! $ this ->hasExpired ();
4739 }
4840
4941 /**
50- * Create a simulated response payload
51- *
52- * @return \Saloon\Contracts\SimulatedResponsePayload
42+ * Create a fake response
5343 */
54- public function getSimulatedResponsePayload (): SimulatedResponsePayloadContract
44+ public function getFakeResponse (): FakeResponseContract
5545 {
5646 $ response = $ this ->recordedResponse ;
5747
58- return new SimulatedResponsePayload (
48+ return new FakeResponse (
5949 body: $ response ->data ,
6050 status: $ response ->statusCode ,
6151 headers: $ response ->headers
0 commit comments