PHPackages                             valkyrja/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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. valkyrja/phpstan

ActiveProject[DevOps &amp; Deployment](/categories/devops)

valkyrja/phpstan
================

PHPStan for the Valkyrja Project.

v26.1.7(1w ago)01.9k↓27.7%MITPHPPHP &gt;=8.4CI passing

Since Apr 16Pushed 1w agoCompare

[ Source](https://github.com/valkyrjaio/ci-phpstan-php)[ Packagist](https://packagist.org/packages/valkyrja/phpstan)[ Docs](https://www.valkyrja.io/)[ RSS](/packages/valkyrja-phpstan/feed)WikiDiscussions 26.x Synced 1w ago

READMEChangelog (10)Dependencies (1)Versions (22)Used By (0)

[ ![](https://raw.githubusercontent.com/valkyrjaio/art/refs/heads/master/long-banner/orange/php.png)](https://valkyrja.io)

Valkyrja PHPStan
================

[](#valkyrja-phpstan)

Shared PHPStan configuration for Valkyrja PHP projects — a reference configuration and reusable workflow that enforce consistent static analysis across consuming repositories.

 [![PHP Version Require](https://camo.githubusercontent.com/ef73093e17d1bf77617ee5c71f4d1956f0a33b6aad69bd0424bb05ce8da401df/68747470733a2f2f706f7365722e707567782e6f72672f76616c6b79726a612f7068707374616e2f726571756972652f706870)](https://packagist.org/packages/valkyrja/phpstan) [![Latest Stable Version](https://camo.githubusercontent.com/f1d18a98bd75163cd725834476dec975147da7926d3e5182586145ee8a8db7eb/68747470733a2f2f706f7365722e707567782e6f72672f76616c6b79726a612f7068707374616e2f76)](https://packagist.org/packages/valkyrja/phpstan) [![License](https://camo.githubusercontent.com/11b395b07eab4f6a7a8d18625ac20a34bb3d3a6e9c3110b574a8ff3c00a66366/68747470733a2f2f706f7365722e707567782e6f72672f76616c6b79726a612f7068707374616e2f6c6963656e7365)](https://packagist.org/packages/valkyrja/phpstan) [![CI Status](https://github.com/valkyrjaio/ci-phpstan-php/actions/workflows/ci.yml/badge.svg?branch=26.x)](https://github.com/valkyrjaio/ci-phpstan-php/actions/workflows/ci.yml?query=branch%3A26.x) [![Scrutinizer](https://camo.githubusercontent.com/48764400f73180718fafb9daaf34b57fc3abc3530020f4cd0fb0ea70d6195fd3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f76616c6b79726a61696f2f7068707363692d7068707374616e2d70687074616e2f6261646765732f7175616c6974792d73636f72652e706e673f623d32362e78)](https://scrutinizer-ci.com/g/valkyrjaio/ci-phpstan-php/?branch=26.x) [![Coverage Status](https://camo.githubusercontent.com/1e2e48264aa21d382504b20332cce9cdb9c4955765bb9717255dbf45e34fe139/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f76616c6b79726a61696f2f63692d7068707374616e2d7068702f62616467652e7376673f6272616e63683d32362e78)](https://coveralls.io/github/valkyrjaio/ci-phpstan-php?branch=26.x) [![Psalm Shepherd](https://camo.githubusercontent.com/c56bf7a0963b3fa825892613fe718d61a2f7814d9fc7b4575fdabbe37769dd82/68747470733a2f2f73686570686572642e6465762f6769746875622f76616c6b79726a61696f2f63692d7068707374616e2d7068702f636f7665726167652e737667)](https://shepherd.dev/github/valkyrjaio/ci-phpstan-php) [![Maintainability Rating](https://camo.githubusercontent.com/2e31d2eb04ffe32a8bb33060c4c0156ee9d6c4be9e664beb5a27da8b34ee8e85/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d76616c6b79726a61696f5f7068707374616e266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/summary/new_code?id=valkyrjaio_phpstan)

Usage
-----

[](#usage)

Run via the root Composer script:

```
composer phpstan

```

This delegates to `vendor/bin/phpstan --memory-limit=-1` inside the CI directory, using the `phpstan.neon` configuration.

Configuration
-------------

[](#configuration)

The CI directory ships with a `phpstan.neon` that serves as the reference configuration. Key settings:

SettingValueEffect`level``9`Strictest level — all rule categories enabled`treatPhpDocTypesAsCertain``false`PHPDoc types are not blindly trusted; prevents false negatives### Scanned Paths

[](#scanned-paths)

PathIncluded`src/`Yes### Baseline

[](#baseline)

Known issues are tracked in `phpstan-baseline.neon`. Regenerate it with:

```
vendor/bin/phpstan --generate-baseline

```

### Bootstrap

[](#bootstrap)

An `autoload.php` is required in the CI directory to bootstrap the project autoloader before PHPStan analyses the source.

Workflows
---------

[](#workflows)

The [`_workflow-call.yml`](.github/workflows/_workflow-call.yml) reusable workflow runs PHPStan against the calling repository's source. It is designed to be called from other repositories via `workflow_call`.

### Inputs

[](#inputs)

InputTypeDefaultDescription`paths`string—**Required.** YAML filter spec with two keys: `ci` (CI config files that trigger a base-branch fetch) and `files` (all files that trigger the check).`post-pr-comment`boolean`true`Post a PR comment on failure and remove it on success. Disable when the calling workflow handles its own reporting.`composer-options`string`''`Extra flags passed to every `composer install` step (e.g. `--ignore-platform-req=ext-openswoole`).`php-version`string`'8.4'`PHP version to use.`ci-directory`string`'.github/ci/phpstan'`Path to the CI directory containing `composer.json` and the tool config.`extensions`string`'mbstring, intl'`PHP extensions to install via `shivammathur/setup-php`.`additional-directory`string`''`Path to an additional Composer dependencies directory to install before running PHPStan. Leave empty to skip.### Usage

[](#usage-1)

```
jobs:
  phpstan:
    uses: valkyrjaio/ci-phpstan-php/.github/workflows/_workflow-call.yml@26.x
    permissions:
      pull-requests: write
      contents: read
    with:
      php-version: '8.4'
      paths: |
        ci:
          - '.github/ci/phpstan/**'
          - '.github/workflows/phpstan.yml'
        files:
          - '.github/ci/phpstan/**'
          - '.github/workflows/phpstan.yml'
          - 'src/**/*.php'
          - 'composer.json'
    secrets: inherit
```

`secrets: inherit` is required to pass the `VALKYRJA_GHA_APP_ID` and `VALKYRJA_GHA_PRIVATE_KEY` org secrets used for PR comments.

Contributing
------------

[](#contributing)

See [`CONTRIBUTING.md`](https://github.com/valkyrjaio/.github/blob/master/CONTRIBUTING.md) for the submission process and [`VOCABULARY.md`](https://github.com/valkyrjaio/.github/blob/master/VOCABULARY.md) for the terminology used across Valkyrja.

Security Issues
---------------

[](#security-issues)

If you discover a security vulnerability, please follow our [disclosure procedure](https://github.com/valkyrjaio/.github/blob/master/SECURITY.md).

License
-------

[](#license)

Licensed under the [MIT license](https://opensource.org/licenses/MIT). See [`LICENSE.md`](./LICENSE.md).

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance98

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 55% 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 ~4 days

Total

12

Last Release

9d ago

### Community

Maintainers

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

---

Top Contributors

[![MelechMizrachi](https://avatars.githubusercontent.com/u/1179171?v=4)](https://github.com/MelechMizrachi "MelechMizrachi (60 commits)")[![valkyrja-volundr[bot]](https://avatars.githubusercontent.com/in/2462900?v=4)](https://github.com/valkyrja-volundr[bot] "valkyrja-volundr[bot] (49 commits)")

---

Tags

PHPStancivalkyrja

### Embed Badge

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

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

###  Alternatives

[larastan/larastan

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

6.4k51.0M7.4k](/packages/larastan-larastan)[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.

4753.1M82](/packages/shipmonk-dead-code-detector)[ticketswap/phpstan-error-formatter

A minimalistic error formatter for PHPStan

87670.5k52](/packages/ticketswap-phpstan-error-formatter)[calebdw/larastan

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

15104.9k4](/packages/calebdw-larastan)[mrpunyapal/peststan

PHPStan extension for Pest PHP testing framework

4649.8k17](/packages/mrpunyapal-peststan)[saggre/phpdocumentor-markdown

Markdown template for phpDocumentor3

2293.1k41](/packages/saggre-phpdocumentor-markdown)

PHPackages © 2026

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