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

ActiveLibrary

symbiote/silverstripe-phpstan
=============================

PHPStan for Silverstripe

4.0.0(6y ago)1223.7k↓100%12[6 issues](https://github.com/symbiote/silverstripe-phpstan/issues)14BSD-3-ClausePHPPHP ~7.1CI failing

Since Oct 25Pushed 5y ago2 watchersCompare

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

READMEChangelog (9)Dependencies (6)Versions (17)Used By (14)

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

[](#phpstan-for-silverstripe)

[![Build Status](https://camo.githubusercontent.com/895278c45887cb69c2582c79f201bb647de6e808d1527701020d23a09f97a157/68747470733a2f2f7472617669732d63692e6f72672f73796d62696f74652f73696c7665727374726970652d7068707374616e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/symbiote/silverstripe-phpstan)[![Latest Stable Version](https://camo.githubusercontent.com/b7a6ef850f42b29ba004147ea684b0bbd0417aa3049ff7eb4cc189f2f82e2283/68747470733a2f2f706f7365722e707567782e6f72672f73796d62696f74652f73696c7665727374726970652d7068707374616e2f76657273696f6e2e737667)](https://github.com/symbiote/silverstripe-phpstan/releases)[![Latest Unstable Version](https://camo.githubusercontent.com/d696582fbc5975937d73f6dc6e7409019f7ab2c90300aa05e0e44a1f49c427df/68747470733a2f2f706f7365722e707567782e6f72672f73796d62696f74652f73696c7665727374726970652d7068707374616e2f762f756e737461626c652e737667)](https://packagist.org/packages/symbiote/silverstripe-phpstan)[![Total Downloads](https://camo.githubusercontent.com/d54d0c4632ee139687388a65603ee2e7715b111b3d4804e6ed24b520cb9354bc/68747470733a2f2f706f7365722e707567782e6f72672f73796d62696f74652f73696c7665727374726970652d7068707374616e2f646f776e6c6f6164732e737667)](https://packagist.org/packages/symbiote/silverstripe-phpstan)[![License](https://camo.githubusercontent.com/f0ccdd55e0c3a1438c4e408c8ce562860135ff71881e48651d6fea045947b078/68747470733a2f2f706f7365722e707567782e6f72672f73796d62696f74652f73696c7665727374726970652d7068707374616e2f6c6963656e73652e737667)](https://github.com/symbiote/silverstripe-phpstan/blob/master/LICENSE.md)

An extension for PHPStan to allow it to reason about SilverStripe functionality.

**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.

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 3.X

```
composer require --dev symbiote/silverstripe-phpstan:1.0.0 phpstan/phpstan-shim:0.9.2

```

SilverStripe 4.X

```
composer require --dev symbiote/silverstripe-phpstan:2.0.0 phpstan/phpstan-shim:~0.11.0

```

NOTE: We recommend installing the phpstan-shim as currently in SilverStripe 3.X, the QueuedJobs module's dependence on superclosure forces the PHP-Parser dependency of PHPStan to be at a very outdated version.

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

[](#requirements)

- SilverStripe 3.1+

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

[](#documentation)

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

Known Limitations
-----------------

[](#known-limitations)

- 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)

- [Ondřej Mirtes](https://github.com/ondrejmirtes) for his amazing work on the PHPStan library
- [Grant Lucas](https://github.com/symbiote/silverstripe-phpstan/pull/8) for his contribution to this library by upgrading it to PHPStan 0.9

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 69% 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 ~49 days

Recently: every ~107 days

Total

16

Last Release

2370d ago

Major Versions

0.5.1 → 1.0.02018-05-20

1.x-dev → 2.0.02018-05-20

2.0.1 → 3.0.02018-09-07

3.0.x-dev → 4.0.02019-11-11

PHP version history (2 changes)0.1.0PHP ~7.0

4.0.0PHP ~7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23506857?v=4)[Symbiote](/maintainers/symbiote)[@symbiote](https://github.com/symbiote)

---

Top Contributors

[![mleutenegger](https://avatars.githubusercontent.com/u/1339379?v=4)](https://github.com/mleutenegger "mleutenegger (29 commits)")[![silbinarywolf](https://avatars.githubusercontent.com/u/3859574?v=4)](https://github.com/silbinarywolf "silbinarywolf (11 commits)")[![grantlucas](https://avatars.githubusercontent.com/u/215729?v=4)](https://github.com/grantlucas "grantlucas (1 commits)")[![michalkleiner](https://avatars.githubusercontent.com/u/233342?v=4)](https://github.com/michalkleiner "michalkleiner (1 commits)")

---

Tags

phpPHPStansilverstripestaticanalysisscrutinizer

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

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

Static publishing queue to create static versions of pages for enhanced performance and security

45135.4k4](/packages/silverstripe-staticpublishqueue)

PHPackages © 2026

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