classTextConstraint
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): boolTells whether text satisfies every given constraint.
Parameters
$text | string | The text of a heading or paragraph |
$schema | array<string, mixed> | The constraint |
Returns
bool True when the text matches the pattern, equals the const and is in the enum, where givenThrows
InvalidInputException When the constraint has unknown keys or malformed valuesTest cases 2
Called from 2
Calls 6
- static-call Fields::keys() line 27
- function-call
preg_matchline 28 - function-call
str_replaceline 28 - static-call Fields::text() line 28
- function-call
in_arrayline 31 - static-call Fields::strings() line 31
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
DefinitionReaderTestcallsDocumentReaderTestcallsLoaderTestcallsDocumentSchemaTestcallsSectionBlocksTestcallsReferenceTestcallsMarkdownDocumentTestcallsFormatterTestcalls