Skip to content

Commit 083d480

Browse files
author
Dominik Zogg
committed
update dev dependencies
1 parent 961a155 commit 083d480

File tree

8 files changed

+57
-56
lines changed

8 files changed

+57
-56
lines changed

.php_cs renamed to .php-cs-fixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/** @var array $config */
1313
$config = require __DIR__ . '/vendor/chubbyphp/chubbyphp-dev-helper/phpcs.php';
1414

15-
return PhpCsFixer\Config::create()
15+
return (new PhpCsFixer\Config)
1616
->setIndent($config['indent'])
1717
->setLineEnding($config['lineEnding'])
1818
->setRules($config['rules'])

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
"blackfire/php-sdk": "^1.23",
2929
"chubbyphp/chubbyphp-dev-helper": "dev-master",
3030
"chubbyphp/chubbyphp-mock": "^1.6",
31-
"infection/infection": "^0.20.2",
31+
"infection/infection": "^0.25.2",
3232
"php-coveralls/php-coveralls": "^2.4.3",
3333
"phploc/phploc": "^7.0.2",
3434
"phpstan/extension-installer": "^1.1",
35-
"phpstan/phpstan": "^0.12.64",
36-
"phpunit/phpunit": "^9.5"
35+
"phpstan/phpstan": "^0.12.99",
36+
"phpunit/phpunit": "^9.5.10"
3737
},
3838
"autoload": {
3939
"psr-4": { "Chubbyphp\\WorkermanRequestHandler\\": "src/" }

phpunit.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
backupGlobals="false"
34
backupStaticAttributes="false"
45
colors="true"
56
convertErrorsToExceptions="true"
@@ -8,7 +9,12 @@
89
executionOrder="random"
910
processIsolation="false"
1011
stopOnFailure="false"
11-
>
12+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
13+
<coverage>
14+
<include>
15+
<directory>./src</directory>
16+
</include>
17+
</coverage>
1218
<testsuites>
1319
<testsuite name="Integration">
1420
<directory>./tests/Integration</directory>
@@ -17,9 +23,4 @@
1723
<directory>./tests/Unit</directory>
1824
</testsuite>
1925
</testsuites>
20-
<filter>
21-
<whitelist>
22-
<directory>./src</directory>
23-
</whitelist>
24-
</filter>
2526
</phpunit>

tests/Unit/Adapter/BlackfireOnMessageAdapterTest.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ final class BlackfireOnMessageAdapterTest extends TestCase
3030

3131
public function testInvokeWithoutHeaderWithoutConfigAndWithoutLogger(): void
3232
{
33-
/** @var WorkermanTcpConnection|MockObject $workermanTcpConnection */
33+
/** @var MockObject|WorkermanTcpConnection $workermanTcpConnection */
3434
$workermanTcpConnection = $this->getMockByCalls(WorkermanTcpConnection::class);
3535

36-
/** @var WorkermanRequest|MockObject $workermanRequest */
36+
/** @var MockObject|WorkermanRequest $workermanRequest */
3737
$workermanRequest = $this->getMockByCalls(WorkermanRequest::class, [
3838
Call::create('header')->with('x-blackfire-query', null)->willReturn(null),
3939
]);
4040

41-
/** @var OnMessageInterface|MockObject $onMessage */
41+
/** @var MockObject|OnMessageInterface $onMessage */
4242
$onMessage = $this->getMockByCalls(OnMessageInterface::class, [
4343
Call::create('__invoke')->with($workermanTcpConnection, $workermanRequest),
4444
]);
@@ -52,20 +52,20 @@ public function testInvokeWithoutHeaderWithoutConfigAndWithoutLogger(): void
5252

5353
public function testInvokeWithoutConfigAndWithoutLogger(): void
5454
{
55-
/** @var WorkermanTcpConnection|MockObject $workermanTcpConnection */
55+
/** @var MockObject|WorkermanTcpConnection $workermanTcpConnection */
5656
$workermanTcpConnection = $this->getMockByCalls(WorkermanTcpConnection::class);
5757

58-
/** @var WorkermanRequest|MockObject $workermanRequest */
58+
/** @var MockObject|WorkermanRequest $workermanRequest */
5959
$workermanRequest = $this->getMockByCalls(WorkermanRequest::class, [
6060
Call::create('header')->with('x-blackfire-query', null)->willReturn('workerman'),
6161
]);
6262

63-
/** @var OnMessageInterface|MockObject $onMessage */
63+
/** @var MockObject|OnMessageInterface $onMessage */
6464
$onMessage = $this->getMockByCalls(OnMessageInterface::class, [
6565
Call::create('__invoke')->with($workermanTcpConnection, $workermanRequest),
6666
]);
6767

68-
/** @var Probe|MockObject $probe */
68+
/** @var MockObject|Probe $probe */
6969
$probe = $this->getMockByCalls(Probe::class);
7070

7171
/** @var Client|MockObject $client */
@@ -80,23 +80,23 @@ public function testInvokeWithoutConfigAndWithoutLogger(): void
8080

8181
public function testInvokeWithConfigAndWithLogger(): void
8282
{
83-
/** @var WorkermanTcpConnection|MockObject $workermanTcpConnection */
83+
/** @var MockObject|WorkermanTcpConnection $workermanTcpConnection */
8484
$workermanTcpConnection = $this->getMockByCalls(WorkermanTcpConnection::class);
8585

86-
/** @var WorkermanRequest|MockObject $workermanRequest */
86+
/** @var MockObject|WorkermanRequest $workermanRequest */
8787
$workermanRequest = $this->getMockByCalls(WorkermanRequest::class, [
8888
Call::create('header')->with('x-blackfire-query', null)->willReturn('workerman'),
8989
]);
9090

91-
/** @var OnMessageInterface|MockObject $onMessage */
91+
/** @var MockObject|OnMessageInterface $onMessage */
9292
$onMessage = $this->getMockByCalls(OnMessageInterface::class, [
9393
Call::create('__invoke')->with($workermanTcpConnection, $workermanRequest),
9494
]);
9595

9696
/** @var Configuration|MockObject $config */
9797
$config = $this->getMockByCalls(Configuration::class);
9898

99-
/** @var Probe|MockObject $probe */
99+
/** @var MockObject|Probe $probe */
100100
$probe = $this->getMockByCalls(Probe::class);
101101

102102
/** @var Client|MockObject $client */
@@ -114,15 +114,15 @@ public function testInvokeWithConfigAndWithLogger(): void
114114

115115
public function testInvokeWithExceptionOnCreateProbe(): void
116116
{
117-
/** @var WorkermanTcpConnection|MockObject $workermanTcpConnection */
117+
/** @var MockObject|WorkermanTcpConnection $workermanTcpConnection */
118118
$workermanTcpConnection = $this->getMockByCalls(WorkermanTcpConnection::class);
119119

120-
/** @var WorkermanRequest|MockObject $workermanRequest */
120+
/** @var MockObject|WorkermanRequest $workermanRequest */
121121
$workermanRequest = $this->getMockByCalls(WorkermanRequest::class, [
122122
Call::create('header')->with('x-blackfire-query', null)->willReturn('workerman'),
123123
]);
124124

125-
/** @var OnMessageInterface|MockObject $onMessage */
125+
/** @var MockObject|OnMessageInterface $onMessage */
126126
$onMessage = $this->getMockByCalls(OnMessageInterface::class, [
127127
Call::create('__invoke')->with($workermanTcpConnection, $workermanRequest),
128128
]);
@@ -148,23 +148,23 @@ public function testInvokeWithExceptionOnCreateProbe(): void
148148

149149
public function testInvokeWithExceptionOnProbeEnd(): void
150150
{
151-
/** @var WorkermanTcpConnection|MockObject $workermanTcpConnection */
151+
/** @var MockObject|WorkermanTcpConnection $workermanTcpConnection */
152152
$workermanTcpConnection = $this->getMockByCalls(WorkermanTcpConnection::class);
153153

154-
/** @var WorkermanRequest|MockObject $workermanRequest */
154+
/** @var MockObject|WorkermanRequest $workermanRequest */
155155
$workermanRequest = $this->getMockByCalls(WorkermanRequest::class, [
156156
Call::create('header')->with('x-blackfire-query', null)->willReturn('workerman'),
157157
]);
158158

159-
/** @var OnMessageInterface|MockObject $onMessage */
159+
/** @var MockObject|OnMessageInterface $onMessage */
160160
$onMessage = $this->getMockByCalls(OnMessageInterface::class, [
161161
Call::create('__invoke')->with($workermanTcpConnection, $workermanRequest),
162162
]);
163163

164164
/** @var Configuration|MockObject $config */
165165
$config = $this->getMockByCalls(Configuration::class);
166166

167-
/** @var Probe|MockObject $probe */
167+
/** @var MockObject|Probe $probe */
168168
$probe = $this->getMockByCalls(Probe::class);
169169

170170
$exception = new LogicException('Something went wrong');

tests/Unit/Adapter/NewRelicOnMessageAdapterTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ final class TestNewRelicStartTransaction
99
/**
1010
* @var array<int, array>
1111
*/
12-
private static $calls = [];
12+
private static array $calls = [];
1313

1414
public static function add(string $appname, ?string $license = null): void
1515
{
@@ -40,7 +40,7 @@ final class TestNewRelicEndTransaction
4040
/**
4141
* @var array<int, array>
4242
*/
43-
private static $calls = [];
43+
private static array $calls = [];
4444

4545
public static function add(bool $ignore): void
4646
{
@@ -94,13 +94,13 @@ public function testInvoke(): void
9494
TestNewRelicStartTransaction::reset();
9595
TestNewRelicEndTransaction::reset();
9696

97-
/** @var WorkermanTcpConnection|MockObject $workermanTcpConnection */
97+
/** @var MockObject|WorkermanTcpConnection $workermanTcpConnection */
9898
$workermanTcpConnection = $this->getMockByCalls(WorkermanTcpConnection::class);
9999

100-
/** @var WorkermanRequest|MockObject $workermanRequest */
100+
/** @var MockObject|WorkermanRequest $workermanRequest */
101101
$workermanRequest = $this->getMockByCalls(WorkermanRequest::class);
102102

103-
/** @var OnMessageInterface|MockObject $onMessage */
103+
/** @var MockObject|OnMessageInterface $onMessage */
104104
$onMessage = $this->getMockByCalls(OnMessageInterface::class, [
105105
Call::create('__invoke')->with($workermanTcpConnection, $workermanRequest),
106106
]);

tests/Unit/OnMessageTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,29 @@ final class OnMessageTest extends TestCase
2828

2929
public function testInvoke(): void
3030
{
31-
/** @var WorkermanTcpConnection|MockObject $workermanTcpConnection */
31+
/** @var MockObject|WorkermanTcpConnection $workermanTcpConnection */
3232
$workermanTcpConnection = $this->getMockByCalls(WorkermanTcpConnection::class);
3333

34-
/** @var WorkermanRequest|MockObject $workermanRequest */
34+
/** @var MockObject|WorkermanRequest $workermanRequest */
3535
$workermanRequest = $this->getMockByCalls(WorkermanRequest::class);
3636

37-
/** @var ServerRequestInterface|MockObject $request */
37+
/** @var MockObject|ServerRequestInterface $request */
3838
$request = $this->getMockByCalls(ServerRequestInterface::class);
3939

40-
/** @var ResponseInterface|MockObject $response */
40+
/** @var MockObject|ResponseInterface $response */
4141
$response = $this->getMockByCalls(ResponseInterface::class);
4242

43-
/** @var PsrRequestFactoryInterface|MockObject $psrRequestFactory */
43+
/** @var MockObject|PsrRequestFactoryInterface $psrRequestFactory */
4444
$psrRequestFactory = $this->getMockByCalls(PsrRequestFactoryInterface::class, [
4545
Call::create('create')->with($workermanRequest)->willReturn($request),
4646
]);
4747

48-
/** @var WorkermanResponseEmitterInterface|MockObject $workermanResponseEmitter */
48+
/** @var MockObject|WorkermanResponseEmitterInterface $workermanResponseEmitter */
4949
$workermanResponseEmitter = $this->getMockByCalls(WorkermanResponseEmitterInterface::class, [
5050
Call::create('emit')->with($response, $workermanTcpConnection),
5151
]);
5252

53-
/** @var RequestHandlerInterface|MockObject $workermanRequestHandler */
53+
/** @var MockObject|RequestHandlerInterface $workermanRequestHandler */
5454
$workermanRequestHandler = $this->getMockByCalls(RequestHandlerInterface::class, [
5555
Call::create('handle')->with($request)->willReturn($response),
5656
]);

tests/Unit/PsrRequestFactoryTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class PsrRequestFactoryTest extends TestCase
2929

3030
public function testInvoke(): void
3131
{
32-
/** @var WorkermanRequest|MockObject $workermanRequest */
32+
/** @var MockObject|WorkermanRequest $workermanRequest */
3333
$workermanRequest = $this->getMockByCalls(WorkermanRequest::class, [
3434
Call::create('method')->with()->willReturn('POST'),
3535
Call::create('uri')->with()->willReturn('/application'),
@@ -70,23 +70,23 @@ public function testInvoke(): void
7070
Call::create('rawBody')->with()->willReturn('This is the body.'),
7171
]);
7272

73-
/** @var StreamInterface|MockObject $requestBody */
73+
/** @var MockObject|StreamInterface $requestBody */
7474
$requestBody = $this->getMockByCalls(StreamInterface::class, [
7575
Call::create('write')->with('This is the body.'),
7676
]);
7777

78-
/** @var StreamInterface|MockObject $uploadedFileStream1 */
78+
/** @var MockObject|StreamInterface $uploadedFileStream1 */
7979
$uploadedFileStream1 = $this->getMockByCalls(StreamInterface::class);
8080

81-
/** @var StreamInterface|MockObject $uploadedFileStream2 */
81+
/** @var MockObject|StreamInterface $uploadedFileStream2 */
8282
$uploadedFileStream2 = $this->getMockByCalls(StreamInterface::class);
8383

84-
/** @var StreamInterface|MockObject $uploadedFileStream3 */
84+
/** @var MockObject|StreamInterface $uploadedFileStream3 */
8585
$uploadedFileStream3 = $this->getMockByCalls(StreamInterface::class);
8686

8787
$uploadedFileException = new \RuntimeException('test');
8888

89-
/** @var StreamFactoryInterface|MockObject $streamFactory */
89+
/** @var MockObject|StreamFactoryInterface $streamFactory */
9090
$streamFactory = $this->getMockByCalls(StreamFactoryInterface::class, [
9191
Call::create('createStreamFromFile')->with('/tmp/php9875842a', 'r')->willReturn($uploadedFileStream1),
9292
Call::create('createStreamFromFile')->with('/tmp/php8d5f55ce', 'r')->willReturn($uploadedFileStream2),
@@ -96,16 +96,16 @@ public function testInvoke(): void
9696
Call::create('createStream')->with('')->willReturn($uploadedFileStream3),
9797
]);
9898

99-
/** @var UploadedFileInterface|MockObject $uploadedFile1 */
99+
/** @var MockObject|UploadedFileInterface $uploadedFile1 */
100100
$uploadedFile1 = $this->getMockByCalls(UploadedFileInterface::class);
101101

102-
/** @var UploadedFileInterface|MockObject $uploadedFile2 */
102+
/** @var MockObject|UploadedFileInterface $uploadedFile2 */
103103
$uploadedFile2 = $this->getMockByCalls(UploadedFileInterface::class);
104104

105-
/** @var UploadedFileInterface|MockObject $uploadedFile3 */
105+
/** @var MockObject|UploadedFileInterface $uploadedFile3 */
106106
$uploadedFile3 = $this->getMockByCalls(UploadedFileInterface::class);
107107

108-
/** @var UploadedFileFactoryInterface|MockObject $uploadedFileFactory */
108+
/** @var MockObject|UploadedFileFactoryInterface $uploadedFileFactory */
109109
$uploadedFileFactory = $this->getMockByCalls(UploadedFileFactoryInterface::class, [
110110
Call::create('createUploadedFile')
111111
->with($uploadedFileStream1, 1048576, 0, 'CV.pdf', 'application/pdf')
@@ -118,7 +118,7 @@ public function testInvoke(): void
118118
->willReturn($uploadedFile3),
119119
]);
120120

121-
/** @var ServerRequestInterface|MockObject $request */
121+
/** @var MockObject|ServerRequestInterface $request */
122122
$request = $this->getMockByCalls(ServerRequestInterface::class, [
123123
Call::create('withHeader')->with('Content-Type', 'multipart/form-data')->willReturnSelf(),
124124
Call::create('withCookieParams')
@@ -154,7 +154,7 @@ static function (array $uploadedFiles) use ($uploadedFile1, $uploadedFile2, $upl
154154
Call::create('getBody')->with()->willReturn($requestBody),
155155
]);
156156

157-
/** @var ServerRequestFactoryInterface|MockObject $serverRequestFactory */
157+
/** @var MockObject|ServerRequestFactoryInterface $serverRequestFactory */
158158
$serverRequestFactory = $this->getMockByCalls(ServerRequestFactoryInterface::class, [
159159
Call::create('createServerRequest')
160160
->with('POST', '/application', [])

tests/Unit/WorkermanResponseEmitterTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ public function testInvoke(): void
3131
'Content-Type' => ['application/json'],
3232
];
3333

34-
/** @var StreamInterface|MockObject $responseBody */
34+
/** @var MockObject|StreamInterface $responseBody */
3535
$responseBody = $this->getMockByCalls(StreamInterface::class, [
3636
Call::create('__toString')->with()->willReturn('This is the body.'),
3737
]);
3838

39-
/** @var ResponseInterface|MockObject $response */
39+
/** @var MockObject|ResponseInterface $response */
4040
$response = $this->getMockByCalls(ResponseInterface::class, [
4141
Call::create('getStatusCode')->with()->willReturn(200),
4242
Call::create('getReasonPhrase')->with()->willReturn('OK'),
4343
Call::create('getHeaders')->with()->willReturn($headers),
4444
Call::create('getBody')->with()->willReturn($responseBody),
4545
]);
4646

47-
/** @var WorkermanTcpConnection|MockObject $workermanTcpConnection */
47+
/** @var MockObject|WorkermanTcpConnection $workermanTcpConnection */
4848
$workermanTcpConnection = $this->getMockByCalls(WorkermanTcpConnection::class, [
4949
Call::create('send')
5050
->with(

0 commit comments

Comments
 (0)