Skip to content

Commit

Permalink
remove deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed May 3, 2024
1 parent a850861 commit 1afcc77
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 133 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;

final 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.

4 changes: 0 additions & 4 deletions tests/Functional/DependencyInjection/ServiceTest.php
Expand Up @@ -52,10 +52,6 @@ public function testCanBeLoaded()
if (strncmp('fos_http_cache.', $id, 15)) {
continue;
}
// skip deprecated service
if ('fos_http_cache.user_context.logout_handler' === $id) {
continue;
}
$this->assertIsObject($container->get($id));
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/DependencyInjection/FOSHttpCacheExtensionTest.php
Expand Up @@ -283,7 +283,7 @@ public function testEmptyConfig(): void
$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(): void
Expand Down Expand Up @@ -578,7 +578,7 @@ public function testConfigUserContext(): void
$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 @@ -608,7 +608,7 @@ public function testConfigWithoutUserContext(): void
$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 1afcc77

Please sign in to comment.