PHPackages                             sidz/phpstan-cakephp2 - 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. sidz/phpstan-cakephp2

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

sidz/phpstan-cakephp2
=====================

An extension to help test CakePHP 2 projects with PHPStan

0.2.0(1y ago)27.9k↓44.8%1MITPHPPHP ^7.4CI passing

Since Jan 28Pushed 4mo agoCompare

[ Source](https://github.com/sidz/phpstan-cakephp2)[ Packagist](https://packagist.org/packages/sidz/phpstan-cakephp2)[ RSS](/packages/sidz-phpstan-cakephp2/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (5)Versions (8)Used By (0)

PHPStan-CakePHP2
================

[](#phpstan-cakephp2)

PHPStan extensions to help test CakePHP 2 projects with PHPStan

Requirements
------------

[](#requirements)

- PHP 7.4
- phpstan/phpstan 2.x
- cakephp/cakephp 2.x

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

[](#installation)

Installation is best done through composer:

```
composer require --dev sidz/phpstan-cakephp2
```

You will need to make sure the extension is included in your phpstan config:

```
# phpstan.neon
includes:
  - vendor/sidz/phpstan-cakephp2/extension.neon
```

If you have behavior classes in odd locations (perhaps in a vendor directory) you will need to add those locations to your configuration. For example:

```
# phpstan.neon
parameters:
  ModelBehaviorsExtension:
    behaviorPaths:
      - vendor/my-vendor/my-plugin/src/Model/Behavior/*.php
```

See `extension.neon` for the default list of behavior locations.

Features
--------

[](#features)

The following features are added to PHPStan:

- Treat behavior methods as extra methods on all models (`$model->behaviorMethod()`)
- Treat controller properties named after model classes as instances of those classes (`$controller->Model`)
- Treat controller properties named after component classes as instances of those classes (`$controller->Component`)
- Treat component properties names after component classes as instances of those classes (`$component->Component`)
- Treat `ClassRegistry::init($className)` as returning an instance of `$className` where possible

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance61

Regular maintenance activity

Popularity28

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 55.9% 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 ~58 days

Recently: every ~88 days

Total

7

Last Release

488d ago

### Community

Maintainers

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

---

Top Contributors

[![ariddlestone](https://avatars.githubusercontent.com/u/1448695?v=4)](https://github.com/ariddlestone "ariddlestone (33 commits)")[![sidz](https://avatars.githubusercontent.com/u/1302230?v=4)](https://github.com/sidz "sidz (26 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sidz-phpstan-cakephp2/health.svg)

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

###  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

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

Doctrine extensions for PHPStan

66766.6M1.1k](/packages/phpstan-phpstan-doctrine)[phpat/phpat

PHP Architecture Tester

1.2k3.5M32](/packages/phpat-phpat)[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.

33320.0M375](/packages/spaze-phpstan-disallowed-calls)[mglaman/phpstan-drupal

Drupal extension and rules for PHPStan

20829.0M124](/packages/mglaman-phpstan-drupal)

PHPackages © 2026

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