8000 minor #51241 [FrameworkBundle] Remove obsolete feature detection from… · l-vo/symfony@3c9bf28 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c9bf28

Browse files
minor symfony#51241 [FrameworkBundle] Remove obsolete feature detection from cache warmers (derrabus)
This PR was merged into the 6.4 branch. Discussion ---------- [FrameworkBundle] Remove obsolete feature detection from cache warmers | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A The features that those cache warmer access have existed 8000 since Symfony 4 or earlier. Let's remove the detection logic. Commits ------- fc3a0ca [FrameworkBundle] Remove obsolete feature detection from cache warmers
2 parents cf3f52a + fc3a0ca commit 3c9bf28

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/SerializerCacheWarmer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public function __construct(array $loaders, string $phpArrayFile)
4141

4242
protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter): bool
4343
{
44-
if (!class_exists(CacheClassMetadataFactory::class) || !method_exists(XmlFileLoader::class, 'getMappedClasses') || !method_exists(YamlFileLoader::class, 'getMappedClasses')) {
45-
return false;
44+
if (!$this->loaders) {
45+
return true;
4646
}
4747

4848
$metadataFactory = new CacheClassMetadataFactory(new ClassMetadataFactory(new LoaderChain($this->loaders)), $arrayAdapter);

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ValidatorCacheWarmer.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ public function __construct(ValidatorBuilder $validatorBuilder, string $phpArray
4141

4242
protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter): bool
4343
{
44-
if (!method_exists($this->validatorBuilder, 'getLoaders')) {
45-
return false;
46-
}
47-
4844
$loaders = $this->validatorBuilder->getLoaders();
4945
$metadataFactory = new LazyLoadingMetadataFactory(new LoaderChain($loaders), $arrayAdapter);
5046

0 commit comments

Comments
 (0)
0