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)162.1k↓28.1%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 yesterday

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 66% of packages

Maintenance46

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity31

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

401d 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.

2603.2M435](/packages/ssch-typo3-rector)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.4k](/packages/larastan-larastan)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k101.8M2.2k](/packages/behat-behat)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79475.7M2.2k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67272.8M1.4k](/packages/phpstan-phpstan-doctrine)[phparkitect/phparkitect

Enforce architectural constraints in your PHP applications

9224.3M28](/packages/phparkitect-phparkitect)

PHPackages © 2026

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