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

Abandoned → [symbiote/silverstripe-phpstan](/?search=symbiote%2Fsilverstripe-phpstan)Library[Testing &amp; Quality](/categories/testing)

silbinarywolf/silverstripe-phpstan
==================================

PHPStan for Silverstripe

3.0.2(7y ago)06.4kBSD-3-ClausePHPPHP ~7.0

Since Oct 25Pushed 7y agoCompare

[ Source](https://github.com/SilbinaryWolf/silverstripe-phpstan)[ Packagist](https://packagist.org/packages/silbinarywolf/silverstripe-phpstan)[ RSS](/packages/silbinarywolf-silverstripe-phpstan/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (5)Versions (15)Used By (0)

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

```

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

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 84.6% 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 ~33 days

Recently: every ~58 days

Total

14

Last Release

2687d 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

### Community

Maintainers

![](https://www.gravatar.com/avatar/91f71cbb05b87b3051e0d0680314bef897a7a26d73e553fad71442c2f5098552?d=identicon)[SilbinaryWolf](/maintainers/SilbinaryWolf)

---

Top Contributors

[![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

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

A static analyzer for PHP

5.6k11.2M1.1k](/packages/phan-phan)[symbiote/silverstripe-phpstan

PHPStan for Silverstripe

1223.7k14](/packages/symbiote-silverstripe-phpstan)[yamadashy/phpstan-friendly-formatter

Simple error formatter for PHPStan that display code frame

64573.8k34](/packages/yamadashy-phpstan-friendly-formatter)[silverstripe/frameworktest

Aids core and module developers in testing their code against a set of sample data and behaviour.

17304.6k23](/packages/silverstripe-frameworktest)

PHPackages © 2026

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