Values
in package
implements
NodeRule
Values between 5.x versions: an enumeration value the target does not list is spelled as the target spells it where it has one (5.5 FORM jpeg ↔ 5.5.1 jpg), and otherwise, like a missing pointer the target requires (5.5.1 REPO without one → 5.5), makes the structure an extension with its tag and value (5.5.1 SEX U → 5.5 _SEX U), or drops it under LossPolicy::DropWithReport (KL3001); converting back gives the structure back (Extensions).
A value that does not fit the source version either stays as it is, but not inside an extension a step before made that is a structure again (7.0 NOTE.SOUR, 5.5.1 _SOUR, 5.5 SOUR: ROLE NGHBR becomes _ROLE); a RESN list that 7.0 wrote ("confidential, locked", kept in 5.5.1) fits while the version lists every item (Payloads). The Y of an event is left to Structures.
Table of Contents
Interfaces
- NodeRule
- A rule for one structure at a time. Rules that look at every line of a record are grouped in {@see Rule\Nodes}, which walks each record once for all of them.
Methods
- __construct() : mixed
- needsPrepass() : bool
- Whether the rule needs Context::prepass(): facts about the whole input before the first record.
- node() : bool
- Converts one structure (a record or a substructure; never a CONC/CONT line) with one of the rule's tags, as the structure is tagged when the walk reaches it, in place. Its substructures are visited after it, as they are when this returns.
- structures() : array<string, Structure>
- tags() : array<int, string>|null
- The tags of the structures with an enumeration or a pointer in either version; with grammars, also those with a grammar or a literal.
Methods
__construct()
public
__construct(Version $from, Version $to[, array<string, array<string, string>> $spellings = [] ][, bool $grammars = false ][,
Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 87
callable(string, string): Array|null $respell = null ][, array<int, string> $kept = [] ]) : mixed
Parameters
- $from : Version
- $to : Version
- $spellings : array<string, array<string, string>> = []
-
by target element ("<MULTIMEDIA_FORMAT>"): source value (lowercase) => target value
- $grammars : bool = false
-
whether dates, ages and lengths must fit too (to and from 5.5.5)
- $respell : Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 87 callable(string, string): Array|null = null
-
target grammar ("AGE_AT_EVENT") and value => the target's spelling of a value that does not fit (5.5.5 "<1y" → "< 1y")
- $kept : array<int, string> = []
-
target elements whose values stay when none of their spellings fits (5.5.1 programs write FORM png)
needsPrepass()
Whether the rule needs Context::prepass(): facts about the whole input before the first record.
public
needsPrepass() : bool
Return values
boolnode()
Converts one structure (a record or a substructure; never a CONC/CONT line) with one of the rule's tags, as the structure is tagged when the walk reaches it, in place. Its substructures are visited after it, as they are when this returns.
public
node(Document $document, int $id, Context $context) : bool
Parameters
Return values
bool —false when the rule removed the structure: the rules after it and its substructures are skipped
structures()
public
static structures(Profile $profile) : array<string, Structure>
Parameters
- $profile : Profile
Return values
array<string, Structure> —every structure of a version, by URI
tags()
The tags of the structures with an enumeration or a pointer in either version; with grammars, also those with a grammar or a literal.
public
tags() : array<int, string>|null
Return values
array<int, string>|null —the tags of the structures the rule converts; null for every structure