PhilipBrown\Signature\Guards\CheckTimestamp::check PHP Method

check() public method

Check to ensure the auth parameters satisfy the rule of the guard
public check ( array $auth, array $signature, string $prefix ) : boolean
$auth array
$signature array
$prefix string
return boolean
    public function check(array $auth, array $signature, $prefix)
    {
        if (!isset($auth[$prefix . 'timestamp'])) {
            throw new SignatureTimestampException('The timestamp has not been set');
        }
        if (abs($auth[$prefix . 'timestamp'] - time()) >= $this->grace) {
            throw new SignatureTimestampException('The timestamp is invalid');
        }
        return true;
    }
CheckTimestamp