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

ActivePhpstan-extension[Utility &amp; Helpers](/categories/utility)

league/tactician-phpstan
========================

Find missing handlers, incorrect typehints and more.

v0.1-rc1(6y ago)11272[2 issues](https://github.com/thephpleague/tactician-phpstan/issues)MITPHPPHP &gt;=7.2CI failing

Since Sep 18Pushed 3y ago4 watchersCompare

[ Source](https://github.com/thephpleague/tactician-phpstan)[ Packagist](https://packagist.org/packages/league/tactician-phpstan)[ RSS](/packages/league-tactician-phpstan/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Tactician-PHPStan
=================

[](#tactician-phpstan)

[![Travis CI](https://camo.githubusercontent.com/cc4a513cb118e4af07f025468dbac7f3d32ed006dcb0578785273567c7940132/68747470733a2f2f6170692e7472617669732d63692e6f72672f7468657068706c65616775652f74616374696369616e2d7068707374616e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/thephpleague/tactician-phpstan)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/efd3c696ab0050e3c817e39bebdba235d1b52a23f0fc454c36a0202acf71c028/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7468657068706c65616775652f74616374696369616e2d7068707374616e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thephpleague/tactician-phpstan/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/123bc098db882858cbf6af2b0ba890b64e47809b81caead6f382cfeb23f10c60/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7468657068706c65616775652f74616374696369616e2d7068707374616e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thephpleague/tactician-phpstan/?branch=master)[![Build Status](https://camo.githubusercontent.com/2355ec40276fad13643dc10a48d9d4cdc91dfa3d8bd3620ece83ddee4d73d5e4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7468657068706c65616775652f74616374696369616e2d7068707374616e2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thephpleague/tactician-phpstan/build-status/master)[![MIT License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](https://github.com/thephpleague/tactician-phpstan/blob/master/LICENSE)

Static analysis for [a small, flexible command bus](https://github.com/thephpleague/tactician).

Traditionally, command buses can obscure static analysis. The Tactician PHPStan plugin helps bring stronger type checking by finding missing handler classes, validating handler return types and more.

Install
-------

[](#install)

Using Composer:

```
composer require --dev league/tactician-phpstan
```

Register Plugin
---------------

[](#register-plugin)

If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set!

 Manual installationIf you don't want to use `phpstan/extension-installer`, include extension.neon in your project's PHPStan config:

```
includes:
    - vendor/league/tactician-phpstan/extension.neon
```

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

[](#configuration)

You'll need to make your `CommandToHandlerMapping` available to PHPStan. The easiest way to do this is to create a small bootstrap file that returns the same Handler configuration you use in your app.

A simple version of this might look like:

```
# handler-mapper-loader.php
