Skip to content

Commit 4b8f627

Browse files
committed
fix: ensure stream_wrapper_restore does not throw
1 parent 6cc06e2 commit 4b8f627

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/VCR/Util/StreamProcessor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public function intercept(): void
8282
*/
8383
public function restore(): void
8484
{
85+
// stream_wrapper_restore can throw when stream_wrapper was never changed, so we unregister first
86+
stream_wrapper_unregister(self::PROTOCOL);
8587
stream_wrapper_restore(self::PROTOCOL);
8688
}
8789

0 commit comments

Comments
 (0)