From ac1903f7f44b4085787554ad0cec01ee54eba2d9 Mon Sep 17 00:00:00 2001 From: Wilmer Arambula Date: Tue, 25 Aug 2026 17:37:26 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Asset/AssetCollection.php | 4 ++-- src/Html/HtmlRenderer.php | 2 +- src/Resolver/ManifestAssetResolver.php | 2 +- tests/ManifestChunkTest.php | 6 +++--- tests/ViteProductionTest.php | 1 - 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Asset/AssetCollection.php b/src/Asset/AssetCollection.php index 4117ef1..f33c7b7 100644 --- a/src/Asset/AssetCollection.php +++ b/src/Asset/AssetCollection.php @@ -76,7 +76,7 @@ public function all(): array * * @return AssetCollection A new collection holding both sequences. */ - public function append(AssetInterface ...$assets): AssetCollection + public function append(AssetInterface ...$assets): self { return new self([...$this->assets, ...$assets]); } @@ -166,7 +166,7 @@ public function moduleScripts(): array * * @return AssetCollection A new collection holding both sequences. */ - public function prepend(AssetInterface ...$assets): AssetCollection + public function prepend(AssetInterface ...$assets): self { return new self([...$assets, ...$this->assets]); } diff --git a/src/Html/HtmlRenderer.php b/src/Html/HtmlRenderer.php index 7e1fe70..8460846 100644 --- a/src/Html/HtmlRenderer.php +++ b/src/Html/HtmlRenderer.php @@ -82,7 +82,7 @@ public function render(AssetCollection $assets, HtmlRenderOptions|null $options private function attributesFor(AssetInterface $asset, HtmlRenderOptions $options): array { $attributes = []; - + $nonce = $options->nonce(); if ($nonce !== null) { diff --git a/src/Resolver/ManifestAssetResolver.php b/src/Resolver/ManifestAssetResolver.php index 6474c53..257994f 100644 --- a/src/Resolver/ManifestAssetResolver.php +++ b/src/Resolver/ManifestAssetResolver.php @@ -196,7 +196,7 @@ private function importedChunks(Manifest $manifest, ManifestChunk $chunk, array * @param array $scripts Module scripts keyed by asset URL. * @param array $preloads Module-preload hints keyed by asset URL. * - * @return iterable Generator yielding stylesheets, then scripts, then + * @return iterable Generator yielding stylesheets, then scripts, then * preloads. */ private function orderedAssets(array $stylesheets, array $scripts, array $preloads): iterable diff --git a/tests/ManifestChunkTest.php b/tests/ManifestChunkTest.php index 351d5b6..b509cef 100644 --- a/tests/ManifestChunkTest.php +++ b/tests/ManifestChunkTest.php @@ -135,15 +135,15 @@ public function testWithMethodsCanResetEveryOptionalValue(): void self::assertSame( 'resources/app.js', $configured->src(), - "Resetting must not mutate the configured source path.", + 'Resetting must not mutate the configured source path.', ); self::assertTrue( $configured->isEntry(), - "Resetting must not mutate the configured entrypoint flag.", + 'Resetting must not mutate the configured entrypoint flag.', ); self::assertTrue( $configured->isDynamicEntry(), - "Resetting must not mutate the configured dynamic entrypoint flag.", + 'Resetting must not mutate the configured dynamic entrypoint flag.', ); } diff --git a/tests/ViteProductionTest.php b/tests/ViteProductionTest.php index b08a84f..b0fc1b7 100644 --- a/tests/ViteProductionTest.php +++ b/tests/ViteProductionTest.php @@ -124,7 +124,6 @@ public function testEntrypointsWithSameOutputFileAreDeduplicated(): void ); } - public function testImportedCssChunkIsRenderedAndNotPreloaded(): void { $assets = $this->vite('css-chunk-import-manifest.json', ['resources/js/app.js'])->resolve();