-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathContext.php
executable file
·49 lines (35 loc) · 1.41 KB
/
Context.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
namespace Unleash\Client\Configuration;
use DateTimeInterface;
/**
* @todo move to required methods in next major
*
* @method string|null getHostname()
* @method string|null getEnvironment()
* @method DateTimeInterface getCurrentTime()
* @method Context setHostname(string|null $hostname)
* @method Context setEnvironment(string|null $environment)
* @method Context setCurrentTime(DateTimeInterface|null $time)
* @method array<string, string> getCustomProperties()
*/
interface Context
{
public function getCurrentUserId(): ?string;
public function getIpAddress(): ?string;
public function getSessionId(): ?string;
public function getCustomProperty(string $name): string;
/**
* @todo make $value nullable
*/
public function setCustomProperty(string $name, string $value): self;
public function hasCustomProperty(string $name): bool;
public function removeCustomProperty(string $name, bool $silent = true): self;
public function setCurrentUserId(?string $currentUserId): self;
public function setIpAddress(?string $ipAddress): self;
public function setSessionId(?string $sessionId): self;
/**
* @param array<string> $values
*/
public function hasMatchingFieldValue(string $fieldName, array $values): bool;
public function findContextValue(string $fieldName): ?string;
}