final class Validator

Validates the clause grammar published at https://alistairmavin.com/ears/.

A statement is an optional feature (Where), preconditions (While), at most one trigger (When or If) and one system response. Quoted and code literals are masked first, so keywords inside them do not count as clauses.

Methods§

public function validate(string $statement): void

Checks that a statement follows the EARS clause grammar.

Parameters

$statementstringThe specification statement

Throws

InvalidInputException When the statement breaks the grammar; the message starts with "EARS:"
Test cases 20
Called from 1
Calls 11

Test cases 35§

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

Dedicated tests 20
Other tests reaching this symbol 15

Relations§

Instantiated in 1
Method calls 1