spencermalone/phpstan-no-transitive-use
最新稳定版本:v0.0.6
Composer 安装命令:
composer require spencermalone/phpstan-no-transitive-use
包简介
PHPStan extension to disallow transitive dependency use
README 文档
README
A PHPStan extension that disallows using classes from transitive dependencies.
Installation
composer require --dev spencermalone/phpstan-no-transitive-use
Usage
The extension will automatically be loaded when you run PHPStan. It will check all use statements in your code and report an error if you're trying to use a class from a transitive dependency.
For example, if your project depends on package A which depends on package B, and you try to use a class from package B directly, PHPStan will report an error.
Configuration
If you do not use phpstan/extension-installer, you need to add:
includes:
- vendor/spencermalone/phpstan-no-transitive-use/extension.neon
to your phpstan.neon
No additional configuration is needed if you use phpstan/extension-installer.
The extension automatically reads your composer.json to determine which dependencies are primary (directly required) and which are transitive.
Example
// This will cause an error if 'vendor/transitive/package' is not in your composer.json use Transitive\Package\SomeClass;
License
MIT
统计信息
- 总下载量: 1.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-26