diff --git a/src/Service/FaviconsCompiler.php b/src/Service/FaviconsCompiler.php index b5c4e10..6c2dbbb 100644 --- a/src/Service/FaviconsCompiler.php +++ b/src/Service/FaviconsCompiler.php @@ -32,7 +32,7 @@ public function __construct( } /** - * @return iterable + * @return iterable */ public function getFiles(): iterable { @@ -234,14 +234,15 @@ public function getFiles(): iterable ); $completeHash = hash('xxh128', $hash . $configuration); $filename = sprintf($size['url'], $size['width'], $size['height'], $completeHash); - yield $this->processIcon($asset, $filename, $configuration, $size['mimetype'], $size['rel']); + yield $filename => $this->processIcon($asset, $filename, $configuration, $size['mimetype'], $size['rel']); } if ($this->favicons->tileColor !== null) { $this->logger->debug('Creating browserconfig.xml.'); yield from $this->processBrowserConfig($asset, $hash); } if ($this->favicons->safariPinnedTabColor !== null && $this->favicons->useSilhouette === true) { - yield $this->generateSafariPinnedTab($asset, $hash); + $safariPinnedTab = $this->generateSafariPinnedTab($asset, $hash); + yield $safariPinnedTab->url => $safariPinnedTab; } $this->logger->debug('Favicons created.'); } @@ -400,17 +401,17 @@ private function processBrowserConfig(string $asset, string $hash): array ); return [ - $icon70x70, - $icon150x150, - $icon310x310, - $icon310x150, - Data::create( + $icon70x70->url => $icon70x70, + $icon150x150->url => $icon150x150, + $icon310x310->url => $icon310x310, + $icon310x150->url => $icon310x150, + $icon144x144->url => Data::create( $icon144x144->url, $icon144x144->getRawData(), $icon144x144->headers, sprintf('', $icon144x144->url) ), - $browserConfig, + $browserConfig->url => $browserConfig, ]; } diff --git a/src/Service/FileCompilerInterface.php b/src/Service/FileCompilerInterface.php index a119a53..bd88c1b 100644 --- a/src/Service/FileCompilerInterface.php +++ b/src/Service/FileCompilerInterface.php @@ -7,7 +7,7 @@ interface FileCompilerInterface { /** - * @return iterable + * @return iterable */ public function getFiles(): iterable; } diff --git a/src/Service/ManifestCompiler.php b/src/Service/ManifestCompiler.php index 021e903..6cb56d2 100644 --- a/src/Service/ManifestCompiler.php +++ b/src/Service/ManifestCompiler.php @@ -66,7 +66,7 @@ public function __construct( } /** - * @return iterable + * @return iterable */ public function getFiles(): iterable { @@ -81,13 +81,15 @@ public function getFiles(): iterable } if ($this->locales === []) { $this->logger->debug('No locale defined. Compiling default manifest.'); - yield $this->compileManifest(null); + $manifest = $this->compileManifest(null); + yield $manifest->url => $manifest; } foreach ($this->locales as $locale) { $this->logger->debug('Compiling manifest for locale.', [ 'locale' => $locale, ]); - yield $this->compileManifest($locale); + $manifest = $this->compileManifest($locale); + yield $manifest->url => $manifest; } $this->logger->debug('Manifest files compiled.'); } diff --git a/src/Service/ServiceWorkerCompiler.php b/src/Service/ServiceWorkerCompiler.php index 9ffacb2..1509872 100644 --- a/src/Service/ServiceWorkerCompiler.php +++ b/src/Service/ServiceWorkerCompiler.php @@ -53,11 +53,12 @@ public function __construct( } /** - * @return iterable + * @return iterable */ public function getFiles(): iterable { - yield $this->compileSW(); + $sw = $this->compileSW(); + yield $sw->url => $sw; yield from $this->getWorkboxFiles(); } @@ -118,7 +119,7 @@ private function includeRootSW(): string } /** - * @return iterable + * @return iterable */ private function getWorkboxFiles(): iterable { @@ -150,7 +151,7 @@ private function getWorkboxFiles(): iterable if ($data === null) { continue; } - yield $data; + yield $data->url => $data; } }