PHPackages                             mglaman/phpstan-civicrm - 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. mglaman/phpstan-civicrm

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

mglaman/phpstan-civicrm
=======================

Extension for \[PHPStan\](https://phpstan.org) to allow static analysis of CiviCRM.

0.12.0(5y ago)222MITPHPPHP ^7.1

Since Nov 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mglaman/phpstan-civicrm)[ Packagist](https://packagist.org/packages/mglaman/phpstan-civicrm)[ GitHub Sponsors](https://github.com/mglaman)[ Fund](https://ko-fi.com/mglaman)[ RSS](/packages/mglaman-phpstan-civicrm/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

phpstan-civicrm
===============

[](#phpstan-civicrm)

Extension for [PHPStan](https://phpstan.org) to allow static analysis of CiviCRM.

Sponsors
--------

[](#sponsors)

The PHPStan CiviCRM was created through a sponsorship by [Megaphone Technology Consulting](https://megaphonetech.com/) 🎉

Configuration
-------------

[](#configuration)

To use the PHPStan CiviCRM extension, you must define the root location of CiviCRM.

```
parameters:
    civicrm:
        root: sites/all/modules/civicrm

```

The default value expects CiviCRM to live in the Composer vendor directory, like it does for Drupal 8.

```
%currentWorkingDirectory%/vendor/civicrm/civicrm-core

```

The `civicrm.root` parameter this is equal to `$civicrm_root` as defined in the CMS integration settings. Here are some examples assuming your CMS is installed at `/var/www/htdocs`.

- Drupal 7: `/var/www/htdocs/drupal/sites/all/modules/civicrm/`
- Drupal 8: `/vendor/civicrm/civicrm-core`
- Backdrop: `/var/www/htdocs/backdrop/modules/civicrm/`
- Joomla: `/var/www/htdocs/joomla/administrator/components/com_civicrm/civicrm/`
- WordPress: `/var/www/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/`

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity38

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

Unknown

Total

1

Last Release

2015d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98c03d4d2a6aa9b5ecdfc565e8f90f53f0a8f6c2757048a148b34b166d78266c?d=identicon)[mglaman](/maintainers/mglaman)

---

Top Contributors

[![mglaman](https://avatars.githubusercontent.com/u/3698644?v=4)](https://github.com/mglaman "mglaman (8 commits)")

---

Tags

civicrmphpstanphpstan-extension

###  Code Quality

TestsPHPUnit

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mglaman-phpstan-civicrm/health.svg)

```
[![Health](https://phpackages.com/badges/mglaman-phpstan-civicrm/health.svg)](https://phpackages.com/packages/mglaman-phpstan-civicrm)
```

###  Alternatives

[larastan/larastan

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

6.4k43.5M5.2k](/packages/larastan-larastan)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

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

Doctrine extensions for PHPStan

66466.6M1.0k](/packages/phpstan-phpstan-doctrine)[phpat/phpat

PHP Architecture Tester

1.2k3.5M32](/packages/phpat-phpat)[mglaman/phpstan-drupal

Drupal extension and rules for PHPStan

20729.0M123](/packages/mglaman-phpstan-drupal)[ekino/phpstan-banned-code

Detected banned code using PHPStan

2925.6M92](/packages/ekino-phpstan-banned-code)

PHPackages © 2026

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