Giter Club home page Giter Club logo

laravel-code-style's Introduction


Laravel Code Style

Code style configurations for Laravel projects using a combination of PHP-CS-Fixer, ECS and Rector.

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

index   ·   installation   ·   usage



Index

> Installation ..................................................................... 
> Usage ............................................................................ 

Installation

Install the package using composer. When prompted to create a GrumPHP configuration file, choose "No".

composer require chiiya/laravel-code-style --dev

Usage

# Publish config files
php artisan vendor:publish --tag="code-style-config"

Next, adjust the ecs.php, .php-cs-fixer.dist.php, rector.php and phpstan.neon files that have just been created in your project folder to suit your project structure.

After publishing the configuration files, you may have to re-initialize GrumPHP:

php ./vendor/bin/grumphp git:deinit
php ./vendor/bin/grumphp git:init

The GrumPHP config includes tasks for PHP-CS-Fixer, ECS and TLint by default. Tasks for rector and phpstan are not included, since they can take a long time. You may choose to execute them separately instead (for example, in a CI pipeline), or add them to your GrumPHP config if you're fine with the longer waiting times:

Example for grumphp.yml

grumphp:
  tasks:
    # ...
    rector: ~
    phpstan: ~

Example for a CI config (call these somewhere in your pipeline):

./vendor/bin/ecs check
./vendor/bin/php-cs-fixer fix --dry-run --diff
./vendor/bin/rector process --dry-run
./vendor/bin/tlint lint
./vendor/bin/phpstan analyse --memory-limit=2G

laravel-code-style's People

Contributors

chiiya avatar dependabot[bot] avatar github-actions[bot] avatar schnoop avatar

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.