GithubHelp home page GithubHelp logo

php-cs's Introduction

Preflight

  1. Clone kirschbaum-development/php-cs
  2. cd kirschbaum-development/php-cs
  3. composer install

IDE Configuration

PHPStorm

Inspections (fixer does not run, only highlights violations)

  1. Set the correct php cs fixer binary in:
    • Language & Frameworks -> PHP -> Quality tools
  2. Place the KDG custom .php_cs configuration file in your home directory
  3. Within phpstorm, go to:
    • Settings -> Editor -> Inspections -> PHP -> Quality tools
    • Make sure PHP CS Fixer validation is checked
    • In the right hand pane, after selecting this option, click the browse (...) button and select the .php_cs file previously saved in your home directory
    • Ensure PHP Code Sniffer validation is also set to this Coding Standard in its right pane
    • Click Apply and OK

File Watcher (fixer runs on save action)

  1. In PHPStorm, create a file watcher (under "Preferences->Tools")
  2. Uncheck all of the "Advanced Options"
  3. Edit the following settings:
Name: PHP Style fixer
File type: PHP
Scope: Current File
Path: /{your-global-composer-directory}/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
Arguments: fix $FileDir$/$FileName$ --verbose --config={path-to-your-root-php-cs-dir}/php-cs/.php_cs

VS Code

  1. Install PHP CS Fixer extension
  2. Configure Extension, in Settings as JSON
    "vscode-php-cs-fixer.config": "/{path_to_repository}/.php_cs",
    "vscode-php-cs-fixer.toolPath": "/{path_to_repository}/vendor/bin/php-cs-fixer",
    "[php]": {
        "editor.defaultFormatter": "fterrag.vscode-php-cs-fixer"
    },
    

Sublime Text 3

  1. Find PHP CS Fixer using Package Control: Install Package (cmd-shift-p)
  2. Under Preferences -> Package Settings -> PHP CS Fixer -> Settings - User, configure the extension using the following JSON
    {
        "config": "/path/to/kirschbaum-development/php-cs/.php_cs",
        "on_save": true,
    }
    

php-cs's People

Contributors

brandonferens avatar dvanscott avatar jrseliga avatar navneetrai avatar patricksamson avatar pddevins avatar zerodahero avatar

Watchers

 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.