Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

fix method type signature #293

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
25 changes: 13 additions & 12 deletions src/Cache/BlockJsCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -59,31 +60,31 @@ public function __construct(
/**
* {@inheritdoc}
*/
public function flushAll()
public function flushAll(): bool
{
return true;
}

/**
* {@inheritdoc}
*/
public function flush(array $keys = [])
public function flush(array $keys = []): bool
{
return true;
}

/**
* {@inheritdoc}
*/
public function has(array $keys)
public function has(array $keys): bool
{
return true;
}

/**
* {@inheritdoc}
*/
public function get(array $keys)
public function get(array $keys): CacheElementInterface
{
$this->validateKeys($keys);

Expand Down Expand Up @@ -151,7 +152,7 @@ protected function getSync(array $keys)
</script>
</div>
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));
}

/**
Expand Down Expand Up @@ -179,13 +180,13 @@ protected function getAsync(array $keys)
</script>
</div>
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);

Expand All @@ -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(
Expand Down Expand Up @@ -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');

Expand All @@ -255,7 +256,7 @@ public function cacheAction(Request $request)
/**
* {@inheritdoc}
*/
public function isContextual()
public function isContextual(): bool
{
return false;
}
Expand Down