PHPackages                             swissspidy/phpstan-no-private - 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. swissspidy/phpstan-no-private

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

swissspidy/phpstan-no-private
=============================

PHPStan rules for detecting usage of pseudo-private functions, classes, and methods.

v1.0.0(1y ago)91.3M↑58.1%1[1 issues](https://github.com/swissspidy/phpstan-no-private/issues)20MITPHPPHP ^7.4 || ^8.0CI passing

Since May 14Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/swissspidy/phpstan-no-private)[ Packagist](https://packagist.org/packages/swissspidy/phpstan-no-private)[ RSS](/packages/swissspidy-phpstan-no-private/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (4)Dependencies (9)Versions (7)Used By (20)

Detect usage of pseudo-private code elements
============================================

[](#detect-usage-of-pseudo-private-code-elements)

[![Build](https://github.com/swissspidy/phpstan-no-private/workflows/Build/badge.svg)](https://github.com/swissspidy/phpstan-no-private/actions)[![Latest Stable Version](https://camo.githubusercontent.com/a07599cbffcc5a931555f2c0b78ad9f59e9a6fd96e50b85770b424cba8e760b5/68747470733a2f2f706f7365722e707567782e6f72672f737769737373706964792f7068707374616e2d6e6f2d707269766174652f762f737461626c65)](https://packagist.org/packages/swissspidy/phpstan-no-private)[![License](https://camo.githubusercontent.com/72c3a15cc498d5d6b2d203662f1d536914588fa0966584b82590cfb89a3da019/68747470733a2f2f706f7365722e707567782e6f72672f737769737373706964792f7068707374616e2d6e6f2d707269766174652f6c6963656e7365)](https://packagist.org/packages/swissspidy/phpstan-no-private)

This PHPStan extension emits deprecation warnings on code which uses properties/functions/methods/classes which are annotated as `@access private`.

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

[](#installation)

To use this extension, require it in [Composer](https://getcomposer.org/):

```
composer require --dev swissspidy/phpstan-no-private
```

If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set!

Manual installationIf you don't want to use `phpstan/extension-installer`, include rules.neon in your project's PHPStan config:

```
includes:
    - vendor/swissspidy/phpstan-no-private/rules.neon
```

Credits
-------

[](#credits)

This project is a fork of the excellent [phpstan/phpstan-deprecation-rules](https://github.com/phpstan/phpstan-deprecation-rules), which provides rules that detect usage of deprecated classes, methods, properties, constants and traits.

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance66

Regular maintenance activity

Popularity47

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.1% 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 ~182 days

Total

4

Last Release

600d ago

Major Versions

v0.2.1 → v1.0.02024-11-11

PHP version history (2 changes)v0.1.0PHP ^7.2 || ^8.0

v1.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/841956?v=4)[Pascal Birchler](/maintainers/swissspidy)[@swissspidy](https://github.com/swissspidy)

---

Top Contributors

[![swissspidy](https://avatars.githubusercontent.com/u/841956?v=4)](https://github.com/swissspidy "swissspidy (50 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (34 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (2 commits)")

---

Tags

phpstanphpstan-extension

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/swissspidy-phpstan-no-private/health.svg)

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

###  Alternatives

[larastan/larastan

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

6.5k55.4M8.4k](/packages/larastan-larastan)[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)[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.

4853.5M91](/packages/shipmonk-dead-code-detector)[spaze/phpstan-disallowed-calls

PHPStan rules to detect disallowed method &amp; function calls, constant, namespace, attribute, property &amp; superglobal usages, with powerful rules to re-allow a call or a usage in places where it should be allowed.

33422.6M551](/packages/spaze-phpstan-disallowed-calls)[tomasvotruba/cognitive-complexity

PHPStan rules to measure cognitive complexity of your classes and methods

1635.6M288](/packages/tomasvotruba-cognitive-complexity)

PHPackages © 2026

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