-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The way that interface works with multiple versions has in practice become a nightmare of dependency management. V1, V2 and V3 of simple cache are not compatible with each other yet use the same name and same namespace. So that you can't have a project using 2 libraries when one expects and requires V1 and the other expects and requires another version. Had those interfaces been named CacheInterface, CacheInterfaceV2 and CacheInterfaceV3 then it would have been possible to have multiple versions, and even type hints like `CacheInterface | CacheInterfaceV2` would've worked. Currently none of this is possible and it's a mess.
- Loading branch information
Showing
9 changed files
with
84 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<?php declare(strict_types=1); | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Square\TTCache\Store; | ||
|
||
use Psr\SimpleCache\CacheException; | ||
use Exception; | ||
|
||
class CacheStoreException extends Exception implements CacheException | ||
class CacheStoreException extends Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Square\TTCache\Store; | ||
|
||
interface CacheStoreInterface | ||
{ | ||
public function get(string $key, mixed $default = null): mixed; | ||
|
||
public function set(string $key, mixed $value, int|\DateInterval $ttl = null): bool; | ||
|
||
public function delete(string $key): bool; | ||
|
||
public function getMultiple(iterable $keys, mixed $default = null): iterable; | ||
|
||
public function setMultiple(iterable $values, int|\DateInterval $ttl = null): bool; | ||
|
||
public function deleteMultiple(iterable $keys): bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.