Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpstan Sensitive Parameter Values Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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.

  • Adoption risk (highest). Still 0 stars and 0 dependents — effectively no external validation. We would remain an early, near-solo consumer of an org-internal utility published by LycheeOrg for its own needs. The 1.2.0 release is the third PR in the repository's history, which confirms rather than relieves the thin-validation picture: there is no community-triaged compatibility matrix.
  • Native-absorption risk. PHPStan's handling of these attributes is an evolving area; if upstream adds first-class support, this package becomes dead weight and its semantics may diverge from upstream's.
  • Correctness/trust risk (partially de-escalated). 1.2.0 is a targeted false-positive fix ("Remove false positives," PR #3). That is the failure mode we were most worried about on the trust axis — spurious errors that block merges and teach developers to ignore the check. The fact that it shipped is a modest positive signal on maintenance responsiveness; the fact that it was needed is a reminder that our own trial must diff error output rather than assume clean behavior. Note that release notes give no detail on which false positives, under what inputs, or whether regression tests were added — so treat the fix as unverified from our side.
  • Security-theater risk. Passing static analysis proves nothing about actual redaction at runtime. The attribute only affects stack-trace rendering; the extension only affects type flow in the analyzer. Neither guarantees secrets never reach logs, dumps, or error trackers.
  • Maintenance risk. The 1.2.0 release demonstrates continued activity and a maintainer willing to take fixes (ildyria), which is better than a dormant repo. It does not change bus factor: a single-org package with no dependents whose priorities we cannot influence. The 1.0.1 → 1.2.0 changelog range also implies an intermediate version not represented in these notes, so version history is somewhat opaque — another argument for pinning exact versions.

Key questions.

  1. Which PHPStan versions and PHP versions are declared supported, and does that intersect our pinned versions — specifically, was the 1.2.0 fix made against a PHPStan major we actually run?
  2. What specific gap does this close versus our current PHPStan configuration — can we reproduce a concrete false negative it fixes?
  3. Which false positives did 1.2.0 remove, and are there fixtures or tests in-repo that encode them so we can verify the fix applies to our code shapes?
  4. Does it cover both SensitiveParameter and SensitiveParameterValue, including getValue() return-type flow and nested wrapping?
  5. How does it interact with our baseline file, ignore comments, and other extensions (strict rules, framework extensions)?
  6. What is the upstream maintenance posture — issue response, release cadence, willingness to accept PRs? (1.2.0 is one data point in favor.)
  7. What is our fallback if it breaks on the next PHPStan major: internal fork, local one-file extension, or drop it?
  8. Who internally owns this dependency?

Integration Approach

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.

  1. Inventory current use of #[SensitiveParameter] / #[SensitiveParameterValue] and identify the concrete analyzer gap.
  2. Trial on a short-lived branch with 1.2.0 pinned; capture before/after error counts and inspect every delta, paying specific attention to errors that disappear versus the previous attempt or the unextended baseline.
  3. Wire into CI in report-only mode for one iteration to surface surprises without blocking merges.
  4. Promote to blocking once the delta is stable and understood.
  5. Document the convention in engineering standards, including the explicit caveat that this is analyzer hygiene, not a runtime secret-handling control.
  6. Add the dependency to automated update tooling with a human review gate on PHPStan major bumps.

Operational Impact

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.

  • False positives block merges — 1.2.0 directly addresses this class of defect upstream, which lowers but does not eliminate the risk; a different code shape can still trip it. Mitigate with report-only soak and a narrow baseline entry if needed.
  • Silent false negatives after an upgrade — the extension stops matching and analysis quietly degrades, giving false assurance. Mitigate with a periodic effectiveness check against a known-bad fixture. This remains the primary residual risk and is untouched by 1.2.0.
  • Regression from a fix we did not scrutinize — a false-positive fix can, in principle, over-suppress and convert noise into silence. Mitigate by diffing both directions (new and removed errors) during the trial, not just confirming the count went down.
  • Upstream abandonment — mitigate with pinned version, fork rights under MIT, and a pre-written exit plan.
  • Semantic drift from upstream PHPStan — mitigate by re-evaluating native support at each major upgrade.
  • Treating the green check as proof of secret safety — the most dangerous failure mode because it is organizational, not technical. Mitigate in documentation and review guidance.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels