RulesHelper
abstract class RulesHelper
Methods
Generate the allowedChildren and allowedDescendants bitfields for every tag and for the root context
Initialize a matrix of settings
Apply given rule from each applicable tag
No description
Remove unusable tags from the matrix
Convert a binary representation such as "101011" to an array of integer
Details
at line 22
static array
getBitfields(TagCollection $tags, Ruleset $rootRules)
Generate the allowedChildren and allowedDescendants bitfields for every tag and for the root context
at line 101
static protected array
initMatrix(array $rules)
Initialize a matrix of settings
at line 128
static protected void
applyTargetedRule(array $matrix, array $rules, string $ruleName, string $key, int $value)
Apply given rule from each applicable tag
For each tag, if the rule has any target we set the corresponding value for each target in the matrix
at line 148
static protected array
unrollRules(array $rules)
No description
at line 190
static protected void
pruneMatrix(array $matrix)
Remove unusable tags from the matrix
at line 240
static protected int[]
pack(string $allowedChildren, string $allowedDescendants)
Convert a binary representation such as "101011" to an array of integer
Each bitfield is split in groups of 8 bits, then converted to a 16-bit integer where the allowedChildren bitfield occupies the least significant bits and the allowedDescendants bitfield occupies the most significant bits