final class TextConstraint

Evaluates the pattern, const and enum text constraints of the profile.

Methods§

public static function matches(string $text, array<string, mixed> $schema): bool

Tells whether text satisfies every given constraint.

Parameters

$textstringThe text of a heading or paragraph
$schemaarray<string, mixed>The constraint

Returns

bool True when the text matches the pattern, equals the const and is in the enum, where given

Throws

InvalidInputException When the constraint has unknown keys or malformed values
Test cases 2
Called from 2
Calls 6

Test cases 10§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 2
Other tests reaching this symbol 8

Relations§

Static calls 2