PHPackages                             matthewnance/laravel-php-cs-fixer - 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. matthewnance/laravel-php-cs-fixer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

matthewnance/laravel-php-cs-fixer
=================================

Laravel wrapper for enforcing proper php coding standards.

v1.0.0(7y ago)014MITPHPPHP &gt;=7.0 &lt;7.3

Since Nov 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/matthewnance/laravel-php-cs-fixer)[ Packagist](https://packagist.org/packages/matthewnance/laravel-php-cs-fixer)[ RSS](/packages/matthewnance-laravel-php-cs-fixer/feed)WikiDiscussions master Synced yesterday

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

Laravel PHP CS Fixer
====================

[](#laravel-php-cs-fixer)

The PHP CS Fixer is maintained on GitHub at bug reports and ideas about new features are welcome there.

> The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards; whether you want to follow PHP coding standards as defined in the PSR-1, PSR-2, etc., or other community driven ones like the Symfony one. You can **also** define your (teams) style through configuration.

This package makes it easier than ever to use PHP CS Fixer to maintain your laravel code by providing access to it via tools that you are already familiar with. An artisan command to fix the code, and manage the configuration the way you do all the other laravel packages you use.

Features of this package
========================

[](#features-of-this-package)

- Run PHP-CS-Fixer commands via Laravel Artisan CLI.
- Laravel Code Style Configuration Used by Default.
- No need to learn a new tool.

Versions and compatibility
--------------------------

[](#versions-and-compatibility)

> **Note:** This documentation was written for Laravel 5.5.

- PHP Version: "&gt;=7.0 &lt;7.3"
- Laravel/Lumen: "5.4.x|5.5.x"
- PHP-CS-Fixer: "2.13.\*"

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

[](#installation)

```
composer require matthewnance/laravel-php-cs-fixer

```

### Register the Provider:

[](#register-the-provider)

For Lumen services, add:

```
$app->register(MatthewNance\Fixer\FixerServiceProvider::class);
```

to `bootstrap/app.php`. For Laravel applications, add:

```
MatthewNance\Fixer\FixerServiceProvider::class,
```

to the `providers` array in `config/app.php`.

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

[](#configuration)

The default rule configuration is in the `fixer.php` and is intended to match the rules used by the Laravel Framework.

```
return [
    'rules' => [
        'psr0' => false,
        '@PSR2' => true,
        'blank_line_after_namespace' => true,
        'braces' => true,
        'class_definition' => true,
        'elseif' => true,
        'function_declaration' => true,
        'indentation_type' => true,
        'line_ending' => true,
        'lowercase_constants' => true,
        'lowercase_keywords' => true,
        'method_argument_space' => [
            'ensure_fully_multiline' => true, ],
        'no_break_comment' => true,
        'no_closing_tag' => true,
        'no_spaces_after_function_name' => true,
        'no_spaces_inside_parenthesis' => true,
        'no_trailing_whitespace' => true,
        'no_trailing_whitespace_in_comment' => true,
        'single_blank_line_at_eof' => true,
        'single_class_element_per_statement' => [
            'elements' => ['property'],
        ],
        'single_import_per_statement' => true,
        'single_line_after_imports' => true,
        'switch_case_semicolon_to_colon' => true,
        'switch_case_space' => true,
        'visibility_required' => true,
        'encoding' => true,
        'full_opening_tag' => true,
        ],
];
```

if you want to modify this yourself, just use artisan `artisan vendor:publish --provider="MatthewNance\Fixer\FixerServiceProvider"`and it will put the default configuration in 'config/fixer.php'. Check the
[PHP-CS-Fixer/README](https://github.com/FriendsOfPHP/PHP-CS-Fixer#usage) for valid rules.

> Note: There are some static configuration settings in the finder that have yet to be moved to the configuration file that you should be aware of! We plan to move these to the config file soon.

```
$finder = Finder::create()
            ->notPath('bootstrap/cache')
            ->notPath('storage')
            ->notPath('vendor')
            ->in(base_path())
            ->name('*.php')
            ->notName('*.blade.php')
            ->ignoreDotFiles(true)
            ->ignoreVCS(true);
```

Usage
-----

[](#usage)

#### Fix Your Code

[](#fix-your-code)

Fix your code with Laravel Coding Standards.

Syntax:

```
$ php artisan fixer:fix [options]

```

Example:

```
Usage:
  fixer:fix [options]

Options:
      --path[=PATH]                    The path. (multiple values allowed)
      --path-mode[=PATH-MODE]          Specify path mode (can be override or intersection). [default: "override"]
      --allow-risky[=ALLOW-RISKY]      Are risky fixers allowed (can be yes or no).
      --config[=CONFIG]                The path to a .php_cs file.
      --dry-run                        Only shows which files would have been modified.
      --rules[=RULES]                  The Rules
      --using-cache[=USING-CACHE]      Does cache should be used (can be yes or no). [default: "yes"]
      --cache-file[=CACHE-FILE]        The path to the cache file.
      --diff                           Also produce diff for each file.
      --diff-format[=DIFF-FORMAT]      Specify diff format.
      --format[=FORMAT]                To output results in other formats.
      --stop-on-violation              Stop execution on first violation.
      --show-progress[=SHOW-PROGRESS]  Type of progress indicator (none, run-in, estimating or estimating-max).
  -h, --help                           Display this help message
  -q, --quiet                          Do not output any message
  -V, --version                        Display this application version
      --ansi                           Force ANSI output
      --no-ansi                        Disable ANSI output
  -n, --no-interaction                 Do not ask any interactive question
      --env[=ENV]                      The environment the command should run under
  -v|vv|vvv, --verbose                 Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

// Only shows which files would have been modified
$ php artisan fixer:fix --dry-run

// Modify the files that need to be fixed
$ php artisan fixer:fix

// Check all the files in the `app` directory
$ php artisan fixer:fix --path app --dry-run

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.7% 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

Unknown

Total

1

Last Release

2734d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15133149?v=4)[Matthew Nance](/maintainers/matthewnance)[@matthewnance](https://github.com/matthewnance)

---

Top Contributors

[![bubba-h57](https://avatars.githubusercontent.com/u/603630?v=4)](https://github.com/bubba-h57 "bubba-h57 (8 commits)")[![matthewnance](https://avatars.githubusercontent.com/u/15133149?v=4)](https://github.com/matthewnance "matthewnance (2 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (1 commits)")

---

Tags

laravel-php-cs-fixer

### Embed Badge

![Health badge](/badges/matthewnance-laravel-php-cs-fixer/health.svg)

```
[![Health](https://phpackages.com/badges/matthewnance-laravel-php-cs-fixer/health.svg)](https://phpackages.com/packages/matthewnance-laravel-php-cs-fixer)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[jubeki/laravel-code-style

Combine Custom Fixers with the ruleset of Laravel Pint to fix your code style in Laravel Applications/Packages.

56521.7k8](/packages/jubeki-laravel-code-style)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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