Coder Social home page Coder Social logo

bgaze / laravel-php-cs-fixer Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 4.0 36 KB

A PHP-CS-Fixer bridge for Laravel 5.5+

Home Page: https://packages.bgaze.fr/laravel-php-cs-fixer

License: MIT License

PHP 100.00%
laravel php-cs-fixer beautify-php fix-php

laravel-php-cs-fixer's Introduction

PHP CS Fixer for Laravel 5.5+

GitHub license Maintenance GitHub release (latest by date) GitHub stars Packagist

This package allows to use PHP-CS-Fixer right into Laravel 5.5+ applications to format PHP code.

Documentation

Full documentation is available at https://packages.bgaze.fr/laravel-php-cs-fixer

Quick start

Install this package using Composer.

$ composer require bgaze/laravel-php-cs-fixer

To customize the configuration, publish it:

$ php artisan vendor:publish --tag=bgaze-php-cs-fixer-config

Notes : Configuration returns an instance of \PhpCsFixer\Config and will be published into a .php_cs.dist file at the Laravel installation root.

Use php-cs-fixer:fix artisan command to fix files in your application:

$ php-cs-fixer:fix [options] path1 [path2 path3 ...]

Use php_cs_fixer() helper to fix files from the code:

// Quick.
php_cs_fixer('path/to/a/file/or/dir');

// Advanced.
php_cs_fixer(['path/to/file/or/dir/1', 'path/to/file/or/dir/2'], [
    '--allow-risky' => true,
    '--dry-run' => true,
    '--config' => 'path/to/a/config/file'
]);

laravel-php-cs-fixer's People

Contributors

bgaze avatar fridzema avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-php-cs-fixer's Issues

Config file does not published

I used the following command to publish the config, but nothing happened.

But the CS Fix command works and it usage the config form the package.

php artisan vendor:publish --tag=php-cs-fixer

Prioritize `.php_cs.dist`

I think, it should prioritize default projects ".php_cs.dist" & ".php_cs" for anything else if --config is not specified.

The correct file is name is .php_cs.* not ".php-cs"

#8

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.