PHPackages                             spencermalone/phpstan-no-transitive-use - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. spencermalone/phpstan-no-transitive-use

ActivePhpstan-extension[Testing &amp; Quality](/categories/testing)

spencermalone/phpstan-no-transitive-use
=======================================

PHPStan extension to disallow transitive dependency use

v0.0.6(1y ago)172.2k↓26.9%12MITPHPPHP &gt;=7.4

Since May 27Pushed 1y agoCompare

[ Source](https://github.com/SpencerMalone/phpstan-no-transitive-use)[ Packagist](https://packagist.org/packages/spencermalone/phpstan-no-transitive-use)[ RSS](/packages/spencermalone-phpstan-no-transitive-use/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (6)Dependencies (4)Versions (7)Used By (2)

PHPStan No Transitive Use
=========================

[](#phpstan-no-transitive-use)

A PHPStan extension that disallows using classes from transitive dependencies.

Installation
------------

[](#installation)

```
composer require --dev spencermalone/phpstan-no-transitive-use
```

Usage
-----

[](#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
-------------

[](#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
-------

[](#example)

```
// This will cause an error if 'vendor/transitive/package' is not in your composer.json
use Transitive\Package\SomeClass;
```

License
-------

[](#license)

MIT

###  Health Score

31

—

LowBetter than 65% of packages

Maintenance43

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

446d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/db45795e5fe66f5c9e010b76a67e0fc42e20acab2061554ca72d2b8b7426e5df?d=identicon)[SpencerMalone](/maintainers/SpencerMalone)

---

Top Contributors

[![SpencerMalone](https://avatars.githubusercontent.com/u/8786752?v=4)](https://github.com/SpencerMalone "SpencerMalone (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/spencermalone-phpstan-no-transitive-use/health.svg)

```
[![Health](https://phpackages.com/badges/spencermalone-phpstan-no-transitive-use/health.svg)](https://phpackages.com/packages/spencermalone-phpstan-no-transitive-use)
```

###  Alternatives

[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2613.3M489](/packages/ssch-typo3-rector)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67475.0M1.6k](/packages/phpstan-phpstan-doctrine)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79378.2M2.5k](/packages/phpstan-phpstan-symfony)[phparkitect/phparkitect

Enforce architectural constraints in your PHP applications

9244.5M32](/packages/phparkitect-phparkitect)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136411.0k14](/packages/rector-rector-src)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

5014.2M111](/packages/shipmonk-dead-code-detector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
