Skip to content

Fix several deprecation notices #581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Configuration/InvalidatePath.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ public function getPaths()
/**
* {@inheritdoc}
*/
public function getAliasName()
public function getAliasName(): string
{
return 'invalidate_path';
}

/**
* {@inheritdoc}
*/
public function allowArray()
public function allowArray(): bool
{
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/InvalidateRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ public function getParams()
/**
* {@inheritdoc}
*/
public function getAliasName()
public function getAliasName(): string
{
return 'invalidate_route';
}

/**
* {@inheritdoc}
*/
public function allowArray()
public function allowArray(): bool
{
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ public function getTags()
/**
* {@inheritdoc}
*/
public function getAliasName()
public function getAliasName(): string
{
return 'tag';
}

/**
* {@inheritdoc}
*/
public function allowArray()
public function allowArray(): bool
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct($debug)
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('fos_http_cache');

Expand Down
3 changes: 2 additions & 1 deletion src/DependencyInjection/FOSHttpCacheExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use FOS\HttpCache\TagHeaderFormatter\MaxHeaderValueLengthFormatter;
use FOS\HttpCacheBundle\DependencyInjection\Compiler\HashGeneratorPass;
use FOS\HttpCacheBundle\Http\ResponseMatcher\ExpressionResponseMatcher;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Console\Application;
Expand All @@ -37,7 +38,7 @@ class FOSHttpCacheExtension extends Extension
/**
* {@inheritdoc}
*/
public function getConfiguration(array $config, ContainerBuilder $container)
public function getConfiguration(array $config, ContainerBuilder $container): ConfigurationInterface
{
return new Configuration($container->getParameter('kernel.debug'));
}
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/CacheControlListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function __construct($debugHeader = false)
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
KernelEvents::RESPONSE => ['onKernelResponse', 10],
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/FlashMessageListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function __construct($session, array $options = [])
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
KernelEvents::RESPONSE => 'onKernelResponse',
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/InvalidationListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function onConsoleTerminate(ConsoleEvent $event)
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
KernelEvents::TERMINATE => 'onKernelTerminate',
Expand Down
5 changes: 4 additions & 1 deletion src/EventListener/Php8AttributesListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ public function onKernelRequest(AttributeRequestEvent $event)
}
}

public static function getSubscribedEvents()
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents(): array
{
return [
KernelEvents::REQUEST => 'onKernelRequest',
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/TagListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function onKernelResponse(TagResponseEvent $event)
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
KernelEvents::RESPONSE => 'onKernelResponse',
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/UserContextListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function onKernelResponse(UserContextResponseEvent $event)
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
KernelEvents::RESPONSE => 'onKernelResponse',
Expand Down
7 changes: 2 additions & 5 deletions src/Twig/CacheTagExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(ResponseTagger $responseTagger)
/**
* {@inheritdoc}
*/
public function getFunctions()
public function getFunctions(): array
{
return [
new TwigFunction('fos_httpcache_tag', [$this, 'addTag']),
Expand All @@ -55,10 +55,7 @@ public function addTag($tag)
$this->responseTagger->addTags((array) $tag);
}

/**
* {@inheritdoc}
*/
public function getName()
public function getName(): string
{
return 'fos_httpcache_tag_extension';
}
Expand Down