PHPackages                             lordsimal/cakephp-psalm - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lordsimal/cakephp-psalm

ActivePsalm-plugin[Utility &amp; Helpers](/categories/utility)

lordsimal/cakephp-psalm
=======================

A psalm-plugin for CakePHP

2.1.0(1y ago)212.9k↓12.5%MITPHP

Since Jul 17Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/LordSimal/cakephp-psalm)[ Packagist](https://packagist.org/packages/lordsimal/cakephp-psalm)[ RSS](/packages/lordsimal-cakephp-psalm/feed)WikiDiscussions 1.x Synced 1mo ago

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

Psalm plugin for CakePHP
========================

[](#psalm-plugin-for-cakephp)

[![Latest Stable Version](https://camo.githubusercontent.com/7939e4dbcd469efc55f8b096c2f9a62f3bec398832472bd93182deea16be4729/68747470733a2f2f706f7365722e707567782e6f72672f6c6f726473696d616c2f63616b657068702d7073616c6d2f76)](https://packagist.org/packages/lordsimal/cakephp-psalm) [![Total Downloads](https://camo.githubusercontent.com/1a09a330b70b1c6f65d8082848965ef035f9b0ad443ce468c869949e585e6ac9/68747470733a2f2f706f7365722e707567782e6f72672f6c6f726473696d616c2f63616b657068702d7073616c6d2f646f776e6c6f616473)](https://packagist.org/packages/lordsimal/cakephp-psalm) [![Latest Unstable Version](https://camo.githubusercontent.com/003dc92571640d550ce11e465c3347f700cfd3f6eb597d4a091060c5f73cfac8/68747470733a2f2f706f7365722e707567782e6f72672f6c6f726473696d616c2f63616b657068702d7073616c6d2f762f756e737461626c65)](https://packagist.org/packages/lordsimal/cakephp-psalm) [![License](https://camo.githubusercontent.com/245fbca1266579d96d42effcf69f2e0dd814abb5935d33f76e95985684eb50db/68747470733a2f2f706f7365722e707567782e6f72672f6c6f726473696d616c2f63616b657068702d7073616c6d2f6c6963656e7365)](https://packagist.org/packages/lordsimal/cakephp-psalm)

Overview
--------

[](#overview)

This plugin provides correct return types for CakePHP specific methods in psalm.

Quickstart
----------

[](#quickstart)

Please refer to the [full Psalm documentation](https://psalm.dev/quickstart) for a more detailed guide on how to use Psalm in your project.

First you need to install the psalm base package and create a `psalm.xml`

```
composer require --dev vimeo/psalm
./vendor/bin/psalm --init
```

Next you will need to require this package and enable it in psalm

```
composer require --dev lordsimal/cakephp-psalm
./vendor/bin/psalm-plugin enable lordsimal/cakephp-psalm
```

Finally you can try it out

```
./vendor/bin/psalm
```

How it works
------------

[](#how-it-works)

Currently only the following return types are being corrected:

- `Cake\ORM\Locator\LocatorInterface::get()`
- `Cake\ORM\Locator\LocatorAwareTrait::fetchTable()`

The functionality for this can be found in `src/Type/TableLocatorHandler.php`

In there the `getClassLikeNames()` tells psalm on which classes it needs to change return types.

In the `getMethodReturnType()` we check which method is currently called and get the first argument value from that call.

With that value we get the "real" FQCN of the table which is returned in runtime and tell psalm to use that instead of the default `Cake\ORM\Table`.

Help needed
-----------

[](#help-needed)

I would definitely appreciate help related to the following aspects of this plugin:

- Testing
- Including more return types like [CakeDC/cakephp-phpstan](https://github.com/CakeDC/cakephp-phpstan) already does for PHPStan

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance57

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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

Every ~214 days

Total

5

Last Release

178d ago

Major Versions

1.0.0 → 2.0.02023-09-10

1.x-dev → 2.1.02025-01-26

### Community

Maintainers

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

---

Top Contributors

[![LordSimal](https://avatars.githubusercontent.com/u/9105243?v=4)](https://github.com/LordSimal "LordSimal (10 commits)")

---

Tags

cakephpphppsalm-plugin

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/lordsimal-cakephp-psalm/health.svg)

```
[![Health](https://phpackages.com/badges/lordsimal-cakephp-psalm/health.svg)](https://phpackages.com/packages/lordsimal-cakephp-psalm)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

338920.1k32](/packages/dereuromark-cakephp-tools)[php-standard-library/psalm-plugin

Psalm plugin for the PHP Standard Library

252.0M47](/packages/php-standard-library-psalm-plugin)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

2988.9k3](/packages/dereuromark-cakephp-dto)[havokinspiration/wrench

Maintenance mode plugin for CakePHP 3.X

2661.2k](/packages/havokinspiration-wrench)[admad/cakephp-tree

CakPHP plugin for working with tree structures.

11286.5k](/packages/admad-cakephp-tree)

PHPackages © 2026

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