From 520d6a3cd76e1c4fe4328fa86a91a502cbf68c7a Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Wed, 12 Dec 2018 11:51:07 +0100 Subject: [PATCH] fix method type signature --- src/Cache/BlockJsCache.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Cache/BlockJsCache.php b/src/Cache/BlockJsCache.php index 3ce9d558..1387d988 100644 --- a/src/Cache/BlockJsCache.php +++ b/src/Cache/BlockJsCache.php @@ -16,6 +16,7 @@ use Sonata\BlockBundle\Block\BlockRendererInterface; use Sonata\Cache\CacheAdapterInterface; use Sonata\Cache\CacheElement; +use Sonata\Cache\CacheElementInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\RouterInterface; @@ -59,7 +60,7 @@ public function __construct( /** * {@inheritdoc} */ - public function flushAll() + public function flushAll(): bool { return true; } @@ -67,7 +68,7 @@ public function flushAll() /** * {@inheritdoc} */ - public function flush(array $keys = []) + public function flush(array $keys = []): bool { return true; } @@ -75,7 +76,7 @@ public function flush(array $keys = []) /** * {@inheritdoc} */ - public function has(array $keys) + public function has(array $keys): bool { return true; } @@ -83,7 +84,7 @@ public function has(array $keys) /** * {@inheritdoc} */ - public function get(array $keys) + public function get(array $keys): CacheElementInterface { $this->validateKeys($keys); @@ -151,7 +152,7 @@ protected function getSync(array $keys) CONTENT -, $dashifiedId, $dashifiedId, $this->router->generate('cmf_block_js_sync_cache', $keys, true)); + , $dashifiedId, $dashifiedId, $this->router->generate('cmf_block_js_sync_cache', $keys, true)); } /** @@ -179,13 +180,13 @@ protected function getAsync(array $keys) CONTENT -, $this->dashify($keys['block_id']), $this->router->generate('cmf_block_js_async_cache', $keys, true)); + , $this->dashify($keys['block_id']), $this->router->generate('cmf_block_js_async_cache', $keys, true)); } /** * {@inheritdoc} */ - public function set(array $keys, $data, $ttl = 84600, array $contextualKeys = []) + public function set(array $keys, $data, $ttl = 84600, array $contextualKeys = []): CacheElementInterface { $this->validateKeys($keys); @@ -209,9 +210,9 @@ public function cacheAction(Request $request) if (!is_array($settings)) { throw new \RuntimeException(sprintf( - 'Query string parameter `%s` is not an array', - BlockContextManagerInterface::CACHE_KEY - )); + 'Query string parameter `%s` is not an array', + BlockContextManagerInterface::CACHE_KEY + )); } $response = $this->blockRenderer->render( @@ -245,7 +246,7 @@ public function cacheAction(Request $request) } })(); JS -, $this->dashify($block->getId()), json_encode($response->getContent()))); + , $this->dashify($block->getId()), json_encode($response->getContent()))); $response->headers->set('Content-Type', 'application/javascript'); @@ -255,7 +256,7 @@ public function cacheAction(Request $request) /** * {@inheritdoc} */ - public function isContextual() + public function isContextual(): bool { return false; }