Skip to content

Commit

Permalink
[BUGFIX] Ignore phpstan error
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbelasichon committed Apr 10, 2021
1 parent d5897a7 commit b4b9ed4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function testGetRectorClassWithChangelogUrl(): void
1
);
$this->assertSame(
'Rector\Tests\ChangesReporting\ValueObject\Source\RectorWithLink (https://github.com/rectorphp/rector/blob/master/docs/rector_rules_overview.md)',
'"Rector\Tests\ChangesReporting\ValueObject\Source\RectorWithLink" ("https://github.com/rectorphp/rector/blob/master/docs/rector_rules_overview.md")',
$rectorWithFileAndLineChange->getRectorClassWithChangelogUrl()
);
}
Expand Down
9 changes: 9 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -572,3 +572,12 @@ parameters:

# known types
- '#Parameter (.*?) expects PhpParser\\Node, PhpParser\\Node\|null given#'

-
message: '#Instead of "ReflectionClass" class/interface use "PHPStan\\Reflection\\ClassReflection"#'
paths:
- packages/ChangesReporting/ValueObject/RectorWithFileAndLineChange.php
-
message: '#"%s" in sprintf\(\) format must be quoted#'
paths:
- packages/ChangesReporting/ValueObject/RectorWithFileAndLineChange.php
4 changes: 2 additions & 2 deletions src/ValueObject/Reporting/FileDiff.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public function getRectorClasses(bool $outputChangelogUrl): array
$rectorClasses = [];
foreach ($this->rectorWithFileAndLineChanges as $rectorWithFileAndLineChange) {
if ($outputChangelogUrl) {
$rectorClasses[] = $rectorWithFileAndLineChange->getRectorClass();
} else {
$rectorClasses[] = $rectorWithFileAndLineChange->getRectorClassWithChangelogUrl();
} else {
$rectorClasses[] = $rectorWithFileAndLineChange->getRectorClass();
}
}

Expand Down

0 comments on commit b4b9ed4

Please sign in to comment.