定制 spencermalone/phpstan-no-transitive-use 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 16
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固