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

Apply fixes from StyleCI #2

Merged
merged 1 commit into from
Sep 12, 2023
Merged
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
34 changes: 17 additions & 17 deletions src/ConfigurableCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class ConfigurableCache
*
* @template TCacheValue
*
* @param string $key The cache key to retrieve or store the item.
* @param string $config The cache configuration to use (e.g., 'default').
* @param \Closure(): TCacheValue $callback The Closure to execute if the item is not found in the cache.
* @param string $key The cache key to retrieve or store the item.
* @param string $config The cache configuration to use (e.g., 'default').
* @param \Closure(): TCacheValue $callback The Closure to execute if the item is not found in the cache.
* @return TCacheValue The cached item or the result of the Closure execution.
*/
public static function remember(string $key, string $config, Closure $callback): mixed
Expand All @@ -30,10 +30,10 @@ public static function remember(string $key, string $config, Closure $callback):
}

/**
* Get a value from the cache
* Get a value from the cache.
*
* @param string $key The key to store the value under.
* @param string $config The name of the configuration to use.
* @param string $key The key to store the value under.
* @param string $config The name of the configuration to use.
*/
public static function get(string $key, string $config = 'default'): mixed
{
Expand All @@ -45,9 +45,9 @@ public static function get(string $key, string $config = 'default'): mixed
/**
* It stores a value in the cache for a given key.
*
* @param string $key The key to store the value under.
* @param mixed $value The value to store.
* @param string $config The name of the configuration to use.
* @param string $key The key to store the value under.
* @param mixed $value The value to store.
* @param string $config The name of the configuration to use.
*
* @throws \RuntimeException
*/
Expand All @@ -64,8 +64,8 @@ public static function put(string $key, mixed $value, string $config = 'default'
}

/**
* @param string $key The name of the configuration to use.
* @param string $config The name of the configuration to use.
* @param string $key The name of the configuration to use.
* @param string $config The name of the configuration to use.
*/
public static function increment(string $key, string $config = 'default'): void
{
Expand All @@ -74,10 +74,10 @@ public static function increment(string $key, string $config = 'default'): void
}

/**
* It deletes a cache
* It deletes a cache.
*
* @param string $key The key of the cache.
* @param string $config The name of the configuration to use.
* @param string $key The key of the cache.
* @param string $config The name of the configuration to use.
*/
public static function delete(string $key, string $config = 'default'): bool
{
Expand All @@ -89,8 +89,8 @@ public static function delete(string $key, string $config = 'default'): bool
/**
* Generate a cache key for the given key and configuration.
*
* @param string $key The key to be included in the cache key.
* @param string $config The cache configuration name (e.g., 'default').
* @param string $key The key to be included in the cache key.
* @param string $config The cache configuration name (e.g., 'default').
* @return string The generated cache key.
*/
protected static function cacheKey(string $key, string $config): string
Expand All @@ -101,7 +101,7 @@ protected static function cacheKey(string $key, string $config): string
/**
* Get the Time To Live (TTL) duration for cache items based on the specified configuration.
*
* @param string $config The cache configuration name (e.g., 'default').
* @param string $config The cache configuration name (e.g., 'default').
* @return CarbonInterface A Carbon instance representing the TTL duration.
*/
protected static function ttl(string $config): CarbonInterface
Expand Down