File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -319,11 +319,15 @@ public function setHeaderComment(string $header) : static
319319
320320 public function setDefaultHeaderComment (
321321 string $ packageName ,
322- string $ copyright = ''
322+ array | string $ copyright = []
323323 ) : static {
324+ $ copyright = (array ) $ copyright ;
324325 $ copyrightLines = "\n" ;
325326 if ($ copyright ) {
326- $ copyrightLines .= "\n" . '(c) ' . $ copyright . "\n" ;
327+ $ copyrightLines .= "\n" ;
328+ foreach ($ copyright as $ cr ) {
329+ $ copyrightLines .= '(c) ' . $ cr . "\n" ;
330+ }
327331 }
328332 $ header = <<<EOF
329333 This file is part of {$ packageName }. {$ copyrightLines }
Original file line number Diff line number Diff line change @@ -54,5 +54,11 @@ public function testDefaultHeaderComment() : void
5454 $ header = $ this ->config ->getRules ()['header_comment ' ]['header ' ];
5555 self ::assertStringContainsString ('Bazz ' , $ header );
5656 self ::assertStringContainsString ('(c) Acme ' , $ header );
57+ $ this ->config ->setDefaultHeaderComment ('Bazz ' , ['Acme ' , 'OK ' ]);
58+ // @phpstan-ignore-next-line
59+ $ header = $ this ->config ->getRules ()['header_comment ' ]['header ' ];
60+ self ::assertStringContainsString ('Bazz ' , $ header );
61+ self ::assertStringContainsString ('(c) Acme ' , $ header );
62+ self ::assertStringContainsString ('(c) OK ' , $ header );
5763 }
5864}
You can’t perform that action at this time.
0 commit comments