Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5namespace AqwSocketClient\Interfaces;
6
7use DateTimeImmutable;
8
9/**
10 * Represents an {@see AqwSocketClient\Interfaces\ScriptInterface} with a lifetime.
11 */
12interface ExpirableScriptInterface extends ScriptInterface
13{
14    /**
15     * Marks this script as expired.
16     *
17     * Sets the result to {@see AqwSocketClient\Enums\ScriptResult::Expired}
18     * and marks the script as completed.
19     */
20    public function expired(): void;
21
22    /**
23     * Determines whether the script has reached its expiration time.
24     *
25     * @return bool True if the current time is greater than the configured
26     *              expiration timestamp; false otherwise.
27     */
28    public function isExpired(): bool;
29
30    /**
31     * Defines the expiration timestamp for this script.
32     *
33     * @param DateTimeImmutable $expiresAt Absolute expiration time.
34     */
35    public function expiresAt(DateTimeImmutable $expiresAt): void;
36}