Skip to content

Commit ca99693

Browse files
authored
Merge pull request php-vcr#414 from php-vcr/fix/ci
Fix/ci
2 parents dd25dd5 + 128486f commit ca99693

File tree

10 files changed

+47
-12
lines changed

10 files changed

+47
-12
lines changed

phpstan-baseline.neon

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ parameters:
2121
path: src/VCR/Util/SoapClient.php
2222

2323
-
24-
message: "#^Parameter \\#2 \\$length of function fread expects int\\<0, max\\>, int given\\.$#"
24+
message: "#^Offset 'uri' does not exist on array\\{timed_out\\: bool, blocked\\: bool, eof\\: bool, unread_bytes\\: int, stream_type\\: string, wrapper_type\\: string, wrapper_data\\: mixed, mode\\: string, \\.\\.\\.\\}\\.$#"
25+
count: 1
26+
path: src/VCR/Util/StreamProcessor.php
27+
28+
-
29+
message: "#^Parameter \\#2 \\$length of function fread expects int\\<1, max\\>, int given\\.$#"
2530
count: 1
2631
path: src/VCR/Util/StreamProcessor.php
2732

@@ -30,6 +35,11 @@ parameters:
3035
count: 1
3136
path: src/VCR/Util/StreamProcessor.php
3237

38+
-
39+
message: "#^Parameter \\#3 \\$microseconds of function stream_set_timeout expects int, int\\|null given\\.$#"
40+
count: 1
41+
path: src/VCR/Util/StreamProcessor.php
42+
3343
-
3444
message: "#^Cannot call method record\\(\\) on VCR\\\\Cassette\\|null\\.$#"
3545
count: 1
@@ -55,6 +65,31 @@ parameters:
5565
count: 1
5666
path: tests/Unit/RequestTest.php
5767

68+
-
69+
message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#"
70+
count: 1
71+
path: tests/Unit/Util/StreamProcessorTest.php
72+
73+
-
74+
message: "#^Parameter \\#1 \\$stream of function stream_set_blocking expects resource, resource\\|false given\\.$#"
75+
count: 1
76+
path: tests/Unit/Util/StreamProcessorTest.php
77+
78+
-
79+
message: "#^Parameter \\#1 \\$stream of function stream_set_read_buffer expects resource, resource\\|false given\\.$#"
80+
count: 1
81+
path: tests/Unit/Util/StreamProcessorTest.php
82+
83+
-
84+
message: "#^Parameter \\#1 \\$stream of function stream_set_timeout expects resource, resource\\|false given\\.$#"
85+
count: 2
86+
path: tests/Unit/Util/StreamProcessorTest.php
87+
88+
-
89+
message: "#^Parameter \\#1 \\$stream of function stream_set_write_buffer expects resource, resource\\|false given\\.$#"
90+
count: 1
91+
path: tests/Unit/Util/StreamProcessorTest.php
92+
5893
-
5994
message: "#^Call to an undefined method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:addListener\\(\\)\\.$#"
6095
count: 1

src/VCR/CodeTransform/AbstractCodeTransform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function register(): void
2424
$isRegistered = stream_filter_register(static::NAME, static::class);
2525
Assertion::true(
2626
$isRegistered,
27-
sprintf('Failed registering stream filter "%s" on stream "%s"', static::class, static::NAME)
27+
\sprintf('Failed registering stream filter "%s" on stream "%s"', static::class, static::NAME)
2828
);
2929
}
3030
}

src/VCR/Exceptions/InvalidHostException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ class InvalidHostException extends \InvalidArgumentException
88
{
99
public static function create(?string $url): self
1010
{
11-
return new self(sprintf('Could not read host from URL "%s". Please check the URL syntax.', $url));
11+
return new self(\sprintf('Could not read host from URL "%s". Please check the URL syntax.', $url));
1212
}
1313
}

src/VCR/LibraryHooks/SoapHook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function doRequest(string $request, string $location, string $action, int
4949
} else { // >= SOAP_1_2
5050
$vcrRequest->setHeader(
5151
'Content-Type',
52-
sprintf('application/soap+xml; charset=utf-8; action="%s"', $action)
52+
\sprintf('application/soap+xml; charset=utf-8; action="%s"', $action)
5353
);
5454
}
5555

src/VCR/VCRFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function createStorage(string $cassetteName): Storage
4848
Assertion::subclassOf(
4949
$className,
5050
Storage::class,
51-
sprintf('Storage class "%s" is not a subclass of "%s".', $className, Storage::class)
51+
\sprintf('Storage class "%s" is not a subclass of "%s".', $className, Storage::class)
5252
);
5353

5454
/** @var Storage $storage */

src/VCR/Videorecorder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function handleRequest(Request $request): Response
171171
|| VCR::MODE_ONCE === $this->config->getMode()
172172
&& false === $this->cassette->isNew()
173173
) {
174-
throw new \LogicException(sprintf("The request does not match a previously recorded request and the 'mode' is set to '%s'. If you want to send the request anyway, make sure your 'mode' is set to 'new_episodes'. ".'Please see http://php-vcr.github.io/documentation/configuration/#record-modes.'."\nCassette: %s \n Request: %s", $this->config->getMode(), $this->cassette->getName(), print_r($request->toArray(), true)));
174+
throw new \LogicException(\sprintf("The request does not match a previously recorded request and the 'mode' is set to '%s'. If you want to send the request anyway, make sure your 'mode' is set to 'new_episodes'. ".'Please see http://php-vcr.github.io/documentation/configuration/#record-modes.'."\nCassette: %s \n Request: %s", $this->config->getMode(), $this->cassette->getName(), print_r($request->toArray(), true)));
175175
}
176176

177177
$this->disableLibraryHooks();

tests/Unit/CodeTransform/CurlCodeTransformTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class CurlCodeTransformTest extends TestCase
1414
*/
1515
public function testTransformCode(string $expected, string $code): void
1616
{
17-
$codeTransform = new class() extends CurlCodeTransform {
17+
$codeTransform = new class extends CurlCodeTransform {
1818
// A proxy to access the protected transformCode method.
1919
public function publicTransformCode(string $code): string
2020
{

tests/Unit/CodeTransform/SoapCodeTransformTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class SoapCodeTransformTest extends TestCase
1414
*/
1515
public function testTransformCode(string $expected, string $code): void
1616
{
17-
$codeTransform = new class() extends SoapCodeTransform {
17+
$codeTransform = new class extends SoapCodeTransform {
1818
// A proxy to access the protected transformCode method.
1919
public function publicTransformCode(string $code): string
2020
{

tests/Unit/RequestTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function testStorePostFields(): void
8989
'headers' => [
9090
'User-Agent' => 'Unit-Test',
9191
'Host' => 'example.com',
92-
],
92+
],
9393
'post_fields' => ['para1' => 'val1'],
9494
],
9595
$this->request->toArray()
@@ -107,7 +107,7 @@ public function testRestorePostFields(): void
107107
'headers' => [
108108
'User-Agent' => 'Unit-Test',
109109
'Host' => 'example.com',
110-
],
110+
],
111111
'post_fields' => ['para1' => 'val1'],
112112
],
113113
$restoredRequest->toArray()
@@ -177,7 +177,7 @@ public function testRestorePostFiles(): void
177177
'headers' => [
178178
'User-Agent' => 'Unit-Test',
179179
'Host' => 'example.com',
180-
],
180+
],
181181
'post_files' => [$file],
182182
],
183183
$restoredRequest->toArray()

tests/Unit/VCRTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function testShouldThrowExceptionIfNoCassettePresent(): void
114114
VCR::configure()->enableLibraryHooks(['stream_wrapper']);
115115
VCR::turnOn();
116116
// If there is no cassette inserted, a request should throw an exception
117-
file_get_contents('http://example.com'); // @phpstan-ignore-line
117+
file_get_contents('http://example.com');
118118
VCR::turnOff();
119119
}
120120

0 commit comments

Comments
 (0)