SunnyCashCacheManager
in package
implements
SunnyCashCacheManagerInterface
Class SunnyCashCacheManager
Interfaces, Classes and Traits
- SunnyCashCacheManagerInterface
- Interface SunnyCashCacheManagerInterface
Table of Contents
- $couponFactory : SunnyCashCouponFactory
- $curl : CurlRequest
- $expirationStrategy : SunnyCashExpirationStrategyInterface
- $rootDirectory : ExistingDirectory
- __construct() : mixed
- SunnyCashCacheManager constructor.
- checkAndPerformRefresh() : mixed
- Checks if the cache expired and refreshes it accordingly.
- getJsonCoupons() : string
- Performs a curl request to SunnyCash to retrieve all coupon data in raw JSON format.
- getModificationTime() : mixed
- refresh() : mixed
- refreshJsonCouponCache() : mixed
- refreshLogos() : mixed
- sortJsonCouponArray() : mixed
Properties
$couponFactory
protected
SunnyCashCouponFactory
$couponFactory
$curl
protected
CurlRequest
$curl
$expirationStrategy
protected
SunnyCashExpirationStrategyInterface
$expirationStrategy
$rootDirectory
protected
ExistingDirectory
$rootDirectory
Methods
__construct()
SunnyCashCacheManager constructor.
public
__construct(SunnyCashCouponFactory $couponFactory, SunnyCashExpirationStrategyInterface $expirationStrategy, CurlRequest $curl, ExistingDirectory $rootDirectory) : mixed
Parameters
- $couponFactory : SunnyCashCouponFactory
- $expirationStrategy : SunnyCashExpirationStrategyInterface
- $curl : CurlRequest
- $rootDirectory : ExistingDirectory
Return values
mixed —checkAndPerformRefresh()
Checks if the cache expired and refreshes it accordingly.
public
checkAndPerformRefresh() : mixed
Return values
mixed —getJsonCoupons()
Performs a curl request to SunnyCash to retrieve all coupon data in raw JSON format.
protected
getJsonCoupons() : string
Tags
Return values
string —All coupon data in raw JSON format
getModificationTime()
protected
getModificationTime() : mixed
Return values
mixed —refresh()
protected
refresh() : mixed
Return values
mixed —refreshJsonCouponCache()
protected
refreshJsonCouponCache(StringType $jsonCoupons) : mixed
Parameters
- $jsonCoupons : StringType
Return values
mixed —refreshLogos()
protected
refreshLogos(StringType $jsonCoupons) : mixed
Parameters
- $jsonCoupons : StringType
Return values
mixed —sortJsonCouponArray()
protected
sortJsonCouponArray(array<string|int, mixed> $jsonCoupons) : mixed
Parameters
- $jsonCoupons : array<string|int, mixed>