AttributeMatch
Stateless matching primitives shared by the interpreted ({@see AttributeRule::matches()}) and the compiled ({@see AttributeRule::compile()}) matching paths.
Keeping every comparison in one place guarantees the generated PHP and the interpreted fallback can never diverge in behaviour.
The value side of every primitive is an OpenTelemetry AnyValue resolved from
an attribute path - intrinsically untyped, so it is the one place mixed is
unavoidable. A missing path resolves to self::MISSING; every comparison
treats that sentinel as "no match" so a signal lacking the attribute is never
matched. The expected side is always a concrete scalar or DateTime.
Constants
- MISSING : mixed = "\x00__flow_telemetry_missing__\x00"
- Sentinel returned by {@see self::resolve()} when a path segment is absent.
Methods
- contains() : bool
- endsWith() : bool
- equal() : bool
- greaterThan() : bool
- greaterThanEqual() : bool
- lessThan() : bool
- lessThanEqual() : bool
- notEqual() : bool
- regexp() : bool
- resolve() : mixed
- Resolve a nested attribute path, descending into array values.
- startsWith() : bool
- stringForm() : string|null
- String form of an AnyValue for the substring/regexp modes.
Constants
MISSING
Sentinel returned by {@see self::resolve()} when a path segment is absent.
public
mixed
MISSING
= "\x00__flow_telemetry_missing__\x00"
Distinct from any real attribute value (null values are never stored on Attributes).
Methods
contains()
public
static contains(string|null $value, string $needle, bool $caseSensitive) : bool
Parameters
- $value : string|null
- $needle : string
- $caseSensitive : bool
Return values
boolendsWith()
public
static endsWith(string|null $value, string $needle, bool $caseSensitive) : bool
Parameters
- $value : string|null
- $needle : string
- $caseSensitive : bool
Return values
boolequal()
public
static equal(mixed $value, bool|float|int|string|DateTimeInterface $expected) : bool
Parameters
- $value : mixed
- $expected : bool|float|int|string|DateTimeInterface
Return values
boolgreaterThan()
public
static greaterThan(mixed $value, bool|float|int|string|DateTimeInterface $expected) : bool
Parameters
- $value : mixed
- $expected : bool|float|int|string|DateTimeInterface
Return values
boolgreaterThanEqual()
public
static greaterThanEqual(mixed $value, bool|float|int|string|DateTimeInterface $expected) : bool
Parameters
- $value : mixed
- $expected : bool|float|int|string|DateTimeInterface
Return values
boollessThan()
public
static lessThan(mixed $value, bool|float|int|string|DateTimeInterface $expected) : bool
Parameters
- $value : mixed
- $expected : bool|float|int|string|DateTimeInterface
Return values
boollessThanEqual()
public
static lessThanEqual(mixed $value, bool|float|int|string|DateTimeInterface $expected) : bool
Parameters
- $value : mixed
- $expected : bool|float|int|string|DateTimeInterface
Return values
boolnotEqual()
public
static notEqual(mixed $value, bool|float|int|string|DateTimeInterface $expected) : bool
Parameters
- $value : mixed
- $expected : bool|float|int|string|DateTimeInterface
Return values
boolregexp()
public
static regexp(string|null $value, string $pattern) : bool
Parameters
- $value : string|null
- $pattern : string
Return values
boolresolve()
Resolve a nested attribute path, descending into array values.
public
static resolve(Attributes $attributes, array<int, string> $segments) : mixed
Parameters
- $attributes : Attributes
- $segments : array<int, string>
Return values
mixed —the OpenTelemetry AnyValue at the path, or self::MISSING when any segment is absent
startsWith()
public
static startsWith(string|null $value, string $needle, bool $caseSensitive) : bool
Parameters
- $value : string|null
- $needle : string
- $caseSensitive : bool
Return values
boolstringForm()
String form of an AnyValue for the substring/regexp modes.
public
static stringForm(mixed $value) : string|null
Mirrors the scalar handling of Attributes::normalize(): DateTime is formatted as ISO 8601 and booleans as "true"/"false". Arrays, throwables and the self::MISSING sentinel have no string form and return null, which the substring/regexp modes treat as "no match".
Parameters
- $value : mixed