Skip to content

Commit f3c64e2

Browse files
committed
bug #224 Patch type declarations (Symfony 7.0) (smnandre)
This PR was merged into the 2.x branch. Discussion ---------- Patch type declarations (Symfony 7.0) Not 100% sure of what i'm doing there.. I try to resolve this : symfony/ux#1223 > PHP Fatal error: Declaration of Symfony\WebpackEncoreBundle\CacheWarmer\EntrypointCacheWarmer::doWarmUp($cacheDir, Symfony\Component\Cache\Adapter\ArrayAdapter $arrayAdapter): bool must be compatible with Symfony\Bundle\FrameworkBundle\CacheWarmer\AbstractPhpFileCacheWarmer::doWarmUp(string $cacheDir, Symfony\Component\Cache\Adapter\ArrayAdapter $arrayAdapter, ?string $buildDir = null): bool in /home/runner/work/ux/ux/src/Turbo/vendor/symfony/webpack-encore-bundle/src/CacheWarmer/EntrypointCacheWarmer.php on line 27 And i follow that : https://symfony.com/blog/symfony-7-0-type-declarations Commits ------- e842a13 Patch type declarations (Symfony 7.0 compatibility)
2 parents 50d4af5 + e842a13 commit f3c64e2

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/Asset/EntrypointLookup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function getIntegrityData(): array
6767
*
6868
* @return void
6969
*/
70-
public function reset()
70+
public function reset(): void
7171
{
7272
$this->returnedFiles = [];
7373
}

src/Asset/EntrypointLookupInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ public function getCssFiles(string $entryName): array;
2727
/**
2828
* Resets the state of this service.
2929
*/
30-
public function reset();
30+
public function reset(): void;
3131
}

src/Asset/TagRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function getDefaultAttributes(): array
139139
/**
140140
* @return void
141141
*/
142-
public function reset()
142+
public function reset(): void
143143
{
144144
$this->renderedFiles = [
145145
'scripts' => [],

src/CacheWarmer/EntrypointCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(array $cacheKeys, string $phpArrayFile)
2424
parent::__construct($phpArrayFile);
2525
}
2626

27-
protected function doWarmUp($cacheDir, ArrayAdapter $arrayAdapter): bool
27+
protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter, ?string $buildDir = null): bool
2828
{
2929
foreach ($this->cacheKeys as $cacheKey => $path) {
3030
// If the file does not exist then just skip past this entry point.

src/EventListener/ResetAssetsEventListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(EntrypointLookupCollection $entrypointLookupCollecti
2727
$this->buildNames = $buildNames;
2828
}
2929

30-
public static function getSubscribedEvents()
30+
public static function getSubscribedEvents(): array
3131
{
3232
return [
3333
KernelEvents::FINISH_REQUEST => 'resetAssets',
@@ -37,7 +37,7 @@ public static function getSubscribedEvents()
3737
/**
3838
* @return void
3939
*/
40-
public function resetAssets(FinishRequestEvent $event)
40+
public function resetAssets(FinishRequestEvent $event): void
4141
{
4242
if (!$event->isMainRequest()) {
4343
return;

0 commit comments

Comments
 (0)