Skip to content

Commit

Permalink
Fix copyright lines
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfelles committed Oct 2, 2023
1 parent 6b6e874 commit 0167dbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ public function setDefaultHeaderComment(
string $packageName,
array | string $copyright = []
) : static {
if ($copyright === '') {
$copyright = [];
}
$copyright = (array) $copyright;
$copyrightLines = "\n";
if ($copyright) {
Expand Down
5 changes: 5 additions & 0 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public function testDefaultHeaderComment() : void
$header = $this->config->getRules()['header_comment']['header'];
self::assertStringContainsString('Foo Bar', $header);
self::assertStringNotContainsString('(c)', $header);
$this->config->setDefaultHeaderComment('Foo Bar', '');
// @phpstan-ignore-next-line
$header = $this->config->getRules()['header_comment']['header'];
self::assertStringContainsString('Foo Bar', $header);
self::assertStringNotContainsString('(c)', $header);
$this->config->setDefaultHeaderComment('Bazz', 'Acme');
// @phpstan-ignore-next-line
$header = $this->config->getRules()['header_comment']['header'];
Expand Down

0 comments on commit 0167dbb

Please sign in to comment.