Skip to content
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

Add interface to cache resolver and make classes final #32

Merged
merged 2 commits into from
May 8, 2024
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
2 changes: 1 addition & 1 deletion src/Lib/Cache/RuntimeCacheResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

use Pimcore\Cache\RuntimeCache;

class RuntimeCacheResolver implements RuntimeCacheResolverInterface
final class RuntimeCacheResolver implements RuntimeCacheResolverInterface
{
public function load(string $id): mixed
{
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/CacheResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use DateInterval;
use Pimcore\Cache;

class CacheResolver
final class CacheResolver implements CacheResolverInterface
{
public function save(
mixed $data,
Expand Down
47 changes: 47 additions & 0 deletions src/Lib/CacheResolverInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StaticResolverBundle\Lib;

use DateInterval;

interface CacheResolverInterface
{
public function save(
mixed $data,
string $key,
array $tags = [],
DateInterval|int $lifetime = null,
int $priority = 0,
bool $force = false
): void;

public function load(string $key): mixed;

public function remove(string $key): bool;

public function clearAll(): bool;

public function clearTag(string $tag): bool;

public function clearTags(array $tag = []): bool;

public function enable(): void;

public function isEnabled(): bool;

public function disable(): void;
}
2 changes: 1 addition & 1 deletion src/Lib/ToolResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Exception;
use Pimcore\Tool;

class ToolResolver implements ToolResolverInterface
final class ToolResolver implements ToolResolverInterface
{
public function getValidLanguages(): array
{
Expand Down
Loading