Skip to content
PHP Ecosystem
Explore

CapturePolicyFactory

API reference › Debug › service › CapturePolicyFactory

classyii\debug\service\CapturePolicyFactory
Sourcesrc/service/CapturePolicyFactory.php

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.

PropertyTypeDescriptionDefined by
$module protected readonly constructoryii\debug\ModuleDebug module read for the redaction configuration at call time.CapturePolicyFactory
MethodDescriptionDefined 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
public function __construct(yii\debug\Module $module)

Binds capture-policy creation to the debug module.

Parameters

ParameterTypeDescription
$moduleyii\debug\ModuleDebug module read for the redaction configuration at call time.
public function create(list<string> $additionalSensitiveKeys = []): PHPForge\Debug\Capture\CapturePolicy

Creates the shared persistent-data policy, optionally extending its exact-key list for one collector.

Parameters

ParameterTypeDescription
$additionalSensitiveKeyslist<string>Collector-specific exact keys added without weakening global rules.

Returns

CapturePolicy: Shared policy covering the global rules and the collector-specific keys.

Throws