config_classes = [ BirdSecretConfigDefinitionStub::class, BirdPublicConfigDefinitionStub::class, ]; } public function extract(object $db): array { return $this->extracted($db, 'SELECT test'); } } } it('redacts configured Bird secrets while preserving isSet metadata', function (): void { $rows = [ ['module' => 'bird', 'variable' => 'api_key', 'type' => 'string', 'value' => 'never-return-this'], ['module' => 'bird', 'variable' => 'workspaceId', 'type' => 'string', 'value' => 'workspace-1'], ]; $result = new class($rows) { public function __construct(private array $rows) { } public function fetch_assoc(): ?array { return array_shift($this->rows); } }; $db = new class($result) { public function __construct(private object $result) { } public function query(string $sql): object { return $this->result; } }; $config = (new BirdModuleConfigRedactionHarness())->extract($db); expect($config[0])->toMatchArray([ 'variable' => 'api_key', 'value' => '[redacted]', 'isSecret' => true, 'isSet' => true, ])->and($config[1])->toMatchArray([ 'variable' => 'workspaceId', 'value' => 'workspace-1', 'isSecret' => false, 'isSet' => true, ]); });