maskDocumentNode.php
Table of Contents
Functions
- maskDocumentNode() : array<string|int, mixed>
- Walks an object: masks the matching leaves and descends into nested objects and arrays.
Functions
maskDocumentNode()
Walks an object: masks the matching leaves and descends into nested objects and arrays.
maskDocumentNode(array<string|int, mixed> $node, array<string|int, mixed> $maskings, string|null $exactPath, int $depth[, array<int, string> $protectedAttributes = [] ]) : array<string|int, mixed>
A leaf (scalar, null or a JSON array) is masked by the first matching rule
(resolveMaskingRule()); an array with no matching rule is walked deeper
(maskDocumentList()); a nested object recurses through this helper. The
attributes named in $protectedAttributes are never masked at the top
level ($depth === 0); the default is an empty list (nothing protected).
Parameters
- $node : array<string|int, mixed>
-
The object to walk.
- $maskings : array<string|int, mixed>
-
The list of rules for this collection.
- $exactPath : string|null
-
The dotted path of
$node(null once an array has been crossed). - $depth : int
-
The current depth (protected attributes are top-level only).
- $protectedAttributes : array<int, string> = []
-
Top-level attribute names never masked. Default: none.
Tags
Return values
array<string|int, mixed> —The masked object.