Skip to content

Commit

Permalink
style: php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Kocal committed Oct 1, 2024
1 parent 2025c41 commit 707cd49
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Asset/TagRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function renderWebpackScriptTags(string $entryName, ?string $packageName
$this->convertArrayToAttributes($attributes)
);

$this->renderedFiles['scripts'][] = $attributes["src"];
$this->renderedFiles['scripts'][] = $attributes['src'];
$this->renderedFilesWithAttributes['scripts'][] = $attributes;
}

Expand Down Expand Up @@ -119,7 +119,7 @@ public function renderWebpackLinkTags(string $entryName, ?string $packageName =
$this->convertArrayToAttributes($attributes)
);

$this->renderedFiles['styles'][] = $attributes["href"];
$this->renderedFiles['styles'][] = $attributes['href'];
$this->renderedFilesWithAttributes['styles'][] = $attributes;
}

Expand Down
4 changes: 2 additions & 2 deletions src/EventListener/PreLoadAssetsEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function onKernelResponse(ResponseEvent $event): void
foreach ($this->tagRenderer->getRenderedScriptsWithAttributes() as $attributes) {
$attributes = array_merge($defaultAttributes, $attributes);

$link = ($this->createLink('preload', $attributes['src']))->withAttribute('as', 'script');
$link = $this->createLink('preload', $attributes['src'])->withAttribute('as', 'script');

if (!empty($attributes['crossorigin']) && false !== $attributes['crossorigin']) {
$link = $link->withAttribute('crossorigin', $attributes['crossorigin']);
Expand All @@ -67,7 +67,7 @@ public function onKernelResponse(ResponseEvent $event): void
foreach ($this->tagRenderer->getRenderedStylesWithAttributes() as $attributes) {
$attributes = array_merge($defaultAttributes, $attributes);

$link = ($this->createLink('preload', $attributes['href']))->withAttribute('as', 'style');
$link = $this->createLink('preload', $attributes['href'])->withAttribute('as', 'style');

if (!empty($attributes['crossorigin']) && false !== $attributes['crossorigin']) {
$link = $link->withAttribute('crossorigin', $attributes['crossorigin']);
Expand Down
1 change: 0 additions & 1 deletion tests/Asset/TagRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ public function testGetRenderedFilesAndReset()
],
], $renderer->getRenderedStylesWithAttributes());


$renderer->reset();
$this->assertEmpty($renderer->getRenderedScripts());
$this->assertEmpty($renderer->getRenderedStyles());
Expand Down

0 comments on commit 707cd49

Please sign in to comment.