From e842a1304f2b0298b04417fdd6104345aa785c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Sun, 22 Oct 2023 17:16:41 +0200 Subject: [PATCH] Patch type declarations (Symfony 7.0 compatibility) --- src/Asset/EntrypointLookup.php | 2 +- src/Asset/EntrypointLookupInterface.php | 2 +- src/Asset/TagRenderer.php | 2 +- src/CacheWarmer/EntrypointCacheWarmer.php | 2 +- src/EventListener/ResetAssetsEventListener.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Asset/EntrypointLookup.php b/src/Asset/EntrypointLookup.php index 2a4e120d..32e8d7c2 100644 --- a/src/Asset/EntrypointLookup.php +++ b/src/Asset/EntrypointLookup.php @@ -67,7 +67,7 @@ public function getIntegrityData(): array * * @return void */ - public function reset() + public function reset(): void { $this->returnedFiles = []; } diff --git a/src/Asset/EntrypointLookupInterface.php b/src/Asset/EntrypointLookupInterface.php index 9445b84d..9fac3f73 100644 --- a/src/Asset/EntrypointLookupInterface.php +++ b/src/Asset/EntrypointLookupInterface.php @@ -27,5 +27,5 @@ public function getCssFiles(string $entryName): array; /** * Resets the state of this service. */ - public function reset(); + public function reset(): void; } diff --git a/src/Asset/TagRenderer.php b/src/Asset/TagRenderer.php index 6faaa417..75c3e7ed 100644 --- a/src/Asset/TagRenderer.php +++ b/src/Asset/TagRenderer.php @@ -139,7 +139,7 @@ public function getDefaultAttributes(): array /** * @return void */ - public function reset() + public function reset(): void { $this->renderedFiles = [ 'scripts' => [], diff --git a/src/CacheWarmer/EntrypointCacheWarmer.php b/src/CacheWarmer/EntrypointCacheWarmer.php index 9c5f9cb0..c1156a14 100644 --- a/src/CacheWarmer/EntrypointCacheWarmer.php +++ b/src/CacheWarmer/EntrypointCacheWarmer.php @@ -24,7 +24,7 @@ public function __construct(array $cacheKeys, string $phpArrayFile) parent::__construct($phpArrayFile); } - protected function doWarmUp($cacheDir, ArrayAdapter $arrayAdapter): bool + protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter, ?string $buildDir = null): bool { foreach ($this->cacheKeys as $cacheKey => $path) { // If the file does not exist then just skip past this entry point. diff --git a/src/EventListener/ResetAssetsEventListener.php b/src/EventListener/ResetAssetsEventListener.php index a39482c6..10f748f9 100644 --- a/src/EventListener/ResetAssetsEventListener.php +++ b/src/EventListener/ResetAssetsEventListener.php @@ -27,7 +27,7 @@ public function __construct(EntrypointLookupCollection $entrypointLookupCollecti $this->buildNames = $buildNames; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ KernelEvents::FINISH_REQUEST => 'resetAssets', @@ -37,7 +37,7 @@ public static function getSubscribedEvents() /** * @return void */ - public function resetAssets(FinishRequestEvent $event) + public function resetAssets(FinishRequestEvent $event): void { if (!$event->isMainRequest()) { return;