PHPackages                             samlitowitz/no-globals - 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. samlitowitz/no-globals

ActiveLibrary[Testing &amp; Quality](/categories/testing)

samlitowitz/no-globals
======================

PHPStan rules to disallow use of global keyword and $GLOBALS variable

v1.1(7y ago)03MITPHP

Since Apr 19Pushed 7y agoCompare

[ Source](https://github.com/samlitowitz/no-globals)[ Packagist](https://packagist.org/packages/samlitowitz/no-globals)[ RSS](/packages/samlitowitz-no-globals/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

PHPStan rules to disallow use of global keyword and $GLOBALS variable
=====================================================================

[](#phpstan-rules-to-disallow-use-of-global-keyword-and-globals-variable)

[![Build Status](https://camo.githubusercontent.com/27370d63afa4c77e8ea2d2f43106515d6968a66da1adcda3a46d05ecf8599892/68747470733a2f2f7472617669732d63692e6f72672f73616d6c69746f7769747a2f6e6f2d676c6f62616c732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/samlitowitz/no-globals)

Usage
=====

[](#usage)

To use these rules, require it via [Composer](https://getcomposer.org/)

```
composer require samlitowitz/no-globals --dev

```

Include rules.neon in your project's PHPStan config

```
includes:
    - vendor/samlitowitz/no-globals/rules.neon

```

###  Health Score

26

—

LowBetter than 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

2

Last Release

2674d ago

### Community

Maintainers

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

---

Top Contributors

[![samlitowitz](https://avatars.githubusercontent.com/u/4641296?v=4)](https://github.com/samlitowitz "samlitowitz (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/samlitowitz-no-globals/health.svg)

```
[![Health](https://phpackages.com/badges/samlitowitz-no-globals/health.svg)](https://phpackages.com/packages/samlitowitz-no-globals)
```

###  Alternatives

[larastan/larastan

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

6.5k60.6M10.3k](/packages/larastan-larastan)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

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

Symfony Framework extensions and rules for PHPStan

79378.2M2.5k](/packages/phpstan-phpstan-symfony)[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.2M110](/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.

33923.4M627](/packages/spaze-phpstan-disallowed-calls)[mglaman/phpstan-drupal

Drupal extension and rules for PHPStan

20832.2M213](/packages/mglaman-phpstan-drupal)

PHPackages © 2026

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