Skip to content

Commit f844c76

Browse files
committed
Raised PHPStan to level 5
1 parent d3d8514 commit f844c76

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

phpstan.neon

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ includes:
22
- vendor/phpstan/phpstan-phpunit/extension.neon
33

44
parameters:
5-
level: 3
5+
level: 5
66
paths:
77
- src
8-
- tests
8+
- tests
9+
reportUnmatchedIgnoredErrors: false
10+
ignoreErrors: #see https://github.com/phpstan/phpstan/issues/1267#issuecomment-552874947 -> @todo remove when sf 3.4 support ends
11+
- "#^Call to an undefined static method #"

src/Process/ProcessorCounter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ private function readFromProcCPUInfo()
5555
$process = Process::fromShellCommandline($executeCommand);
5656
} else {
5757
// Drop when sf 3.4 supports ends
58+
/** @phpstan-ignore-next-line */ // @todo remove when sf 3.4 support ends
5859
$process = new Process($executeCommand);
5960
}
6061
$process->run();

src/Process/Report.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Report
1414
/**
1515
* @param string $suite
1616
* @param bool $isSuccess
17-
* @param int $time
17+
* @param float $time
1818
* @param int $processorNumber
1919
* @param string|null $errorBuffer
2020
* @param bool $isFirstOnThread
@@ -68,7 +68,7 @@ public function getSuite()
6868
}
6969

7070
/**
71-
* @return int Time in microseconds
71+
* @return float Time in microseconds
7272
*/
7373
public function getTime()
7474
{

src/Queue/CreateTestsQueueFromPhpUnitXML.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static function execute($xmlFile)
4141

4242
private static function processTestSuite(
4343
TestsQueue $testSuites,
44-
\PHPUnit\Framework\TestSuiteIterator $testSuiteIterator
44+
\Iterator $testSuiteIterator
4545
) {
4646
foreach ($testSuiteIterator as $testSuite) {
4747
self::addTestFile($testSuites, $testSuite);

src/UI/VerboseRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function renderBody(QueueInterface $queue, Processes $processes)
5252

5353
$log = $processes->getReport();
5454
$count = count($log);
55-
$tests = array_slice($log, $this->lastIndex, $count, 1);
55+
$tests = array_slice($log, $this->lastIndex, $count, true);
5656

5757
foreach ($tests as $report) {
5858
++$this->lastIndex;
@@ -90,7 +90,7 @@ public function renderBody(QueueInterface $queue, Processes $processes)
9090
/**
9191
* Method to format duration to human readable format.
9292
*
93-
* @param int $milliseconds
93+
* @param float $milliseconds
9494
*
9595
* @return string
9696
*/

tests/Process/ProcessesManagerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function shouldCreateBeforeProcessesExecutingFactoryWithTheCorrectArgumen
3030
$this->assertTrue($manager->assertNProcessRunning($queue, $processes));
3131
}
3232

33-
/**
33+
/**src/UI/VerboseRenderer.php
3434
* @test
3535
*/
3636
public function shouldCreateProcessesWithoutBeforeProcessExecutingFactoryWithTheCorrectArguments()
@@ -57,7 +57,7 @@ public function shouldCreateProcessesWithoutBeforeProcessExecutingFactoryWithThe
5757
$factory->expects($this->exactly(1))
5858
->method('createAProcess')
5959
->with($this->anything(), $this->equalTo(1), $this->equalTo(1), $this->equalTo(true))
60-
->willReturn(new Process(['echo '], rand()));
60+
->willReturn(new Process(['echo '], (string) rand()));
6161

6262
$manager = new ProcessesManager($factory, 1);
6363

@@ -107,7 +107,7 @@ public function shouldCreate6ProcessesGivingThemTheCorrectEnvParameters()
107107
$factory->expects($this->at($at))
108108
->method('createAProcess')
109109
->with($this->anything(), $this->equalTo($expectation[0]), $this->equalTo($expectation[1]), $this->equalTo($expectation[2]))
110-
->willReturn(new Process(['echo '], rand()));
110+
->willReturn(new Process(['echo '], (string) rand()));
111111
}
112112

113113
$manager = new ProcessesManager($factory, 1);

0 commit comments

Comments
 (0)