Skip to content

Commit

Permalink
bug #58950 [FrameworkBundle] Revert " Deprecate making cache.app ad…
Browse files Browse the repository at this point in the history
…apter taggable" (keulinho)

This PR was merged into the 7.2 branch.

Discussion
----------

[FrameworkBundle] Revert " Deprecate making `cache.app` adapter taggable"

This reverts commit eed5b284618ec95eedbc376fb140b8fc24619372.

| Q             | A
| ------------- | ---
| Branch?       | 7.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix symfony/symfony#58790
| License       | MIT

As discussed in former PR the deprecation was wrong, and trying to solve the deprecation will lead in errors.
Refer to symfony/symfony#58830 for detailed analysis.

[according to the creator](symfony/symfony#58830 (comment)) of the original issue the behaviour that is making problems is actually covered by tests, so I'm not sure how to proceed, but the deprecation is clearly wrong and should not make it to 7.2!

Commits
-------

25f0925d9d2 Revert "[FrameworkBundle] Deprecate making `cache.app` adapter taggable"
  • Loading branch information
nicolas-grekas committed Nov 20, 2024
2 parents eca6e49 + 98aa662 commit a8d0da4
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 60 deletions.
5 changes: 0 additions & 5 deletions DependencyInjection/FrameworkExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2398,11 +2398,6 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
];
}
foreach ($config['pools'] as $name => $pool) {
if (\in_array('cache.app', $pool['adapters'] ?? [], true) && $pool['tags']) {
trigger_deprecation('symfony/framework-bundle', '7.2', 'Using the "tags" option with the "cache.app" adapter is deprecated. You can use the "cache.app.taggable" adapter instead (aliased to the TagAwareCacheInterface for autowiring).');
// throw new LogicException('The "tags" option cannot be used with the "cache.app" adapter. You can use the "cache.app.taggable" adapter instead (aliased to the TagAwareCacheInterface for autowiring).');
}

$pool['adapters'] = $pool['adapters'] ?: ['cache.app'];

$isRedisTagAware = ['cache.adapter.redis_tag_aware'] === $pool['adapters'];
Expand Down
16 changes: 0 additions & 16 deletions Tests/DependencyInjection/Fixtures/php/cache_cacheapp_tagaware.php

This file was deleted.

15 changes: 0 additions & 15 deletions Tests/DependencyInjection/Fixtures/xml/cache_cacheapp_tagaware.xml

This file was deleted.

11 changes: 0 additions & 11 deletions Tests/DependencyInjection/Fixtures/yml/cache_cacheapp_tagaware.yml

This file was deleted.

13 changes: 0 additions & 13 deletions Tests/DependencyInjection/FrameworkExtensionTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Psr\Cache\CacheItemPoolInterface;
use Psr\Log\LoggerAwareInterface;
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyMessage;
Expand Down Expand Up @@ -96,8 +95,6 @@

abstract class FrameworkExtensionTestCase extends TestCase
{
use ExpectUserDeprecationMessageTrait;

private static array $containerCache = [];

abstract protected function loadFromFile(ContainerBuilder $container, $file);
Expand Down Expand Up @@ -1856,16 +1853,6 @@ public function testCacheTaggableTagAppliedToPools()
}
}

/**
* @group legacy
*/
public function testTaggableCacheAppIsDeprecated()
{
$this->expectUserDeprecationMessage('Since symfony/framework-bundle 7.2: Using the "tags" option with the "cache.app" adapter is deprecated. You can use the "cache.app.taggable" adapter instead (aliased to the TagAwareCacheInterface for autowiring).');

$this->createContainerFromFile('cache_cacheapp_tagaware');
}

/**
* @dataProvider appRedisTagAwareConfigProvider
*/
Expand Down

0 comments on commit a8d0da4

Please sign in to comment.