SelfCheckingResourceChecker
in package
implements
ResourceCheckerInterface
Resource checker for instances of SelfCheckingResourceInterface.
As these resources perform the actual check themselves, we can provide this class as a standard way of validating them.
Tags
Table of Contents
Interfaces
- ResourceCheckerInterface
- Interface for ResourceCheckers.
Properties
- $cache : array<string|int, mixed>
Methods
- isFresh() : bool
- Validates the resource.
- supports() : bool
- Queries the ResourceChecker whether it can validate a given resource or not.
Properties
$cache
private
static array<string|int, mixed>
$cache
= []
Methods
isFresh()
Validates the resource.
public
isFresh(SelfCheckingResourceInterface $resource, int $timestamp) : bool
Parameters
- $resource : SelfCheckingResourceInterface
- $timestamp : int
-
The timestamp at which the cache associated with this resource was created
Return values
boolsupports()
Queries the ResourceChecker whether it can validate a given resource or not.
public
supports(ResourceInterface $metadata) : bool
Parameters
- $metadata : ResourceInterface