diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 5912978..f40a59a 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -142,24 +142,9 @@ private function setupServiceWorker(ArrayNodeDefinition $node): void ) ->example('//WIDGETS_PLACEHOLDER') ->end() - ->append( - $this->getUrlNode( - 'page_fallback', - 'The URL of the offline page fallback.' - ) - ) - ->append( - $this->getUrlNode( - 'image_fallback', - 'The URL of the offline image fallback.' - ) - ) - ->append( - $this->getUrlNode( - 'font_fallback', - 'The URL of the offline font fallback.' - ) - ) + ->append($this->getUrlNode('page_fallback', 'The URL of the offline page fallback.')) + ->append($this->getUrlNode('image_fallback', 'The URL of the offline image fallback.')) + ->append($this->getUrlNode('font_fallback', 'The URL of the offline font fallback.')) ->scalarNode('image_regex') ->defaultValue('/\.(ico|png|jpe?g|gif|svg|webp|bmp)$/') ->info('The regex to match the images.') @@ -172,7 +157,9 @@ private function setupServiceWorker(ArrayNodeDefinition $node): void ->end() ->integerNode('network_timeout_seconds') ->defaultValue(3) - ->info('The network timeout in seconds before cache is called (for warm cache URLs only).') + ->info( + 'The network timeout in seconds before cache is called (for warm cache URLs only).' + ) ->example([1, 2, 5]) ->end() ->arrayNode('warm_cache_urls') diff --git a/src/Dto/Asset.php b/src/Dto/Asset.php index 6d7a1be..d24f9ac 100644 --- a/src/Dto/Asset.php +++ b/src/Dto/Asset.php @@ -6,8 +6,9 @@ final class Asset { - public function __construct(public string $src) - { + public function __construct( + public string $src + ) { } public static function create(string $data): self diff --git a/src/Dto/Workbox.php b/src/Dto/Workbox.php index efa4d2d..a908b43 100644 --- a/src/Dto/Workbox.php +++ b/src/Dto/Workbox.php @@ -44,8 +44,10 @@ final class Workbox */ #[SerializedName('warm_cache_urls')] public array $warmCacheUrls = []; + #[SerializedName('network_timeout_seconds')] public int $networkTimeoutSeconds = 3; + #[SerializedName('max_image_cache_entries')] public int $maxImageCacheEntries = 60; diff --git a/src/Normalizer/AssetNormalizer.php b/src/Normalizer/AssetNormalizer.php index e93d538..e73d55a 100644 --- a/src/Normalizer/AssetNormalizer.php +++ b/src/Normalizer/AssetNormalizer.php @@ -49,8 +49,12 @@ public function supportsNormalization(mixed $data, string $format = null, array return $data instanceof Asset; } - public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool - { + public function supportsDenormalization( + mixed $data, + string $type, + string $format = null, + array $context = [] + ): bool { return $type === Asset::class; }