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)28.7k↓70.8%1MITPHPPHP ^7.4CI passing

Since Jan 28Pushed 5mo 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 yesterday

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

35

—

LowBetter than 77% of packages

Maintenance56

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity37

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

534d 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.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.6M550](/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)
