CapturePolicyFactory
API reference › Debug › service › CapturePolicyFactory
Builds the policy that redacts sensitive values and caps request bodies before the debugger persists a capture.
The global rules come from the module configuration; a collector adds its own exact keys on top of them without weakening the shared rules.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$module protected readonly constructor | yii\ | Debug module read for the redaction configuration at call time. | CapturePolicyFactory |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Binds capture-policy creation to the debug module. | CapturePolicyFactory |
create() | Creates the shared persistent-data policy, optionally extending its exact-key list for one collector. | CapturePolicyFactory |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(yii\debug\Module $module)Binds capture-policy creation to the debug module.
Parameters
| Parameter | Type | Description |
|---|---|---|
$module | yii\ | Debug module read for the redaction configuration at call time. |
create()
Section titled “create() ”public function create(list<string> $additionalSensitiveKeys = []): PHPForge\Debug\Capture\CapturePolicyCreates the shared persistent-data policy, optionally extending its exact-key list for one collector.
Parameters
| Parameter | Type | Description |
|---|---|---|
$additionalSensitiveKeys | list<string> | Collector-specific exact keys added without weakening global rules. |
Returns
CapturePolicy: Shared policy covering the global rules and the collector-specific keys.
Throws
InvalidArgumentException: when the configured keys, prefixes, patterns, or body limit are rejected.