Skip to content

Commit 9cfb9cc

Browse files
committed
Chore: Improvements
- Added default attribute properties to constructor in TagRenderer class; - Small fixes for psalm; Signed-off-by: Oleksii Bulba <[email protected]>
1 parent ed51951 commit 9cfb9cc

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/Asset/EntrypointLookup.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ public function entryExists(string $entryName): bool
5252
return isset($entriesData['entrypoints'][$entryName]);
5353
}
5454

55+
/**
56+
* @psalm-return array<string>
57+
*/
5558
private function getEntryFiles(string $entryName, string $key): array
5659
{
5760
$this->validateEntryName($entryName);

src/TagRenderer/TagRenderer.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515

1616
class TagRenderer implements TagRendererInterface
1717
{
18-
private array $defaultAttributes = [];
19-
private array $defaultScriptAttributes = [
20-
'type' => 'application/javascript',
21-
];
22-
private array $defaultLinkAttributes = [];
23-
24-
public function __construct(private readonly EntrypointLookupInterface $entrypointLookup)
25-
{
18+
public function __construct(
19+
private readonly EntrypointLookupInterface $entrypointLookup,
20+
private readonly array $defaultAttributes = [],
21+
private readonly array $defaultScriptAttributes = ['type' => 'application/javascript'],
22+
private readonly array $defaultLinkAttributes = []
23+
) {
2624
}
2725

2826
public function renderWebpackScriptTags(string $entryName, array $extraAttributes = []): string

0 commit comments

Comments
 (0)