Download the PHP package built-fast/phpstan-sensitive-parameter without Composer

On this page you can find all versions of the php package built-fast/phpstan-sensitive-parameter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpstan-sensitive-parameter

PHPStan SensitiveParameter Detector

CI Latest Stable Version Total Downloads License

A PHPStan extension that detects parameters that might contain sensitive information and should be marked with the #[\SensitiveParameter] attribute (added in PHP 8.2+).

About SensitiveParameter

The #[\SensitiveParameter] attribute was introduced in PHP 8.2 to mark sensitive data that should be hidden from stack traces and debugging output. This extension helps you identify parameters that should use this attribute for better security.

Learn more: PHP RFC: Redact parameters in back traces

Requirements

Installation

Usage

The extension will be automatically registered if you use PHPStan's extension installer.

Alternatively, include the extension in your PHPStan configuration:

What it detects

The rule detects parameters with names containing common sensitive keywords:

Note: Due to substring matching, secret catches apisecret/clientsecret and token catches refreshtoken/accesstoken.

It works with:

Examples

❌ Will trigger warnings:

✅ Properly protected:

Advanced Configuration

To use custom sensitive keywords instead of the defaults, override the service:

This completely replaces the default keyword list with your own.

Suppressing Warnings

You can suppress warnings using PHPStan's ignore comments:

Constructor Parameters

Due to a PHPStan limitation, ignore comments for constructor parameters must be placed before the constructor:

Note: This ignores ALL parameter warnings for that constructor. For functions with multiple parameters where only some are false positives, consider renaming the problematic parameter to avoid the sensitive keyword match.

Common Issues

False Positives

The rule uses substring matching, which can occasionally trigger false positives:

For these cases, use ignore comments as shown above or consider renaming parameters to be more specific (e.g., $applicationToInstall, $authService, $verificationMethod).

Reporting Issues

Found a bug or have a feature request? Please report it on GitHub.

When reporting issues, please include:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development setup:

Running tests:

License

MIT License - see LICENSE for details.


All versions of phpstan-sensitive-parameter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
phpstan/phpstan Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package built-fast/phpstan-sensitive-parameter contains the following files

Loading the files please wait ....