Skip to content

Commit f590f2c

Browse files
committed
Updated PHPStan to 0.12 and fixed new errors.
1 parent 5769063 commit f590f2c

File tree

6 files changed

+28
-29
lines changed

6 files changed

+28
-29
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ matrix:
77
- php: 7.2
88
- php: 7.3
99
- php: 7.4
10-
allow_failures:
11-
- php: 7.4
1210

1311
cache:
1412
directories:

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
"symfony/process": "^3.0 || ^4.0 || ^5.0"
1818
},
1919
"require-dev": {
20-
"bluepsyduck/common": "^1.0",
21-
"phpstan/phpstan": "^0.10",
22-
"phpstan/phpstan-phpunit": "^0.10",
23-
"phpstan/phpstan-strict-rules": "^0.10",
20+
"bluepsyduck/test-helper": "^1.0",
21+
"phpstan/phpstan": "^0.12",
22+
"phpstan/phpstan-phpunit": "^0.12",
23+
"phpstan/phpstan-strict-rules": "^0.12",
2424
"phpunit/phpunit": "^7.3",
25-
"rregeer/phpunit-coverage-check": "^0.1",
25+
"rregeer/phpunit-coverage-check": "^0.3",
2626
"squizlabs/php_codesniffer": "^3.3"
2727
},
2828
"autoload": {

phpcs.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0"?>
22
<ruleset>
33
<file>./src</file>
4+
<file>./test/src</file>
45

5-
<rule ref="PSR2" />
6-
</ruleset>
6+
<rule ref="PSR12" />
7+
</ruleset>

src/ProcessManager.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ class ProcessManager implements ProcessManagerInterface
3535

3636
/**
3737
* The processes currently waiting to be executed.
38-
* @var array
38+
* @var array<mixed>
3939
*/
4040
protected $pendingProcessData = [];
4141

4242
/**
4343
* The processes currently running.
44-
* @var array|Process[]
44+
* @var array<Process<string>>
4545
*/
4646
protected $runningProcesses = [];
4747

@@ -166,7 +166,7 @@ public function setProcessCheckCallback(?callable $processCheckCallback)
166166
/**
167167
* Invokes the callback if it is an callable.
168168
* @param callable|null $callback
169-
* @param Process $process
169+
* @param Process<string> $process
170170
*/
171171
protected function invokeCallback(?callable $callback, Process $process): void
172172
{
@@ -177,9 +177,9 @@ protected function invokeCallback(?callable $callback, Process $process): void
177177

178178
/**
179179
* Adds a process to the manager.
180-
* @param Process $process
180+
* @param Process<string> $process
181181
* @param callable|null $callback
182-
* @param array $env
182+
* @param array<mixed> $env
183183
* @return $this
184184
*/
185185
public function addProcess(Process $process, callable $callback = null, array $env = [])
@@ -236,7 +236,7 @@ protected function checkRunningProcesses(): void
236236
/**
237237
* Checks the process whether it has finished.
238238
* @param int|null $pid
239-
* @param Process $process
239+
* @param Process<string> $process
240240
*/
241241
protected function checkRunningProcess(?int $pid, Process $process): void
242242
{
@@ -254,7 +254,7 @@ protected function checkRunningProcess(?int $pid, Process $process): void
254254

255255
/**
256256
* Checks whether the process already timed out.
257-
* @param Process $process
257+
* @param Process<string> $process
258258
*/
259259
protected function checkProcessTimeout(Process $process): void
260260
{

src/ProcessManagerInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ interface ProcessManagerInterface
1616
{
1717
/**
1818
* Adds a process to the manager.
19-
* @param Process $process
19+
* @param Process<string> $process
2020
* @param callable|null $callback
21-
* @param array $env
21+
* @param array<mixed> $env
2222
* @return $this
2323
*/
2424
public function addProcess(Process $process, callable $callback = null, array $env = []);

test/src/ProcessManagerTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace BluePsyduckTest\SymfonyProcessManager;
66

7-
use BluePsyduck\Common\Test\ReflectionTrait;
7+
use BluePsyduck\TestHelper\ReflectionTrait;
88
use BluePsyduck\SymfonyProcessManager\ProcessManager;
99
use PHPUnit\Framework\MockObject\MockObject;
1010
use PHPUnit\Framework\TestCase;
@@ -156,7 +156,7 @@ public function testSetProcessCheckCallback(): void
156156

157157
/**
158158
* Provides the data for the invokeCallback test.
159-
* @return array
159+
* @return array<mixed>
160160
*/
161161
public function provideInvokeCallback(): array
162162
{
@@ -231,7 +231,7 @@ public function testAddProcess(): void
231231

232232
/**
233233
* Provides the data for the executeNextPendingProcess test.
234-
* @return array
234+
* @return array<mixed>
235235
*/
236236
public function provideExecuteNextPendingProcess(): array
237237
{
@@ -312,7 +312,7 @@ public function testExecuteNextPendingProcess(?int $pid, bool $expectRunningProc
312312

313313
/**
314314
* Provides the data for the canExecuteNextPendingRequest test.
315-
* @return array
315+
* @return array<mixed>
316316
*/
317317
public function provideCanExecuteNextPendingRequest(): array
318318
{
@@ -325,9 +325,9 @@ public function provideCanExecuteNextPendingRequest(): array
325325

326326
/**
327327
* Tests the canExecuteNextPendingRequest method.
328-
* @param array $runningProcesses
328+
* @param array<Process<string>> $runningProcesses
329329
* @param int $numberOfParallelProcesses
330-
* @param array $pendingProcessData
330+
* @param array<mixed> $pendingProcessData
331331
* @param bool $expectedResult
332332
* @throws ReflectionException
333333
* @covers ::canExecuteNextPendingRequest
@@ -377,7 +377,7 @@ public function testCheckRunningProcesses(): void
377377

378378
/**
379379
* Provides the data for the checkRunningProcess test.
380-
* @return array
380+
* @return array<mixed>
381381
*/
382382
public function provideCheckRunningProcess(): array
383383
{
@@ -446,7 +446,7 @@ public function testCheckRunningProcess(
446446

447447
/**
448448
* Provides the data for the checkProcessTimeout test.
449-
* @return array
449+
* @return array<mixed>
450450
*/
451451
public function provideCheckProcessTimeout(): array
452452
{
@@ -542,7 +542,7 @@ public function testSleep(): void
542542

543543
/**
544544
* Provides the data for the hasUnfinishedProcesses test.
545-
* @return array
545+
* @return array<mixed>
546546
*/
547547
public function provideHasUnfinishedProcesses(): array
548548
{
@@ -555,8 +555,8 @@ public function provideHasUnfinishedProcesses(): array
555555

556556
/**
557557
* Tests the hasUnfinishedProcesses method.
558-
* @param array $pendingProcessData
559-
* @param array $runningProcesses
558+
* @param array<mixed> $pendingProcessData
559+
* @param array<Process<string>> $runningProcesses
560560
* @param bool $expectedResult
561561
* @throws ReflectionException
562562
* @covers ::hasUnfinishedProcesses

0 commit comments

Comments
 (0)