2017 © Pedro Peláez
 

library artisan-php-cs-fixer

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel.

image

jackiedo/artisan-php-cs-fixer

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel.

  • Saturday, June 24, 2017
  • by JackieDo
  • Repository
  • 2 Watchers
  • 9 Stars
  • 173 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 4 % Grown

The README.md

Artisan PHP CS Fixer

Total Downloads Latest Stable Version Latest Unstable Version License, (*1)

The PHP Coding Standards Fixer tool fixes most issues in your code when you want to follow the PHP coding standards as defined in the PSR-1 and PSR-2 documents and many more., (*2)

If you are already using a linter to identify coding standards problems in your code, you know that fixing them by hand is tedious, especially on large projects. This tool does not only detect them, but also fixes them for you., (*3)

These are introductions from authors who created PHP-CS-Fixer and this package is a PHP-CS-Fixer bridge for use via Artisan CLI on Laravel. From now on, you can easily use PHP-CS-Fixer differently for each Laravel project with your team instead of installing a global fixer., (*4)

Features of this package

  • Use PHP-CS-Fixer differently for each Laravel project.
  • Run PHP-CS-Fixer command via Laravel Artisan CLI.
  • Easily export the fixer configuration to set up or share with team.

Overview

Look at one of the following topics to learn more about Artisan PHP CS Fixer, (*5)

Versions and compatibility

Artisan PHP CS Fixer don't support Laravel 4.x. Currently, this package have following branchs compatible with Laravel 5.x and later:, (*6)

Branch Laravel version
1.x 5.0 - 5.2
2.x 5.3 - 7.x
3.x 8.x and later

Note: This documentation is used for branch 3.x, (*7)

Note for the version 3.x

If you have used this package before, please see here for the change in v3.x, (*8)

Installation

You can install this package through Composer. At the root of your Laravel application directory, run the following command (in any terminal client):, (*9)

$ composer require jackiedo/artisan-php-cs-fixer

Usage

Get version

Display PHP-CS-Fixer version installed., (*10)

Syntax:, (*11)

$ php artisan php-cs-fixer:version

Fix code

Fix your code with PHP Coding Standards., (*12)

Syntax:, (*13)

$ php artisan php-cs-fixer:fix [options] [path/to/dir/or/file]

Example:, (*14)

// Only shows which all files in your project would have been modified, leaving your files unchanged.
$ php artisan php-cs-fixer:fix --dry-run

// Really fixes all files in your project.
$ php artisan php-cs-fixer:fix

// Only fixes all files in the `app` directory
$ php artisan php-cs-fixer:fix app

// Only fixes all files in the `app` directory with specific configuration file
$ php artisan php-cs-fixer:fix --config="path/to/fixer-config/file" app

Describe rule or rule set

Display description/usage of rule or rule set., (*15)

Syntax:, (*16)

$ php artisan php-cs-fixer:describe name/of/rule/or/rule-set

Exampple 1:, (*17)

$ php artisan php-cs-fixer:describe @Symfony

Exampple 2:, (*18)

$ php artisan php-cs-fixer:describe array_syntax

Configuration

To change the configuration of the fixer with your own purpose, you need publish the configuration file with the artisan vendor:publish as follow:, (*19)

$ php artisan vendor:publish --provider="Jackiedo\ArtisanPhpCsFixer\ArtisanPhpCsFixerServiceProvider"

This will create one file named .php-cs-fixer.php in the root directory of your project. This file is returned an instance of PhpCsFixer\ConfigInterface which lets you configure the rules, the files and directories that need to be analyzed. From now and then, you can share this file with all of your developing team members. The rest is you have to think of a way to always sync this file for your team., (*20)

Exclusion of the cache file

Whenever you run the artisan php-cs-fixer:fix command, one file with named .php-cs-fixer.cache will be created at the root directory of your project. You can exclude this file by append following line into .gitignore file:, (*21)

.php-cs-fixer.cache

License

MIT © Jackie Do, (*22)

PHP CS Fixer official documentation

For more documentation about PHP CS Fixer, you can visit here., (*23)

Thanks for use

Hopefully, this package is useful to you., (*24)

The Versions

24/06 2017

dev-master

9999999-dev

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jackie Do

laravel php artisan standards coding develop php-cs-fixer fixer

24/06 2017

2.x-dev

2.9999999.9999999.9999999-dev

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jackie Do

laravel php artisan standards coding develop php-cs-fixer fixer

24/06 2017

v2.0.2

2.0.2.0

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jackie Do

laravel php artisan standards coding develop php-cs-fixer fixer

24/06 2017

1.x-dev

1.9999999.9999999.9999999-dev

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jackie Do

laravel php artisan standards coding develop php-cs-fixer fixer

24/06 2017

v1.0.3

1.0.3.0

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jackie Do

laravel php artisan standards coding develop php-cs-fixer fixer

24/06 2017

v2.0.1

2.0.1.0

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jackie Do

laravel php artisan standards coding develop php-cs-fixer fixer

24/06 2017

v1.0.2

1.0.2.0

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jackie Do

laravel php artisan standards coding develop php-cs-fixer fixer

23/06 2017

v2.0.0

2.0.0.0

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jackie Do

laravel php artisan standards coding develop php-cs-fixer fixer

23/06 2017

v1.0.1

1.0.1.0

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jackie Do

laravel php artisan standards coding develop php-cs-fixer fixer

23/06 2017

v1.0.0

1.0.0.0

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jackie Do

laravel php artisan standards coding develop php-cs-fixer fixer