PHPackages                             soyhuce/phpstan-extension - 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. soyhuce/phpstan-extension

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

soyhuce/phpstan-extension
=========================

Extra rules for phpstan analysis

2.2.0(2mo ago)120.7k↓25%1[6 PRs](https://github.com/Soyhuce/phpstan-extension/pulls)1MITPHPPHP ^8.3CI passing

Since Mar 11Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/Soyhuce/phpstan-extension)[ Packagist](https://packagist.org/packages/soyhuce/phpstan-extension)[ Docs](https://github.com/soyhuce/phpstan-extension)[ GitHub Sponsors](https://github.com/soyhuce)[ RSS](/packages/soyhuce-phpstan-extension/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (24)Versions (16)Used By (1)

Extra rules for phpstan analysis
================================

[](#extra-rules-for-phpstan-analysis)

[![Latest Version on Packagist](https://camo.githubusercontent.com/464392081752e2e41a056268173880d6c08c10acae016d09c711213b41098e42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f79687563652f7068707374616e2d657874656e73696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/soyhuce/phpstan-extension)[![GitHub Tests Action Status](https://camo.githubusercontent.com/583fd9918c7749627d389434571373151f25dac84753bb9c908a0709eb5e680e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736f79687563652f7068707374616e2d657874656e73696f6e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/soyhuce/phpstan-extension/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/33918f284d86d6160a673040e2099f3c9d750e85a8d1364f75b8ba2b7eb93fcb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736f79687563652f7068707374616e2d657874656e73696f6e2f7068702d63732d66697865722e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/soyhuce/phpstan-extension/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![GitHub PHPStan Action Status](https://camo.githubusercontent.com/faa3a760a151f867a9975249d7119e1c4b703f9a50c3ebcce4656b9cee48c31c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736f79687563652f7068707374616e2d657874656e73696f6e2f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d7068707374616e)](https://github.com/soyhuce/phpstan-extension/actions?query=workflow%3APHPStan+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/1a61698f76003875377afe12d3b52c0fd6a167c762867465f8a04033f580cd24/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f79687563652f7068707374616e2d657874656e73696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/soyhuce/phpstan-extension)

Strict rules for PHPStan and helpers for Laravel

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require --dev soyhuce/phpstan-extension
```

If you use `phpstan/extension-installer`, the extension is automatically installed and you're all set.

Otherwise, you need to add the extension in your `phpstan.neon` file:

```
includes:
  - ./vendor/soyhuce/phpstan-extension/extension.neon
```

If you want only a subset of the rules, check the `/vendor/soyhuce/phpstan-extension/extension.neon` file and copy the rules you want to use.

Rules
-----

[](#rules)

### CarbonCopyRule

[](#carboncopyrule)

Forbids usage of `\Carbon\CarbonInterface::copy()` because it is probably linked to usage of a mutable DateTime.

```
