Skip to content

Commit

Permalink
remove deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Mar 28, 2024
1 parent 49c8832 commit 8504e5e
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 129 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/php.yml
Expand Up @@ -21,12 +21,12 @@ jobs:
dependencies: 'jean-beru/fos-http-cache-cloudfront'
- php-version: '8.1'
symfony-version: '6.4'
- php-version: '8.2'
symfony-version: '6.4'
- php-version: '8.2'
symfony-version: '7.*'
- php-version: '8.3'
symfony-version: '7.*'
- php-version: '8.2'
symfony-version: '6.4'
# Minimum supported dependencies with the oldest PHP version
- php-version: '8.1'
composer-flag: '--prefer-stable --prefer-lowest'
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,9 @@ Changelog
Remove all configuration you have at `fos_http_cache.tags.annotations`
* Make `fastly` and `cloudflare` clients lazy loaded to support Symfony secrets that are only available at runtime, but
not yet when the container is built.
* Removed deprecated `FOS\HttpCacheBundle\UserContext\AnonymousRequestMatcher`, use the
`FOS\HttpCache\UserContext\AnonymousRequestMatcher` class.
* Removed deprecated `ContextInvalidationLogoutHandler`, use `ContextInvalidationSessionLogoutHandle` instead.

2.x
===
Expand Down
7 changes: 0 additions & 7 deletions src/DependencyInjection/FOSHttpCacheExtension.php
Expand Up @@ -28,7 +28,6 @@
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

class FOSHttpCacheExtension extends Extension
Expand Down Expand Up @@ -281,12 +280,6 @@ private function loadUserContext(ContainerBuilder $container, XmlFileLoader $loa
}

$loader->load('user_context.xml');
// TODO: Remove this service file when going to version 3 of the bundle
if (Kernel::MAJOR_VERSION >= 6) {
$loader->load('user_context_legacy_sf6.xml');
} else {
$loader->load('user_context_legacy.xml');
}

$container->getDefinition('fos_http_cache.user_context.request_matcher')
->replaceArgument(0, $config['match']['accept'])
Expand Down
13 changes: 0 additions & 13 deletions src/Resources/config/user_context_legacy.xml

This file was deleted.

13 changes: 0 additions & 13 deletions src/Resources/config/user_context_legacy_sf6.xml

This file was deleted.

51 changes: 0 additions & 51 deletions src/Security/Http/Logout/ContextInvalidationLogoutHandler.php

This file was deleted.

40 changes: 0 additions & 40 deletions src/UserContext/AnonymousRequestMatcher.php

This file was deleted.

6 changes: 3 additions & 3 deletions tests/Unit/DependencyInjection/FOSHttpCacheExtensionTest.php
Expand Up @@ -285,7 +285,7 @@ public function testEmptyConfig()
$container = $this->createContainer();
$this->extension->load([$config], $container);

$this->assertFalse($container->has('fos_http_cache.user_context.logout_handler'));
$this->assertFalse($container->has('fos_http_cache.user_context.session_logout_handler'));
}

public function testConfigTagNotSupported()
Expand Down Expand Up @@ -580,7 +580,7 @@ public function testConfigUserContext()
$this->assertTrue($container->has('fos_http_cache.user_context.hash_generator'));
$this->assertTrue($container->has('fos_http_cache.user_context.request_matcher'));
$this->assertTrue($container->has('fos_http_cache.user_context.role_provider'));
$this->assertTrue($container->has('fos_http_cache.user_context.logout_handler'));
$this->assertTrue($container->has('fos_http_cache.user_context.session_logout_handler'));

$this->assertEquals(['fos_http_cache.user_context.role_provider' => [[]]], $container->findTaggedServiceIds('fos_http_cache.user_context_provider'));
}
Expand Down Expand Up @@ -610,7 +610,7 @@ public function testConfigWithoutUserContext()
$this->assertFalse($container->has('fos_http_cache.user_context.hash_generator'));
$this->assertFalse($container->has('fos_http_cache.user_context.request_matcher'));
$this->assertFalse($container->has('fos_http_cache.user_context.role_provider'));
$this->assertFalse($container->has('fos_http_cache.user_context.logout_handler'));
$this->assertFalse($container->has('fos_http_cache.user_context.session_logout_handler'));
$this->assertFalse($container->has('fos_http_cache.user_context.session_listener'));
}

Expand Down

0 comments on commit 8504e5e

Please sign in to comment.