PHPackages                             syntro/silverstripe-phpstan - 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. syntro/silverstripe-phpstan

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

syntro/silverstripe-phpstan
===========================

PHPStan for Silverstripe

5.0.1(9mo ago)639.9k↓82%8[7 issues](https://github.com/syntro-opensource/silverstripe-phpstan/issues)[6 PRs](https://github.com/syntro-opensource/silverstripe-phpstan/pulls)18BSD-3-ClausePHPPHP ~8.0CI passing

Since Apr 26Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/syntro-opensource/silverstripe-phpstan)[ Packagist](https://packagist.org/packages/syntro/silverstripe-phpstan)[ RSS](/packages/syntro-silverstripe-phpstan/feed)WikiDiscussions 5 Synced 2d ago

READMEChangelog (3)Dependencies (7)Versions (10)Used By (18)

PHPStan for Silverstripe
========================

[](#phpstan-for-silverstripe)

A module allowing PHPStan to work with Silverstripe.

[![🎭 Tests](https://github.com/syntro-opensource/silverstripe-phpstan/workflows/%F0%9F%8E%AD%20Tests/badge.svg)](https://github.com/syntro-opensource/silverstripe-phpstan/actions?query=workflow%3A%22%F0%9F%8E%AD+Tests%22+branch%3A%22master%22)[![codecov](https://camo.githubusercontent.com/c338b97590fe4fa23df5b11e6180206af59a0e6e658d3eae6fb54faf21b405e4/68747470733a2f2f636f6465636f762e696f2f67682f73796e74726f2d6f70656e736f757263652f73696c7665727374726970652d7068707374616e2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/syntro-opensource/silverstripe-phpstan)[![Dependabot](https://camo.githubusercontent.com/6a51b0751549261d7bac57cd594305fc5708bf907fc01b6f34aa97e914da4f6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646570656e6461626f742d6163746976652d627269676874677265656e3f6c6f676f3d646570656e6461626f74)](https://camo.githubusercontent.com/6a51b0751549261d7bac57cd594305fc5708bf907fc01b6f34aa97e914da4f6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646570656e6461626f742d6163746976652d627269676874677265656e3f6c6f676f3d646570656e6461626f74)[![phpstan](https://camo.githubusercontent.com/639cc050faeefad1a1d1ab830ca7a7950f1eede4402451b9a11cdc89d3a99066/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d73756363657373)](https://github.com/phpstan/phpstan)[![composer](https://camo.githubusercontent.com/63f7616ec4c559f57f071ce9d0d32095cea91e19ea2480f182574dc6d839d4e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73796e74726f2f73696c7665727374726970652d7068707374616e3f636f6c6f723d73756363657373266c6f676f3d636f6d706f736572)](https://packagist.org/packages/syntro/silverstripe-phpstan)[![Packagist Version](https://camo.githubusercontent.com/562bddcd5e2446314539dedcaed0832d6a24b116f6e3df171946261454e41a65/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73796e74726f2f73696c7665727374726970652d7068707374616e3f6c6162656c3d737461626c65266c6f676f3d636f6d706f736572)](https://packagist.org/packages/syntro/silverstripe-phpstan)

**Features:**

- Support for `DataObject::get()`, ie. it understands you have a DataList of iterable SiteTree records.
- Support for DataObject `db`, `has_one`, `has_many` and `many_many` magic properties and methods, ie. it knows SiteTree::Title is a string, that SiteTree::ParentID is an integer and that SiteTree::Parent() is a SiteTree record.
- Support for `singleton('SiteTree')` and `Injector::inst()->get('SiteTree')`, ie. it knows these will return "SiteTree". If you override these with the injector, it'll also know what class you're actually using.
- Support for config properties

This PHPStan module is able to reason about extensions installed specific to your project as it bootstraps the SilverStripe config system. So if you've added an extension to your `Page` object that adds an additional `db` field, PHPStan will be able to reason about it.

Composer Install
----------------

[](#composer-install)

SilverStripe 5.X

```
composer require --dev syntro/silverstripe-phpstan ^5

```

> For Silverstripe 4, see [the corresponding branch](https://github.com/syntro-opensource/silverstripe-phpstan/tree/4).

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

[](#requirements)

- SilverStripe 5.0+

Documentation
-------------

[](#documentation)

- [Quick Start](docs/en/quick-start.md)
- [Advanced Usage](docs/en/advanced-usage.md)
- [License](LICENSE.md)

Known Limitations / Gotchas
---------------------------

[](#known-limitations--gotchas)

- PHPStan checks if properties are actually initialized, read and written. This however does not apply to Silverstripes [configuration properties](https://docs.silverstripe.org/en/4/developer_guides/configuration/configuration/#configuration-properties). In order to tell PHPStan which of your properties are configuration values, you have to use the [`@config` docblock](https://docs.silverstripe.org/en/5/developer_guides/configuration/configuration/#configuration-properties).
- The type of the `owner` property can't be reasoned about for extensions. You must use `getOwner()`. Related Issues: [\#1043](https://github.com/phpstan/phpstan/issues/1043) and [\#1044](https://github.com/phpstan/phpstan/issues/1044)

Credits
-------

[](#credits)

This is a fork of the original `symbiote/silverstripe-phpstan` maintained by [Symbiote &amp; Contributors](https://github.com/symbiote/silverstripe-phpstan). We have created this, as the original repository seems to be no longer actively maintained.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community28

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 74.2% 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 ~206 days

Total

7

Last Release

289d ago

Major Versions

0.0.0 → 1.0.02022-04-30

1.0.0 → 5.0.02023-06-28

4.x-dev → 5.0.12025-09-17

5.x-dev → 6.x-dev2025-09-17

PHP version history (2 changes)0.0.0PHP ~7.1 || ~8.0

5.0.0PHP ~8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/289446336e84f3a201ac80def6e4a2a5289815d628ad5e0c0aa57b2f4bc20e73?d=identicon)[mleutenegger](/maintainers/mleutenegger)

---

Top Contributors

[![mleutenegger](https://avatars.githubusercontent.com/u/1339379?v=4)](https://github.com/mleutenegger "mleutenegger (49 commits)")[![silbinarywolf](https://avatars.githubusercontent.com/u/3859574?v=4)](https://github.com/silbinarywolf "silbinarywolf (11 commits)")[![erikfrerejean](https://avatars.githubusercontent.com/u/197732?v=4)](https://github.com/erikfrerejean "erikfrerejean (1 commits)")[![grantlucas](https://avatars.githubusercontent.com/u/215729?v=4)](https://github.com/grantlucas "grantlucas (1 commits)")[![Cambis](https://avatars.githubusercontent.com/u/12287346?v=4)](https://github.com/Cambis "Cambis (1 commits)")[![satrun77](https://avatars.githubusercontent.com/u/166450?v=4)](https://github.com/satrun77 "satrun77 (1 commits)")[![michalkleiner](https://avatars.githubusercontent.com/u/233342?v=4)](https://github.com/michalkleiner "michalkleiner (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

phpPHPStansilverstripestaticanalysisscrutinizer

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/syntro-silverstripe-phpstan/health.svg)

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

###  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)[silverstripe/cms

The SilverStripe Content Management System

5253.6M1.4k](/packages/silverstripe-cms)[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)[symbiote/silverstripe-phpstan

PHPStan for Silverstripe

1223.8k15](/packages/symbiote-silverstripe-phpstan)[silverstripe/admin

SilverStripe admin interface

262.8M383](/packages/silverstripe-admin)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

15118.7k4](/packages/calebdw-larastan)

PHPackages © 2026

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