Skip to content

Commit

Permalink
better type hint in tests fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
EriBloo committed Oct 14, 2024
1 parent 1c8d66f commit b571dd0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/Fixtures/BasicCacheObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public function ttl(): CarbonInterval
return CarbonInterval::seconds(0);
}

/**
* @return SerializeModifier<string>
*/
public function modifier(): SerializeModifier
{
return new SerializeModifier(false);
Expand Down
7 changes: 7 additions & 0 deletions tests/Fixtures/EncryptedCacheObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
use EriBloo\CacheObjects\ValueObjects\Values\EncryptedModifier;
use EriBloo\CacheObjects\ValueObjects\Values\SerializeModifier;

/**
* @implements CacheObject<string>
*/
final readonly class EncryptedCacheObject implements CacheObject
{
/** @use CacheObjectActions<string> */
use CacheObjectActions;

public function key(): StringKey
Expand All @@ -25,6 +29,9 @@ public function ttl(): CarbonInterval
return CarbonInterval::seconds(0);
}

/**
* @return EncryptedModifier<string>
*/
public function modifier(): EncryptedModifier
{
return new EncryptedModifier(new SerializeModifier(false));
Expand Down
4 changes: 4 additions & 0 deletions tests/Fixtures/HashedCacheObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
final readonly class HashedCacheObject implements CacheObject
{
/** @use CacheObjectActions<string> */
use CacheObjectActions;

public function key(): HashedKey
Expand All @@ -28,6 +29,9 @@ public function ttl(): CarbonInterval
return CarbonInterval::seconds(0);
}

/**
* @return SerializeModifier<string>
*/
public function modifier(): SerializeModifier
{
return new SerializeModifier(false);
Expand Down

0 comments on commit b571dd0

Please sign in to comment.