classItemValidator
final class ItemValidator
Enforces the rules an item must satisfy on its own, before links between items are checked.
Methods§
public function validate(Item $item): voidChecks every rule, in the order the messages are reported.
Parameters
$item | Item | The item |
Throws
InvalidInputException When the item breaks a rule; the message starts with its IDTest cases 2
Called from 1
Calls 4
- method-call ItemValidator::identity() line 25
- method-call ItemValidator::statement() line 26
- method-call ItemValidator::disposition() line 27
- method-call ItemValidator::details() line 28
public function identity(Item $item): voidChecks the ID and the kind, status and origin values.
Parameters
$item | Item | The item |
Throws
InvalidInputException When the ID is malformed or a value is unknownTest cases 2
Called from 1
Calls 3
- function-call
preg_matchline 40 - new InvalidInputException line 41
- function-call
in_arrayline 43
public function statement(Item $item): voidChecks that unsupported items give a reason and specifications follow EARS.
Parameters
$item | Item | The item |
Throws
InvalidInputException When the reason is missing or the statement breaks EARSTest cases 2
Called from 1
Calls 3
- new InvalidInputException line 61
- method-call Validator::validate() line 65
- new Validator line 65
public function disposition(Item $item): voidChecks how the item is accounted for: by evidence, by requirements or as independent.
Parameters
$item | Item | The item |
Throws
InvalidInputException When the kind, origin, evidence and links contradict each otherTest cases 2
Called from 1
Calls 1
public function details(Item $item): voidChecks the metadata mapping and the design references.
Parameters
$item | Item | The item |
Throws
InvalidInputException When metadata is not a mapping or a design reference is empty or unknownTest cases 2
Called from 1
Calls 6
- static-call Fields::mapping() line 104
- static-call Fields::sequence() line 105
- static-call Fields::keys() line 107
- new InvalidInputException line 109
- function-call
array_keysline 111 - static-call Fields::text() line 112
Test cases 24§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 10
ItemValidatorTest::testDetailsAcceptsItemscallsItemValidatorTest::testDetailsRejectsItemscallsItemValidatorTest::testDispositionAcceptsItemscallsItemValidatorTest::testDispositionRejectsItemscallsItemValidatorTest::testIdentityAcceptsItemscallsItemValidatorTest::testIdentityRejectsItemscallsItemValidatorTest::testStatementAcceptsItemscallsItemValidatorTest::testStatementRejectsItemscallsItemValidatorTest::testValidateAcceptsItemscallsItemValidatorTest::testValidateReportsTheFirstBrokenRulecalls
Other tests reaching this symbol 14
DefinitionReaderTestcallsLoaderTestcallsReferenceTestcallsMarkdownDocumentTestcallsApplicationTestcallsCommandHandlerTestcallsCommandLineTestcallsExecutorTestcallsFormatterTestcallsItemTestcallsAnalyzerTestcallsCoverageTestcallsSnapshotTestcallsVerifierTestcalls