PHPackages                             odinns/coding-style - 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. odinns/coding-style

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

odinns/coding-style
===================

Shared Rector and PHPStan defaults for Laravel projects.

1.0.3(1mo ago)0163↓100%[2 PRs](https://github.com/odinns/coding-style/pulls)2MITPHPPHP ^8.3CI passing

Since Apr 25Pushed 2w agoCompare

[ Source](https://github.com/odinns/coding-style)[ Packagist](https://packagist.org/packages/odinns/coding-style)[ Docs](https://github.com/odinns/coding-style)[ RSS](/packages/odinns-coding-style/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (7)Versions (7)Used By (2)

Odinns Coding Style
===================

[](#odinns-coding-style)

Shared Rector and PHPStan defaults for Laravel projects.

This package gives Laravel apps a small, boring way to share static-analysis and automated-refactoring rules. The package owns the defaults. Each application owns its paths, baselines, ignore rules, and local skips.

That split matters. Shared config should describe current taste. Local config should describe local history.

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

[](#requirements)

- PHP `^8.3`
- Composer 2
- Rector 2
- PHPStan 2
- Laravel 11, 12, or 13 through Larastan support

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

[](#installation)

Install the published package as a development dependency:

```
composer require --dev odinns/coding-style
```

The package installs Rector, PHPStan, Larastan, and the supported PHPStan extensions it configures.

### Local Path Install

[](#local-path-install)

For local development, install this checkout into another Laravel project as a Composer path repository:

```
composer config repositories.odinns-coding-style path ~/Projects/odinns/coding-style
composer require --dev 'odinns/coding-style:*@dev'
```

Then copy the starter config files:

```
cp vendor/odinns/coding-style/stubs/rector.php.stub rector.php
cp vendor/odinns/coding-style/stubs/phpstan.neon.stub phpstan.neon
```

If the consuming project already has `rector.php` or `phpstan.neon`, merge the package calls into the existing files instead of overwriting them.

Rector
------

[](#rector)

Create a `rector.php` file in the consuming project:

```
