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

ActiveLibrary

pieceofcake2/phpstan-cakephp2
=============================

An extension to help test CakePHP 2 projects with PHPStan

v0.2.1(7mo ago)06.3k1[1 PRs](https://github.com/pieceofcake2/phpstan-cakephp2/pulls)20MITPHPPHP ^8.0CI passing

Since Oct 5Pushed 7mo agoCompare

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

READMEChangelogDependencies (5)Versions (2)Used By (20)

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

[](#phpstan-cakephp2)

[![GitHub License](https://camo.githubusercontent.com/9fe2c644d69aedd84a9c3b18159980f655a0856d2e227c53e82e43bf772337d9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70696563656f6663616b65322f7068707374616e2d63616b65706870323f6c6162656c3d4c6963656e7365)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/eff62a398ad198d95078afb413944d81a75a1083b4ff9a1f8a8fad8e586a4d57/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70696563656f6663616b65322f7068707374616e2d63616b65706870323f6c6162656c3d5061636b6167697374)](https://packagist.org/packages/pieceofcake2/phpstan-cakephp2)[![PHP](https://camo.githubusercontent.com/a5e2a475a9a4fb7530f3f5c54da2501b2a67dc2bab0bf0998b46d2b64ad7c41b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f70696563656f6663616b65322f7068707374616e2d63616b65706870322f7068703f6c6f676f3d706870266c6f676f436f6c6f723d253233464646464646266c6162656c3d504850266c6162656c436f6c6f723d25323337373742423426636f6c6f723d253233464646464646)](https://packagist.org/packages/pieceofcake2/phpstan-cakephp2)[![Tests](https://camo.githubusercontent.com/07934a7df4587e346050dc4c31412ca5f90b77b833f3020287ea725c23652892/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70696563656f6663616b65322f7068707374616e2d63616b65706870322f43492e796d6c3f6c6162656c3d4349)](https://github.com/pieceofcake2/phpstan-cakephp2/actions/workflows/tests.yml)[![Codecov](https://camo.githubusercontent.com/1e5c857333f6c4631d1fa83245518c0d05c5cdc835e4c7a66204e8b06bc5431c/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f70696563656f6663616b65322f7068707374616e2d63616b65706870323f6c6162656c3d436f766572616765)](https://codecov.io/gh/pieceofcake2/phpstan-cakephp2)

PHPStan extensions to help test CakePHP 2 projects with PHPStan

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

[](#requirements)

- PHP 8.0+
- phpstan/phpstan 1.9+
- pieceofcake2/cakephp 2.x

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

[](#installation)

Installation is best done through composer:

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

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

```
# phpstan.neon
includes:
  - vendor/pieceofcake2/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 80% of packages

Maintenance64

Regular maintenance activity

Popularity22

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50.8% 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

216d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35c2da973a64a21e8d23c221c1d284e4f1a04a74123318a978147e42a29eda23?d=identicon)[ttsuru](/maintainers/ttsuru)

---

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 (23 commits)")[![ttsuru](https://avatars.githubusercontent.com/u/578548?v=4)](https://github.com/ttsuru "ttsuru (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/pieceofcake2-phpstan-cakephp2/health.svg)](https://phpackages.com/packages/pieceofcake2-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-doctrine

Doctrine extensions for PHPStan

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

PHP Architecture Tester

1.2k3.5M32](/packages/phpat-phpat)[ekino/phpstan-banned-code

Detected banned code using PHPStan

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

PHPStan rule for static analysis of Blade templates

363584.5k4](/packages/tomasvotruba-bladestan)[ticketswap/phpstan-error-formatter

A minimalistic error formatter for PHPStan

87578.8k35](/packages/ticketswap-phpstan-error-formatter)

PHPackages © 2026

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