Skip to content

Commit d3430a9

Browse files
committed
Fix issues reported by PHPStan
PHPStan added new validations. We can't fix all `checkMissingIterableValueType` errors, since we inherit from phpspec classes.
1 parent be6b715 commit d3430a9

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ charset = utf-8
1515
indent_style = space
1616
indent_size = 4
1717

18-
[*.{yml,yaml}]
18+
[*.{neon,yml,yaml}]
1919
indent_style = space
2020
indent_size = 2
2121

phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
parameters:
2+
checkMissingIterableValueType: false

src/Listener/CodeCoverageListener.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,29 @@
2626
*/
2727
class CodeCoverageListener implements EventSubscriberInterface
2828
{
29+
/**
30+
* @var CodeCoverage
31+
*/
2932
private $coverage;
3033

34+
/**
35+
* @var ConsoleIO
36+
*/
3137
private $io;
3238

39+
/**
40+
* @var array
41+
*/
3342
private $options;
3443

44+
/**
45+
* @var array
46+
*/
3547
private $reports;
3648

49+
/**
50+
* @var bool
51+
*/
3752
private $skipCoverage;
3853

3954
public function __construct(ConsoleIO $io, CodeCoverage $coverage, array $reports, bool $skipCoverage = false)
@@ -65,19 +80,19 @@ public function afterExample(ExampleEvent $event): void
6580
public function afterSuite(SuiteEvent $event): void
6681
{
6782
if ($this->skipCoverage) {
68-
if ($this->io && $this->io->isVerbose()) {
83+
if ($this->io->isVerbose()) {
6984
$this->io->writeln('Skipping code coverage generation');
7085
}
7186

7287
return;
7388
}
7489

75-
if ($this->io && $this->io->isVerbose()) {
90+
if ($this->io->isVerbose()) {
7691
$this->io->writeln();
7792
}
7893

7994
foreach ($this->reports as $format => $report) {
80-
if ($this->io && $this->io->isVerbose()) {
95+
if ($this->io->isVerbose()) {
8196
$this->io->writeln(sprintf('Generating code coverage report in %s format ...', $format));
8297
}
8398

0 commit comments

Comments
 (0)