Skip to content

Commit c027a6e

Browse files
Merge pull request php-vcr#333 from pvgnd/fix-phpstan
fix: phpstan ignore error failure on PHP >= 7.2
2 parents 1b152a6 + 4b8f627 commit c027a6e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ parameters:
1010
message: '#Unreachable statement - code above always terminates.#'
1111
path: src/VCR/CodeTransform/AbstractCodeTransform.php
1212
# PHPStan cannot detect that strrpos will succeed (because of Assertion above) in HttpUtil::parseStatus
13-
- '#Parameter .* \$str of function substr expects string, string\|false given.#'
13+
- '#Parameter .* \$str(ing)? of function substr expects string, string\|false given.#'
1414
# The EventDispatcherInterface::dispatch signature is different (!) between Symfony <4.3 and >=4.3
1515
- '/Parameter #1 \$event of method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) expects object, string\|null given./'
1616
- '/Parameter #2 \$eventName of method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) expects string\|null, VCR\\Event\\Event given./'

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)