Files
portal/app/app/Logging/ScrubPii.php
T
Дмитрий 2eaa78f95b
Accessibility (Pa11y live) / a11y (push) Has been cancelled
SAST — Semgrep / Semgrep SAST scan (push) Has been cancelled
fix(stan): Larastan-долг G1/G6 = 0 ошибок (реальные баги — починены, не спрятаны)
Продуктовый код (фиксы, не baseline): TenantRequisites+SupplierLead — явные @property (ide-helper:models пропускал модели); DealsController V1 — лишний ?-> на non-null received_at; ScrubPii — guard instanceof Monolog. Тест-код: ImitationTestCase @param int; findByInn return-type. Baseline перегенерён — в нём ТОЛЬКО ложноположительные (Pest TestCall + защитный ?-> на nullable first() в debug-строках ScenarioBC), 0 продуктовых подавлений (проверено диффом). composer stan: 0.

NB: столбцы lead-region (dadata_qc/phone_operator/region_source/resolved_subject_code) есть в БД, но отсутствуют в db/schema.sql — отдельный дрейф схемы.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 12:40:00 +03:00

26 lines
749 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
namespace App\Logging;
use Illuminate\Log\Logger;
/**
* Tap для config/logging.php: вешает PiiScrubbingProcessor на канал.
*
* Использование: 'tap' => [\App\Logging\ScrubPii::class] в описании канала.
*/
final class ScrubPii
{
public function __invoke(Logger $logger): void
{
// Illuminate\Log\Logger::getLogger() типизирован как PSR LoggerInterface,
// но фактически возвращает Monolog\Logger (у него есть pushProcessor).
$monolog = $logger->getLogger();
if ($monolog instanceof \Monolog\Logger) {
$monolog->pushProcessor(new PiiScrubbingProcessor);
}
}
}