https://github.com/deprecated-packages/phpstan-cakephp-2
[WIP] PHPStan extension for CakePHP 2 running on PHP 8.0+
https://github.com/deprecated-packages/phpstan-cakephp-2
cakephp phpstan static-analysis
Last synced: 7 months ago
JSON representation
[WIP] PHPStan extension for CakePHP 2 running on PHP 8.0+
- Host: GitHub
- URL: https://github.com/deprecated-packages/phpstan-cakephp-2
- Owner: deprecated-packages
- License: mit
- Created: 2024-02-18T11:22:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-18T22:24:15.000Z (over 1 year ago)
- Last Synced: 2025-02-11T12:29:00.672Z (9 months ago)
- Topics: cakephp, phpstan, static-analysis
- Language: PHP
- Homepage:
- Size: 128 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# PHPStan extension for CakePHP 2
PHPStan extensions to help test CakePHP 2 projects with PHPStan
## Installation
```shell
composer require tomasvotruba/phpstan-cakephp-2 --dev
```
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:
```yaml
# phpstan.neon
parameters:
behaviorPaths:
- vendor/my-vendor/my-plugin/src/Model/Behavior/*.php
```
See `extension.neon` for the default list of behavior locations.
## Features
* 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