lychee-org/phpstan-sensitive-parameter-values
A PHPStan rule that flags sensitive values like passwords, tokens, and API keys passed directly as literal arguments to functions and methods, helping you catch hardcoded secrets before they reach your codebase.
Architecture fit. This is a PHPStan extension — a static-analysis plugin, not a runtime library. It lives entirely in the development/CI toolchain and has zero presence in the production request path, service topology, or data plane. Fit therefore hinges on two preconditions: the codebase already standardizes on PHPStan as its static analyzer, and the application targets PHP 8.2+ (#[\SensitiveParameter]) and/or PHP 8.3+ (#[\SensitiveParameterValue]) in security-sensitive paths such as authentication, token handling, PII, and secret-bearing logs. Where those hold, the package is a narrow but legitimate correctness aid: it teaches the analyzer how sensitive values propagate so that flows through SensitiveParameterValue::getValue() and related constructs are typed and tracked rather than silently ignored. Where the org does not already run PHPStan, adopting this package means adopting PHPStan first — the extension is a tail, not a head.
Integration feasibility. Mechanically trivial: a Composer require --dev entry, an includes: (or services:) line in phpstan.neon, and a CI pipeline that already invokes vendor/bin/phpstan analyse. Effort is measured in hours, not sprints, and the change is fully reversible by deleting one line. The real feasibility questions are version-matching (the extension must be compatible with our pinned PHPStan major and our PHP floor) and whether the analyzer already covers our specific patterns natively, making the extension redundant. Release 1.2.0 does not change any of this: no new configuration surface, no documented breaking change, so the integration shape is unchanged from the prior assessment.
Technical risk.
Key questions.
SensitiveParameter and SensitiveParameterValue, including getValue() return-type flow and nested wrapping?Stack fit. Assumes a Composer-based PHP application with PHPStan wired into CI (GitHub Actions, GitLab CI, or equivalent) and a meaningful analysis level. It is a dev-only artifact: nothing ships to production, and it cannot affect runtime behavior or deployment artifacts. Best fit is a team already treating static analysis as a merge gate and already annotating sensitive parameters — the extension then improves fidelity rather than introducing a new practice.
Migration path. Purely additive and non-destructive. Add as a require-dev, include it in phpstan.neon, run analysis, and diff the error output against the current baseline. There is no data migration, no schema change, and no rollout coordination. Rollback is deleting the include line and running composer remove --dev. Because the blast radius is confined to CI, the cost of a failed trial is essentially one engineer-day. If we have not yet adopted the package, start directly on 1.2.0 rather than an earlier patch — the false-positive fix is precisely the class of change that makes a first trial readable.
Compatibility. Pin an exact version (1.2.0) and record the tested matrix (PHPStan major × PHP minor). Verify with composer why-not against our PHPStan constraint before merging. Confirm the CI image's PHP version satisfies the attribute requirements — analysis can run on a newer PHP than production, but the code under analysis must actually be permitted to use the attributes. Pay explicit attention to coexistence with phpstan-baseline.neon and any existing framework extensions, since extension ordering and type redefinition can change reported error sets. Because 1.2.0 alters reported results by design, any baseline entries previously added to suppress this extension's output should be re-examined for removal.
Sequencing.
#[SensitiveParameter] / #[SensitiveParameterValue] and identify the concrete analyzer gap.Maintenance. Minimal ongoing cost: one dev dependency, upgraded in lockstep with PHPStan. The real maintenance exposure is PHPStan major upgrades, where the extension may lag or break; treat those as coordinated changes rather than independent bumps. A Renovate/Dependabot rule plus a documented "PHPStan upgrade runbook" is sufficient. 1.2.0 requires no action from us beyond a routine pinned bump — it is a patch-grade improvement in effect, despite the minor version increment, so route it through the normal dev-dependency review rather than an expedited path.
Support. Effectively self-support. With 0 stars and 0 dependents there is no community backlog to lean on, and upstream's priorities are LycheeOrg's, not ours. 1.2.0 shows the maintainer does fix reported inaccuracies, which slightly raises confidence that an upstream issue is a viable channel — but do not treat it as a support contract. Assign a named internal owner and budget for reading the source when questions arise; do not assume documentation exists. The fallback (a small in-repo PHPStan extension or a fork) should be sketched before the dependency becomes load-bearing in the merge gate.
Scaling. Analysis cost is negligible relative to PHPStan itself and scales with codebase size exactly as PHPStan does — no separate scaling concern. No runtime scaling dimension exists. The human-scaling concern is onboarding: the concept must be explainable, not folkloric.
Failure modes.
Ramp-up. Low for any team already running PHPStan: one include line and a short internal note. Engineers need to understand what #[SensitiveParameter] actually does (stack-trace redaction) and that SensitiveParameterValue is a wrapper whose unwrapped value must be handled deliberately — the extension improves type flow, it does not enforce discipline. Because external documentation is likely thin and the 1.2.0 notes are a single line, plan on a 30-minute walkthrough derived from reading the source rather than from package docs, and expect developers to consult the source directly thereafter.
How can I help you explore Laravel packages today?